04-21-2023 11:38 AM
I maintain a massive LabWindows 2017 project that has over a hundred UI panels. In the early days, items were added to the panel with "resize" enabled, and sometimes stretched out for placement.
Is there any way to "reset" panel elements back to their original size? All our BUTTONS are different sizes and it looks kind of wonky. Surely there is an easy way than deleting and recreating each and every one of them?
04-22-2023 02:39 AM
Hello Allen,
in the UIR editor you can do a multiple selection of buttons and then set all the same width and height with Ctrl-F10. Then you have align and distribution menus to place everything nicely. The 'stretching' happens during execution when allowing panel resizes and should then apply the same to all.
05-01-2023 08:20 AM
Yes, that is exactly the problem. There are maybe 100 panels that have been stretched, aligned, etc. and I want to reset them back to defaults and fix them to be consistent.
05-02-2023 06:32 AM
I see no easy way to restore original controls and panels sizes: if you have Scale contents on resize option enabled in panel settings, new panel and controls dimensions are stored in the UIR file once the panel is modified and no evidence is retained of original figures.
What you can try is to save the file in .TUI format and post edit the output file if you can derive some way the amount of resizing that has been applied. I am afraid this will not be an easy task, though.
.TUI format is a text files that lists all attributes for panels and controls included in a given .UIR file; in case for example you know that a panel is now 730x550 pixels but it was originally 580x430 you could try to edit the .TUI file and change panel dimensions, next iterate on all controls in the panel and modify top, left, height and width attributes accordingly, then try guessing the appropriate font size for control labels and probably manipulate some other attributes I can't imagine at present. After doing all that try reloading the edited .TUI file and see the results.
Most of this procedure can be automated and you could identify which attributes to address with this procedure:
The output file will lists all changes automatically performed by the UIR editor during resizing and it can drive you in creating your procedure for addressing all panels and controls in your application.
As I said, not an easy task, but with the amount of panels in your application it may worth a try.
05-09-2023 02:42 PM
That is an intriguing idea. Thanks!