Getting drag and drop to copy (not cut) dragged text
Klaus Major
klaus at major-k.de
Sat Oct 25 22:08:27 EDT 2003
Hi David,
> It appears to me that if we select some text from a Metacard 2.5 field
> and drag
> and drop it elsewhere, then
> -- if the drop occurs outside Metacard, the dragged text remains in
> the original
> field, while
> -- if the drop occurs inside Metacard, the dragged text is deleted
> from the
> original field.
>
> I am trying to override this behavior when text is dropped to a locked
> field,
> i.e., I want the dragged text to be displayed in the locked field but
> remain, still selected,
> where it was in the original field. The following procedure does not
> work:
>
> In the card script:
>
> on dragStart
> global textBuffer,locBuffer,chunkBuffer
> -- these globals are used to record the starting condition of the
> field being dragged from:
> put the text of the target into textBuffer
> put the selectedChunk into chunkBuffer
> put the long name of the target into locBuffer
> pass dragStart
> end dragStart
>
> In the script of a locked field:
>
> on dragEnter
> set the acceptDrop to true
> end dragEnter
>
> on dragDrop
> global textBuffer,locBuffer,chunkBuffer
> put the dragData["text"] into me -- This works as expected.
> -- Now try to restore the pre-drag content and selection of the
> source field:
> do "put textBuffer into" && locBuffer
> do "select" && chunkBuffer
> -- But this doesn't happen. The source field has lost the text that
> was dragged out.
> end dragDrop
>
> Can anyone explain what's going wrong and how to fix this?
well, the quickest and most HIG conform workaround will be to just
press the ALT-key while dragging text inside MC ;-)
> Many thanks.
You're welcome...
> David Epstein
Have a nice weekend.
Regards
Klaus Major
klaus at major-k.de
www.major-k.de
More information about the metacard
mailing list