LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating code after changing UIR

Solved!
Go to solution

How do you update your source code (.c) and header file (.h) after making changes to your user interface (.uir) without wiping out previously written code?

 

This happens if I hit Code > Generate All Code and even then, my .h file does not reflect the changes made in the UI.  How can I update the .h file and only add new code to the .c file?

 

PS, it would be cool if the UI function panels had a drop-down list for the ControlID argument listing the controls that have been defined.

 

Thank you.

0 Kudos
Message 1 of 6
(4,575 Views)
Solution
Accepted by topic author DQDave

Hello DQDave,

which version of CVI are you using?

 

Up to CVI2012SP1 things are as follows.

 

By setting Options >> Preferences >> More... and checking options like this way all controls have a unique name and all changes are immediately reflected in the .h file associated to the UIR file when you save it

UIE editor preferences.png

 

To simply add the code for a single control that you have added after generating some code, you can right-click the control and choose Generate Control Callback (or press Ctrl + G): you will receive the following warning in case the function for that contro already exists, otherwise the control callback will be created (Use Code >> Set target file menu option to specify the file where to generate the code)

Code generazione conflict.png

 

Is there anothes situation you are facing thet behaves differently?



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 2 of 6
(4,567 Views)

Thank you, that looks like what I need.  I'm using 2013.

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

You're welcome!



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?
0 Kudos
Message 4 of 6
(4,561 Views)

Concerning your suggestion for a drop-down list for the control IDs, if your goal is to select an IDs from the list of IDs defined in the .h file generated by the UI Editor (as opposed to just using a variable in your program), you do have that ability already. You can see that list by pressing the Enter key (equivalent to the Code>>Select UIR Constant menu item):

 

UIR Constants.png

 

If you uncheck the "Show all control types" option, the list is filtered to show only the constants corresponding to the types of controls that are valid for the function that you're using. For example, this is the list for the PlotStripChart function:

 

UIR Constants 2.png

Message 5 of 6
(4,551 Views)

Thanks. Luis,

 

Another fine suggestion.  Almost as easy as if the dropdown list automatically popped up.

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