Drag and Drop

Peter Haworth pete at mollysrevenge.com
Mon Feb 7 01:01:03 CST 2011


Hi Scott,
I guess I'm getting confused since Jacqueline's post said that you can't drag controls from one stack to another, I assume she means with the standard functions and properties provided by LC.  And the IDe doesn't use them either for dragging controls from the Tools palette.

I took a look at your stack and it seems to do just what I want to do.  The only difference I see is that in your script, the destination stack is hard coded and you save its rectangle so you can check if the mouse is over it..  I haven't tried it yet but I think perhaps calling mouseStack when the mouse button is released would get me the info I need.

Too late to try it now, will give it a whirl on Monday.

Pete Haworth

On Feb 6, 2011, at 9:55 PM, Scott Rossi wrote:

> Pete:
> 
> There are several drag and drop references you can explore (for example, the
> LiveCode User Guide found under Help > User Guide, page 262).  LC has all
> the commands to implement what you want.
> 
> On a semi-related note, I have a drag and drop sample stack that is all
> LiveCode script, based on work done by the late Eric Chatonet.  I wanted a
> drag and drop routine that represented dragged objects using their original
> forms, rather than a rectangle.  You can get the stack by executing the
> following in your message box:
> go url "http://www.tactilemedia.com/site_files/downloads/TMdragndrop.rev"
> 
> Start dragging any object and the "drop stack" will open automatically.
> Note that this doesn't use LC's drag and drop routines, and as such has a
> couple of limitations, so learning the "real" drag and drop routines might
> be better in the long run.  But the scripted solution works fine for me.  As
> they say, YMMV.
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX Design
> 
> 
> 
> 
> Recently, Peter Haworth wrote:
> 
>> Sounds perfect!  Now if I only knew how to do that.....
>> Pete Haworth
>> 
>> On Feb 6, 2011, at 5:21 PM, DunbarX at aol.com wrote:
>> 
>>> If you know what controls are where, and you must because you made them,
>>> named them and placed them on your palette, then can't you just get target
>>> info, clone the control, and make it track the mouse until dropped?
>>> 
>>> 
>>> Or am I missing everything?
>>> 
>>> 
>>> Craig Newman
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Peter Haworth <pete at mollysrevenge.com>
>>> To: How to use LiveCode <use-livecode at lists.runrev.com>
>>> Sent: Sun, Feb 6, 2011 4:16 pm
>>> Subject: Drag and Drop
>>> 
>>> 
>>> I would like to set up the equivalent of the LC Tools palette so I can drag
>>> and 
>>> drop some custom controls from it to any card.
>>> 
>>> Mark - I read your excellent write up on Drag and Drop but it seems to be
>>> aimed 
>>> at a different situation than this (dragging info from one control to
>>> another).  
>>> I also used the message watcher to see what happens when I drag an LC control
>>> from the LC tools palette to a card and I didn;t see any of the standard
>>> drag/drop messages.
>>> 
>>> Any tips on how to set about doing this?
>>> 
>>> Pete Haworth
>>> 
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 




More information about the use-livecode mailing list