LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming .uir

Solved!
Go to solution

Hello, 

 

I wanted to rename my GUI into a name that is more meaningful. It currently has a generic name such as "Sample."

 

Is there a way I can change both the GUI (.uir) name and the (.h) header name in the project so that if I change the controls in the .uir file, the adjusted header name is changed?

 

Let me know if there is anything I can clarify. 

 

Thanks,

Vincent

0 Kudos
Message 1 of 11
(4,073 Views)

yes, there is a way although not an 'automatic' one - you have to rename

  • both the *.uir and its *.h file in the project (via the menu Edit / Project...)
  • all #include "*.h" statements in your source code files
  • the name *.uir in all 'LoadPanel' and 'LoadMenuBar' function calls

so it should not be too troublesome. Good luck

 


@VincentTang wrote:

Hello, 

 

Is there a way I can change both the GUI (.uir) name and the (.h) header name in the project so that if I change the controls in the .uir file, the adjusted header name is changed?
0 Kudos
Message 2 of 11
(4,054 Views)

Hi Wolfgang, 

 

Thank you for your response.  I should have clarified that I am using CVI 2012, so I am not sure if I missing the option to change the name via Edit-->Project. 

 

When going to Edit-->Project, I am able to change the project label, but I don't see options to adjust the Source (.c) or Header (.h) file names. 

 

Things I tried:

    1.) Right clicking on the file name would only give me the "Find... Ctrl + F" option. 

    2.) Left clicking the file would change the label to the full path of the file. 

 

I see the following buttons, was there any that I was misunderstanding? I looked into most of them except Remove. 

image.png

Thanks and let me know if there is any information I can provide!

 

Regards,

Vincent

 

0 Kudos
Message 3 of 11
(4,038 Views)
Solution
Accepted by topic author VincentTang

Hi Vincent,

I am sorry for the misunderstaning - at present there is no Rename in the Edit menu, you have to Remove the file, rename it outside CVI, and then Add it via the Edit menu. This you have to do twice, for the uir and the include file.

 

Wish you success Smiley Happy

Message 4 of 11
(4,033 Views)

Hi Wolfgang, 

 

No worries, I should have been clear in the original post. I was able to get it to work successfully with the "Removing" method. 

 

Thanks for the help!

 

Regards,

Vincent

0 Kudos
Message 5 of 11
(4,031 Views)

I have to disagree with Wolfgang this time Smiley Wink

Simply open the UIR file and goto to File >> Save As... set the new name and the file is saved with the new name together with the associated include file, and the project is updated accordingly (note: new files are created and the old ones are not deleted: you will need to delete them manually if you want to).

 

However, Wolfgang is right in that the complete procedure needs some manual steps to correct the source files. I partially solve this by adding a

#define    UIR    "myFile.uir"

in a global definition file in the project, next calling

panelHandle = LoadPanel (0, UIR, PANEL);

everywhere I want to load a panel.



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 6 of 11
(4,011 Views)

Hm....

I seem to have to disagree with Roberto this time Smiley Very Happy

 

Yes, I can open the UIR file and use the menu command File / Save x.UIR As, and yes, it will save both the uir and the include file, however on my system it does NOT update the project, the list of include files remains unchanged...?? So, what could be the difference in our settings?

 

0 Kudos
Message 7 of 11
(4,006 Views)

Well, I don't know what may be happening in your scenario. I definitely confirm that when I Save As an UIR included in a project, the project is modified accordingly (*). If the associated include file is listed in the project it is not updated, though. This behaviour is consistent at least from CVI2009.

 

As an alternative, once you have saved the UIR with the new name you can right-click on the old UIR file in the project and use Replace File in Project function to load the new file. You'll still have to manually update the sources.

 

 

(*) This does not happen when you use Save Copy of <file.uir> As...



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 8 of 11
(4,001 Views)

This is what I meant, so we agree, fine Smiley Happy Thanks for elaborating!


@RobertoBozzolo

If the associated include file is listed in the project it is not updated, though.

0 Kudos
Message 9 of 11
(3,995 Views)

Yeah, I didn't focused on it since I'm not used to add the UIR include files to the project. I know they are actually needed for the project to compile but you don't need to have them listed in the project for it to compile and run; moreover, since they are automatically updated by the IDE and modifying them is risky besides being useless I do not add them to my projects.

Is there any actual reason for you to have them in the project, besides explicitly knowing and listing all needed files?



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 10 of 11
(3,983 Views)