From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree Drag Drop - Insert At Same Level or Indent Detection

Solved!
Go to solution

I have a setup where I am dragging and dropping from one tree to another.  Most items are child only, but some are children and can have children under them.  When preparing to drop the tree reacts showing that a drop will be on the item (and be inserted as a child) or after the item and be at the same level.  Since I need to keep track of operations I'm not using LabVIEW's built in functionality and am instead monitoring the data and inserting into the tree items as needed.

 

So my question is this.  How can I detect when a drop occurs and it should be inserted at the same level as an item, or inserted as a child of that item?  The mouse behaves differently based on where it is when you are dropping but I can't seem to detect what operation I should be doing.  I saw several discussions online about this in regards to a CAR 285577 which it sounded like was rejected.  Any suggestions?  Thanks.

0 Kudos
Message 1 of 4
(3,042 Views)
Solution
Accepted by topic author Hooovahh

It looks like CAR 285577 was indeed rejected. It is also tied to CAR 241471 with the same issue you are experiencing which notes that:

 

"According to this this thread, where Jeffery Peters posted, this is expected behavior"

http://forums.ni.com/t5/LabVIEW/Tree-Control-Drag-Drop-in-LabVIEW-8/td-p/304816 

 

It is unlikely that there are any real workarounds at this point.

Message 2 of 4
(2,973 Views)

It looks like CAR 285577 was indeed rejected. It is also tied to CAR 241471, which states:

 

"According to this this thread, where Jeffery Peters posted, this is expected behavior"

http://forums.ni.com/t5/LabVIEW/Tree-Control-Drag-Drop-in-LabVIEW-8/td-p/304816 

 

It is unlikely that there are any real workarounds at this point.

0 Kudos
Message 3 of 4
(2,973 Views)

Thanks for referencing that thread that apparently I forgot about.  A solution was posted in that thread which does show the ability to drop items on an item or between. It does so by just doing measurements on the pixel location of the drop that took place.  Pretty hacky but it will probably work in my situation.

0 Kudos
Message 4 of 4
(2,960 Views)