03-22-2011 04:51 AM
Hi
I have created the GUI by adding different controls. When I make some changes in that
xxx.uir file and save it, it automatically do the changes in xxx.h file.
But If want to #define the values for all the controls, how to do that.
For eg :
Autogenerated xxx.h file has
#define PANEL 1
#define PANEL_CHECKBOX_1 2
#define PANEL_CHECKBOX_5 3
#define PANEL_LED_1 4
#define PANEL_CHECKBOX_2 5
#define PANEL_CHECKBOX_3 6
#define PANEL_LED_2 7
#define PANEL_CHECKBOX_4 8
But I want to edit it like
#define PANEL 1
#define PANEL_CHECKBOX_1 2
#define PANEL_CHECKBOX_2 3
#define PANEL_CHECKBOX_3 4
#define PANEL_CHECKBOX_4 5
#define PANEL_CHECKBOX_5 6
#define PANEL_LED_2 11
#define PANEL_LED_1 12
Is it possible to do that?
Please any one help me on this
Regards
NB
Solved! Go to Solution.
03-22-2011 05:28 AM - edited 03-22-2011 05:32 AM
Hi Nagraj,
The autogenerated gui header files should not be edited directly.
CVI assigns control IDs according to their tab order in the UIR panel.
To modify the tab order, activate the panel you want to edit and press Ctrl + T.
This opens a tab-order-editor where you can set the tab order simply by clicking the controls in that desired order.
After you save the file, the header gets refreshed with the new control IDs.
Hope this helps,
P.S: If you want to change these control IDs just to access them in a loop,
I suggest you to put the control IDs in an array and then use the for loop variable as the array's index.
e.g:
int i;
int ctrlArr[5] = {PANEL_RUN_BUTTON, PANEL_LED, PANEL_RING, PANEL_TABLE, PANEL_STOP_BUTTON};
for (i=0; i<5; i++)
{
// good
SetCtrlAttribute (panel, ctrlArr[i], ATTR_DIMMED, 0);
// bad
// SetCtrlAttribute (panel, i, ATTR_DIMMED, 0);
}
03-22-2011 08:02 AM
Hi Eren BALCI,
I had so many controls in my GUI(around 250). So at first I found it difficult to do that.
But finally I am able to change the control IDs as per my requirement.
Thank you for your immediate response.
Regards
NB
03-23-2011 03:33 AM
Hi Eren BALCI,
It was a very good information. Like that if you know short cut keys like ctl+T do share it please.
Thanks
NB
03-23-2011 03:41 AM
Hi NB,
shortcut keys associated to menu functions are shown in the menu itself.
The full list of actual shortcut keys is listed in Options >> Change shortcus keys menu function, which permits you to change each of them in case you want tu customize the default assignments.
03-23-2011 03:48 AM
Thank you Mr.Eren BALCI