LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I selectively scale objects in a panel when it the panel is resized?

Upon resizing the window of the UI, all objects are scaled with it, causing buttons to get bigger when they don't need to. It effectively alters the resolution of the UI contents and makes it look bad. Someone asked about this years ago and a solution was supposed to be introduced in a newer version (see: http://forums.ni.com/ni/board/message?board.id=180&message.id=10786&query.id=116525)
 
I'm using 8.1.1 so hopefully this feature is present now. Any guidance welcomed. Thanks!
 
Dave Casey


Message Edited by dcasey on 06-19-2008 10:25 PM
0 Kudos
Message 1 of 4
(3,429 Views)
- Remove the auto-resize options from your panel and controls
- use a panel callback
- Catch the EVENT_RESIZE and/or EVENT_SIZING event
- Read the panel width and height
- resize your favorite controls accordingly

One typical case is when you have a graph that occupies the entire surface
of the panel, but you can do much more compilcated, distributing buttons
evenly as the panel enlarges, etc...
--
Guillaume Dargaud
http://www.gdargaud.net/


0 Kudos
Message 2 of 4
(3,403 Views)
Hello Dave,
 
The feature that the other thread was referring to, added in 7.1, was a splitter control. You can use various splitter control in your UI to configure which controls you want to size, and which controls you want to move. Take a look at the samples\userint\docking.prj example program to see how it can be done. And if you want to adjust to incremental panel sizing, instead of a one-teim adjustment, replace EVENT_PANEL_SIZE with EVENT_PANEL_SIZING.
 
Luis
0 Kudos
Message 3 of 4
(3,387 Views)
Thanks to you both for your suggestions. I followed Luis' and it works great. Now for the second part, which I can answer by experimentation but might be nice to mention here for posterity:
 
Most of my UI is a tab panel. Using Luis' advice, I've now got my UI to move my controls and fill the extra space by resizing the tab panel. However, this does not resize the contents of the tabs. So presumably, another set of splitters will be needed on the tab to move/resize its contents accordingly. And since each tab is its own panel, I can expect to need a pair of splitters for each tab. Correct me if I'm wrong.
 
Thanks a bunch!
 
Dave Casey
0 Kudos
Message 4 of 4
(3,381 Views)