Getting drag and drop to copy (not cut) dragged text
depstein at att.net
depstein at att.net
Mon Oct 27 17:08:54 EST 2003
Thanks very much. Dave Cragg found the message I was missing: "dragEnd."
It makes sense that after a "dragDrop" has happened there's a "dragEnd" sent
back to the dragSource, since MC's default behavior needs to react to the
user's choice of drag destination, and either leave or delete the dragged
text in the unlocked source field. So anything I do to that source field in
the dragDrop handler will be undone by MC's automatic response to "dragEnd."
By trapping dragEnd, I can control the fate of the source field.
David Epstein
---
Dave Cragg wrote:
> This seems to work:
>
> In your card script:
>
> on dragStart
> set the dragData["text"] to the selection
> ## don't pass this message
> end dragStart
>
> on dragEnd
> ## need to trap this to stop automatic behavior
> end dragEnd
>
> In the locked field:
>
> on dragEnter
> set the acceptDrop to true
> end dragEnter
>
> on dragDrop
> put the dragData["text"] into me
>
> end dragDrop
More information about the metacard
mailing list