Drag and drop within a list field

Paul Dupuis paul at researchware.com
Mon Jul 19 16:21:56 EDT 2021


Devin,

Thank you for the link below. I find it interesting that Scott did not 
use any of the "drag" messages for dragging a line within a field. He 
did use the rarely used "before mouseDown", "before mouseMove" and so 
one to capture various mouse messages related to drag actions and coded 
the drag and drop behavior there.


One thing I have noted is that in LC 9.6.2 STABLE "dragMove" is only 
sent while the mouse is moving. "mouseMove" is similar. Scott used in 
his sample stack a "send in time" action to keep autoscrolling smooth if 
the drag action required the field to autoscroll. I would have hoped 
there was a better way to autoscroll a field during a drag operation 
within the field in LC, but apparently not.

I guess I will need to adapt the "send xxx in 80ms" trick for smooth 
autoscrolling during a drag to my code.

Thank you for the pointer to Scott's sample stack!


On 7/16/2021 11:48 AM, Devin Asay via use-livecode wrote:
> Hi Paul,
>
> Some years back Scott Rossi created a nifty little demo called GetInLine that shows how to do the interface part of drag-reordering. It’s in his archive at http://tactilemedia.com/blog/2018/05/12/blasts-from-the-past/. It might give you a good foundation, even if you don’t use the exact interface he created.
>
> I don’t think the data part of it should be too hard; just make sure you keep the visible list and the custom property synched the same. Or you could possibly use hidden text or metadata tags in you visible list to embed the type for each line.
>
> Hope this helps.
>
> - Devin
>





More information about the use-livecode mailing list