LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV_TREE_ITEMS

When we drag an item in tree controll labview creates three data sources viz. LV_TEXT, LV_tree_TAG and LV_TREE_ITEMS

Does anybody know the data type of LV_TREE_ITEMS


Basically i want the default drag drop feature of tree control. only thing i want to restict is that item should be droppable only in its current ident level. (i.e i dont want file to become folder and folder to become file)
Note: My application has four ident levels

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 1 of 5
(3,151 Views)
From the LabVIEW Help:

The LV_TREE_TAG data type is a string that represents the tag from which you drag. The LV_TEXT data type is of type string. The LV_TREE_ITEMS data type is an array of a cluster containing an array of strings, from left to right, in the item you are dragging, an integer representing the glyph index associated with the item from which you are dragging data, and an integer representing the indent level of the item from which you are dragging.
Message 2 of 5
(3,136 Views)

Thanks for your help. I tried your solution but I have one more problem. The array of string returns the strings displayed for dragged row, but I don’t get the tag for that row. E.g. if I am having two items with strings as "item" but if their tags are item_1 and item_2, how can I come to know which item is getting dragged? Does this mean I have to use point to row column function when I start dragging?
 
If this is the case then whole thing will be futile

What I basically want to achieve is this

I have I hierarchy of items listed in tree. User should be able to drag/drop items without changing their indent level.
Now in built drag drop allows to change the hierarchy
To add up my own conditions if I register Drop event then I have to write the code for modifying the tree data myself and I think its not a big issue.
But if I register the “drag starting?” event; then I loose the guide line which shows where the item will get dropped.

Is there any workaround for this?

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 3 of 5
(3,122 Views)
ok above issues are solved now... but does somebody know how can i find out whether i am dropping an item in between two rows or i am dropping an item on another item?

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 4 of 5
(3,116 Views)

Hi Tushar,

I know of no way to directly detect if an item was dropped on top of another item versus it being dropped in between two items.  There is a potential work around.  You could potentially check the item before and/or after the drop to detect where it may have been dropped.

Kevin S.
Applications Engineer
National Instruments

0 Kudos
Message 5 of 5
(3,082 Views)