LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting size of resized UIR panel elements?

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?

 

0 Kudos
Message 1 of 5
(730 Views)

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.

0 Kudos
Message 2 of 5
(700 Views)

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.

0 Kudos
Message 3 of 5
(652 Views)

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:

  • create a sample panel with a bunch of controls in it and save it in .TUI format
  • resize the panel and save it in another .TUI file
  • use FC command to perform a file compare on .TUI files redirecting output to a text file

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.



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 5
(633 Views)

That is an intriguing idea. Thanks!

0 Kudos
Message 5 of 5
(610 Views)