Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Listbox Multicolumn Listbox and Tree Item Selection

Inspired by a project posted here, I wanted a way to have a devloper make a UI that has selection of items, using checkboxes.  This is a common control a user may see during development, but in LabVIEW it is a more difficult thing to implement with symbols on controls.  So attached is some demo code which expands on that document. 

 

This demo supports right click for select all, select none, and invert selection.  It also supports using the shift key to select and deselect multiple items.  The tree control also supports selecting and deselecting a parent, which propagates to all the children. 

 

Source is saved in 2011 and require the OpenG array package.

 

188835_Item Selection Image.png

 

  

Version 5 - Bug fixes to the tree selection preventing you from modifying a disabled item by editing a parent, and fixed a bug where a parent might appear mixed in large nested trees.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.

Comments
Active Participant viScience
Active Participant

Nice library Brian, thanks!

No I take that back, this is a fabulous library, a huge amount of effort clearly went into this.

Member Paolo1983
Member

Hi all,

I miss the _openG.lib, can you tell to me where I can download It?

Thanks

Proven Zealot Proven Zealot
Proven Zealot

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209027

Basically install VI Package Manager, and install the OpenG Array package, and its dependencies.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.

Member Paolo1983
Member

Perfect,

Thank you so much

Member GT123
Member

Hi,

great work!

I use the tree and I want to add a new functionality: enable/disable the checkbox with the spacebar

I think that I should use the coords of the acitve cell instead of the mouse... but how can I do this.

 

Thank you very much

 

Proven Zealot Proven Zealot
Proven Zealot

Okay this is possible but might be a pain.  Perform a Key Down? event on the Tree control, then in the event look to see if the spacebar was pressed (ScanCode == 57).  If so then get the Active Cell >> Position using a property node.  Then use the Well you could capture a key down? filter event on the tree control, and then perform the Selection Handle Mouse Down and pass in the cell position.  This won't work but will be close.  If you look at the X and Y returned by Cell Position it will be a little off.  This is because this is the coordinates of the top left of the cell which, next we'd need to take into account the intent level. 

 

Or you can go the Force Selection route.  This seems to work well for children, but a parent selection change isn't working, you'd need to figure out how to handle that.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.

Proven Zealot Proven Zealot
Proven Zealot

QControls are starting to gain popularity and as a result I turned this into one, well three actually but from the palette you wouldn't know that because there is a polymorphic VI that selects the appropriate QControl based on the reference wired.  The core of the code is the same as what was posted here but now the code can be put into the a class instead of having extra code be handled in the main application.  Also it is distributed as a package with a palette.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.

Contributors