LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Array of user interface controls?

I have an application where I have a large number of toggle buttons on a menu, (to work digital i/o) and would like to know what damage I might do if I renumbered the control identifiers in the menus's header file so that
I could access these controls through an array.

Thanks,
David

dtraxler@aautomation.com
0 Kudos
Message 1 of 6
(3,443 Views)
You should be able to manually edit the header file, or do it via setting the Tab Order from the menu.

The only problem is if you were to modify the UIR such that a control ID were to change. Other than that, its not a problem.

If you programitically create the UIR panel, then it should not be a problem (so if you don't at the moment, you can use the UIR Code Wizzard thingy to do this for you).

Chris
0 Kudos
Message 2 of 6
(3,443 Views)
I tried changing the values for the control ids in the menu's header file that and found one issue:
The uir file still sends back the old control id until you edit the menu, at which point it appears to regenerate the header file, (again) using the old control id's.
Creating these controls programatically looks like a better solution anyway.

Thanks,
David
0 Kudos
Message 3 of 6
(3,443 Views)
As Shiner said, you need to edit the Tab Order of the controls in the UIR. The Tab Order is what controls the generation of those control IDs. If you change the Tab Order of the buttons, the generated header file will have the constants in that order.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 4 of 6
(3,443 Views)
One point. If you build the panel up by copying a control, then pasting loads of copies onto the panel, the original tab number stays with the last control you pasted on. This will ruin the order that you think the controls are in. So if you put the values into an array of some sort, then add a control, what worked before doesn't work anymore, and it's not easily apparent why. It's got me before, and is SOOOOO irritating!
0 Kudos
Message 5 of 6
(3,443 Views)
For a large number of similar controls, I manually create a static array of
control identifiers. If the controls have a common call back function, and
the callbackData value is not used, I set the callbackData value to the
array index. This makes it easy to determine which control generated an
event. The same technique can be applied to menu items. Please email me if
you would like an example program.

Regards,
Reed.
//----------------------------------------------------------
Reed Blake
Beta Technology
Industrial and Scientific Computing


David Traxler wrote in message
<506500000008000000AA240000-993342863000@exchange.ni.com>...
>I have an application where I have a large number of toggle buttons on
>a menu, (to work digital i/o) and would like to know what damage I

>might do if I renumbered the control identifiers in the menus's header
>file so that
>I could access these controls through an array.
>
>Thanks,
>David
>
>dtraxler@aautomation.com
0 Kudos
Message 6 of 6
(3,442 Views)