Drag and Drop
pete at mollysrevenge.com
Tue Feb 8 12:41:50 EST 2011
Thanks Richard, that looks very nice. I too would like to hear how to prevent the snap back you mentioned.
I guess I somehow got the impression it wasn't possible to drag a control from one stack to another with the standard drag/drop handlers somewhere in this thread but this shows it is.
On Feb 8, 2011, at 6:56 AM, Richard Gaskin wrote:
> Peter Haworth wrote:
> > I guess I should look again at the IDE script and see what it does
> > after a control has been dropped onto a card, I bet that would
> > reveal all!
> The Rev IDE drag-and-drop routines were written before the overhaul of the drag-and-drop syntax which has since simplified messaging and allowed us to set the dragImage and dragImageOffsets.
> This quick example shows one way to use the more recent syntax to drag-copy and object from one window to another without having to use an intermediary translucent stack to simulate the drag image:
> go url "http://www.fourthworldlabs.com/rev/drag.rev"
> It inserts a frontScript to track the dragMove message, doing the window hit testing there, removing the script when the action is done.
> The only problem I can find with this approach is that it "snaps back" the dragImage to the source, even though the allowDrop has been set to true.
> I've seen this anomaly with other drag actions as well - if anyone here knows a reliable way to prevent that I'm be most grateful.
> Richard Gaskin
> Fourth World
> LiveCode training and consulting: http://www.fourthworld.com
> Webzine for LiveCode developers: http://www.LiveCodeJournal.com
> LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode