TreeView Widget Drag and Drop Support

Brian Milby brian at milby7.com
Tue Mar 30 20:07:49 EDT 2021


This seems like something I could look into.  Many of the recent improvements (additions) to that widget are things that I added.  On the surface this seems to be not that difficult.  Please add a feature request in bugzilla for this.

For the second issue, this is easily handled in script.  There is a message for ‘hiliteChanged’ that you can use to clear the highlight.  You just need to trap for empty so you don’t create a loop.  We use this approach in SivaSiva where this widget is used a couple places as a menu.  It is useful because you can have the highlight show briefly to indicate the touch/click happened.

Thanks,
Brian

Sent from my iPhone

> On Mar 30, 2021, at 7:28 PM, HENRY LOWE via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I am using the LC TreeView widget to implement a sidebar containing a hierarchical menu in a MacOS app. The widget seems well suited for this purpose and I have successfully created a facsimile of the standard sidebar that is used increasingly in both MacOS and iPadOS apps. However, I need to drag rows from a data grid table to a TreeView widget row in the sidebar but the current implementation of the TreeView widget does not report the TreeView widget row (element) where the drop occurred. A TreeView widget message, such as 'ActionDragDrop pPath’ where pPath is the path to the element that was ‘dropped on’ would be incredibly helpful. I have implemented a workaround method off drag and drop to the widget but it occasionally breaks.
> 
> Looking at the LiveCode Builder documentation, widgets can support the following messages related to drag and drop functionality:
> 
> OnDragDrop, On DragEnter, OnDragFinish, OnDragLeave, On DragMove, On DragStart.
> 
> These messages are not currently supported in the TreeView widget LCB source. Adding them would make this incredibly useful widget even more powerful.
> 
> Another issue that I encountered when using the TreeView widget to implement a sidebar hierarchical menu was that clicking on a row in the TreeView widget toggles the row’s hilite state  - click on an item and it hilites, click on it again and it unhilites. While this may be standard behavior for a list, in a menu clicking on a hilited row should not change the row’s hilite state. It should remain hilited. Only clicking on another row (menu item) should unhilite a row and then hilite the selected row. It would be great to have a ’togglehilite’ TreeView property. If true the TreeView would toggle a row’s hilite state as it does now, while if false it would not.
> 
> Any thoughts?
> 
> Henry
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 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