LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree control of clusters

Is there a way in Labview to use a Tree Control with a cluster (containing boolean, number, and string) vs. just a string?
 
I am trying to develop a test sequencer where the operator can expand and hide parent and child branches of a tree control and select or de-select (with boolean button) each line item in the tree independantly. I know the tree control can have "symbols" for each item, but they are not functional controls themselves.
 
Any suggestions?
Thanks
Steve M.
0 Kudos
Message 1 of 5
(4,320 Views)
There's no way to display anything other than strings in the tree control, with an optional glyph at the beginning of each line.  I have implemented "checkboxes" in the tree control before, where I displayed a checkbox glyph that I would change between checked and unchecked, depending on if the user clicked on it.  You can use the "Point to Row-Col" method on the tree control whenever there is a Mouse Down on the tree control to see whether or not the user clicked in the glyph region, and if so, change the glyph accordingly.  This method is available in LabVIEW 8.0 and later...if you're using LabVIEW 7.x, you'll need to use the Point to Row-Col.vi that exists in vi.lib\tree.
 
Good luck,
-D
0 Kudos
Message 2 of 5
(4,311 Views)
Hi Darren,

I am using Labview 8.2. Do you have any examples vi's that you use the mouse down event for the tree control?

I am trying to create a tree in which if a parent line item is selected it will toggle  the symbol for the parent and all sub-children. If only child is selected it will only toggle the child's symbol.

Thanks
Steve M.
0 Kudos
Message 3 of 5
(4,298 Views)

I have written some shipping code (password-protected, unfortunately) that accomplishes what you describe, but I don't have any public examples of it.  You have to create a data structure that represents the tree...when you get a Mouse Down event, and the Point to Row-Col method indicates that the glyph was clicked, you have to recurse your data structure to see if there are any children of this item, and if so, change their glyphs too.  It's not easy, but it is possible...if you have the VI Analyzer, you can see it in action in the Tests tree of the "Select Tests" page.

Good luck,
-D

0 Kudos
Message 4 of 5
(4,293 Views)
This is a generic example that shows letting you toggle checkboxes for items in a tree. Nothing fancy, but you can tailor it to your needs.
Jarrod S.
National Instruments
0 Kudos
Message 5 of 5
(4,286 Views)