07-31-2018 12:51 PM
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
Solved! Go to Solution.
08-01-2018 12:45 AM
yes, there is a way although not an 'automatic' one - you have to rename
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?
08-01-2018 10:55 AM
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.
Thanks and let me know if there is any information I can provide!
Regards,
Vincent
08-01-2018 11:33 AM
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 ![]()
08-01-2018 11:52 AM
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
08-02-2018 03:18 AM - edited 08-02-2018 03:20 AM
I have to disagree with Wolfgang this time ![]()
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.
08-02-2018 03:38 AM
Hm....
I seem to have to disagree with Roberto this time ![]()
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?
08-02-2018 11:35 AM - edited 08-02-2018 11:37 AM
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...
08-02-2018 03:51 PM
This is what I meant, so we agree, fine
Thanks for elaborating!
@RobertoBozzolo
If the associated include file is listed in the project it is not updated, though.
08-03-2018 03:49 AM
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?