From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing 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: 

Using combo box inside tree control

Hi Everyone,

I want to use a combo box or Ring control inside any node in the tree control. As shown below pic, the user should be able to select items from the combo box like selecting an instrument type or Serial com port, Connect/ disconnect instrument etc.

 

Referred to some NI examples but didn't find any relevant. any idea? thanksLV tree with combo box option..PNG

0 Kudos
Message 1 of 4
(201 Views)

I haven't done this with a Tree control, only tables or listboxes.

 

  1. I have a text ring control that is normally hidden.
  2. Using an event case, get the cell when the user mouses down.
  3. Populate the ring control with appropriate contents.
  4. Get size & position of clicked cell.
  5. Set size and position of ring control to same as clicked cell.
  6. Make ring control visible in the clicked cell.
  7. After user choses something in ring, make it invisible. (or is they click outside the ring)
  8. Update the table.

The strings in rings can be changed at runtime that is why I use them, never used a combo box. It is a bit of work but can be done.

 

mcduff

0 Kudos
Message 2 of 4
(178 Views)

Hi Mcduff,

Thanks for the solution steps.. well PFA attached an example I tried to implement in a similar way,

But here is some issue am facing. SO, 

1. If I double-click on 1st Node's (Power Supply)---> Action, I get a ring control with Connect/Disconnect option, Well, not exactly overlay on selected "Action" Row and Corresponding "Configuration" Column. 

2. So for the selected Active tag "action  (under 1st node Power supply)" I am not able to see its corresponding "Connect" or "disconnect" string selected from ring control in the Configuration column, instead it's getting added somewhere below or above in an entire tree. So, not able to figure it out.

----------------------------------------------------------------------------------------------------------------------------------------------------

Basically am creating a Script editor module to create a test script for testing DUTs. 

*PFA Script editor.vi

1. I am using tree based control to add instruments, steps etc.

2. So, Final Test script is an XML file.

3. Then, I have to create a "Test script parser" and "Sequencer"  .lvlib module to take each test step data and execute steps accordingly.

4. The whole idea is to create a LabVIEW-based test script editor and sequencer to meet any project requirement.

5. So "insertion pallate tree will have common steps that user can drag and drop into Script editor control.

6. I tried to make script format as <Test Step> -> <Setup>,<Main>,<Cleanup>  like we have in teststand.

7. An XML file is generated. Need to create a Main Cluster to pass to Sequencer lvlib module to parse it.

 

Can you give your thoughts on this?

 

 

Download All
0 Kudos
Message 3 of 4
(132 Views)

Attached is an extremely quick example of what you would need to do. It is a starting point.

 

  1. You need to make a State Machine
  2. I used the JKI State Machine
  3. If you do not have it, download it from VIPM to install, otherwise example will not work.
  4. Make subVIs in the state machine, I did not because of time constraints.

The example shows how to position and size the ring control in the tree. You also need to add states for populating the ring control with the correct values. That will dependent on what tag they clicked.

 

mcduff

 

 

0 Kudos
Message 4 of 4
(118 Views)