LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tabbing order in tab controls

Hi
How can I set the tabbing order of controls in a tab control on the front panel when having several other controls on the front panel.
0 Kudos
Message 1 of 9
(5,493 Views)
Right-click on the tab and select "Reorder controls In page" from the menu that pops up.
Message 2 of 9
(5,493 Views)
This is not exactly what I meant.
When I'm creating a local variable I can choose its destination (right-click - select item). Because there are so many I would like to reorder the tabbing order to choose the correct on the top.
All this action are taken in the block diagramm.
0 Kudos
Message 3 of 9
(5,493 Views)
From the edit menu, select
Set Tabbing order

changing the tabbing order will also change the order the variables are listed when you want to list or select a local variable
0 Kudos
Message 4 of 9
(5,493 Views)
Is there a way to change the tabbing order without having the order on a list or local change also?

I didn't take that into account when making the program, should have ordered all the control before wiring it all up 😕
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 5 of 9
(5,192 Views)
Hi leachdor,

When you change the tab order of a specific control in LabVIEW, it must then re-order the other controls in order to ensure that each tab order value is only applied to one control, and that there are only as many tab stops as there are controls.  As such, there is no way to simply re-order a single control without modifying other controls.
0 Kudos
Message 6 of 9
(5,150 Views)
Hi and thanks for the response.

I think I may have explained the behavior i'm seeing wrong.  Changing the tab order, you have those two little boxes the first showing the changed order number, and the black background one that shows what it was previously.  Each time you change one, yep you have to change the order of the rest otherwise you might tab and select two fields at once!

The behavior I'm not sure about though, is when I change them to the proper order on the front page, it changes my block diagram.  For example if I have a cluster with 3 items in it, and I change the tab order of the items inside that cluster.  Then if I had previously used an "unbundle" function prior to the tab order change, and it was all wired up with item 1 at the top, item 2 in the middle output, and item 3 as the bottom output - AFTER the change, those controls are no longer at the same outputs.  Given this, if they already had wires coming off them, i'm now sending an incorrect value to the wire attached to that output (since item 1 might no longer be on the top output)

(Can be recreated with a simple VI with 1 cluster as above, with an indicator off each.  Write a string in each one, output to indicator, then change tab order but nothing else and rerun.  Now the bundle changes.)

I'm not sure how it would behave with an "unbundle by name" but in this case I need the "unbundle" several times...which is making for a pain if I want to use the tab control.
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 7 of 9
(5,129 Views)
One of the advantages of using the "Unbundle by Name" rather than the Unbundle is that it is imune from cluster definition changes as you have observed in your code. it is from this reason that I rarely use the bundle/unbundle version prefering the "... by Name" flavor.
 
I hope that helps,
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 9
(5,121 Views)
You can also programatically control the tab order on your front panel, and it really isn't very hard.  The process is as follows:
  1. Create an array of all the controls you want to tab through.  This can include controls buried inside tab controls or clusters (which is one of the nice things about this method).  The order of the controls in the array is the tab order.
  2. In your code, use an event structure with the VI event Key Down? selected.  That "?" is very important, because it allows you to intercept and throw away the event after you are finished with it so the normal tab behavior does not occur.
  3. Use a local shift register or some other safe storage mechanism (action engine, single-element queue) to store the current index in the list of control you will be tabbing through.
  4. In the event, put a case structure.  If the key is anything but a Tab, set the Discard input to FALSE and pass through all the other parameters.
  5. If the key is a Tab, increment the index (make sure it wraps when it hits the end), index the array of controls to get the control reference, and set the Key Focus property of the control to TRUE.  Now check to see if the Key Focus is TRUE (it won't be if the control is hidden).  If Key Focus is not TRUE, increment the index and try again... Don't forget to set the Discard input on the event structure to TRUE.
You will probably want to implement Shift-Tab behavior as well, but that is an easy modification (subtract one instead of adding one to the index).  This method lends itself very well to dynamic applications.  If you have a subpanel you want to inject in your tabbing order, on load, add the subpanel control references to the array of control references at the correct location.

My apologies for not posting code.  I could not find the example I wrote many moons ago Smiley Sad  I will continue looking and post it if I can find it.  Let me know if you have any questions.
0 Kudos
Message 9 of 9
(5,098 Views)