LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Header file for GUI in CVI

Solved!
Go to solution

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

0 Kudos
Message 1 of 6
(4,590 Views)
Solution
Accepted by topic author Nagraj B

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);

}

S. Eren BALCI
IMESTEK
Message 2 of 6
(4,588 Views)

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

0 Kudos
Message 3 of 6
(4,569 Views)

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

0 Kudos
Message 4 of 6
(4,539 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 6
(4,536 Views)

Thank you  Mr.Eren BALCI

0 Kudos
Message 6 of 6
(4,533 Views)