Drag and Drop in a locked field
Bob Sneidar
bobs at twft.com
Thu Feb 9 20:15:01 EST 2012
Thanks I will give it a go. I have it partially working, but I found if I drag too fast the engine selects another line before dragStart is triggered. Also I had to send dragEnter from the dragStart handler otherwise the process never kicked off. I tried sending dragStart in a mouseDown handler, but that didn't seem to fix it. Weird. This sort of thing should be automatic in the engine IMHO. Seems like a common thing to want to rearrange lines in a list by dragging and dropping.
Bob
On Feb 9, 2012, at 4:50 PM, Ken Ray wrote:
>
> On Feb 9, 2012, at 6:35 PM, Bob Sneidar wrote:
>
>> Hi all. I use locked fields with multiple lines and listBehavior set to true as a kind of menu. Now I am trying to allow the user to rearrange the items in the list. I read in the Dictionary that LC handles drag and drop between *unlocked* fields automatically. Crud. So I tried unlocking the field on mouseDown and then sending mouseDown again in 0 seconds, but that was a bust. I tried just unlocking the field on mouseDown and locking it on mouseUp but that was problematic too.
>>
>> Any easy way to implement this? I could use a datagrid I suppose (grumble grumble) but it would be nice if I could just do this with a simple list field. I want to reorder entire lines by dragging and dropping them.
>
> I'm using a variation of Scott Rossi's "Get In Line" implementation… you can download the stack directly with this URL:
>
> http://www.tactilemedia.com/site_files/downloads/getinline.rev.zip
>
> Scott's got a lot of great tutorials and demos at his site, so you should check out:
>
> http://www.tactilemedia.com/site_files/software/tutorials.html
>
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
>
> _______________________________________________
> 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