From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to REMOVE a TAB ORDER association with CONTROL/OBJECT?

Hello.

I have about 6 objects (Controls) on my UIR that automatically have TAB ORDER/VALUE associated with them. If I want only 3 out of the 6 objects to have a TAB order ... can this be done?

Thanks
0 Kudos
Message 1 of 6
(3,587 Views)
Controls that are "Hot" or active will be in the tab order. Controls that are indicators are not in the tab order. If you need Hot controls that are not in the tab order you will have to code it yourself using the EVENT_GOT_FOCUS.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 6
(3,587 Views)
Great!

Thanks again for the response! Will check it out right away.
0 Kudos
Message 3 of 6
(3,587 Views)
So it's really this hard? In LabView, you just popup on the control and select Skip this control when tabbing.

Here's an approach that works in CVI:
1. Build an an integer array of the control constants you want in the tab order.
2. On all hot or normal controls, include a check for EVENT_KEYPRESS.
3. If eventData1 is the keycode for tab or shift-tab, call a function the sets the active control by moving up or down your array of control constants, then swallow the event.

Here's an example for CVI6.0.
0 Kudos
Message 4 of 6
(3,587 Views)
Hi Chris,

Related to this original question, and somewhat solving my problem by changing a few controls to INDICATORS, I ended up doing a few ATTR_DIMMED to disable some controls under certain circumstances.

All was fine in UI land, until tricky user (that would be me trying to crash my own program) decided to go on a tabbing frenzy. It just so happens that when I got to the tab index associated with the DIMMED control, it crashed. I'm thinking because CVI is confused as I made the control HOT and then under a special event, it turns "quasi disabled" by DIMMING it, and when tab index hits it, it freaks out. This is my creative speculation. I get pretty creative at these odd hours.

So, I tried to be even trickier by issuing a few ATTR_CTRL_TAB_POSITIO
N assignments to give a type of circular/recursive tab order such that when the tab counter would hit the "dimmed" control, it would be associated with a new updated TAB order which would point it to a non-dimmed control. Needless to say, it didn't like that either, and crashed again.

So, I ended up with setting the control to a ATTR_NO_EDIT_TEXT which effectively does everything I want, and doesn't disturb the TAB GODS, but doesn't really indicate to the user that the control is inactive as it's not grayed out as I'd like.

I would still like to gray out the control, while keeping the TAB GODS happy. Is this possible or am I doing something overly tricky? 🙂

Thanks in Advance.
0 Kudos
Message 5 of 6
(3,587 Views)
Setting ATTR_DIMMED = 1 disables the control and causes it to be skipped in the tabbing order. It doesn't "quasi disable" it: it disables it. Tabbing will skip it without crashing. You don't need to change the tab order using ATTR_CTRL_TAB_POSITION.

See the attached example. Run the example, use the ring control to select a control to be dimmed, then try tabbing.

Did you see my example to my earlier answer? Is there a problem with that approach for your application? You didn't say you wanted to disable anything, you said you wanted to skip them while tabbing.
0 Kudos
Message 6 of 6
(3,587 Views)