LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Maintain aspect ratio on panel re-size

I think it would be valuable to have a panel attribute "Maintain aspect ratio on resize" that would apply to manual resizing (not maximizing) a panel.
 
I know this is doable with panel callbacks and EVENT_PANEL_SIZE but a native solution that shows that constraint while dragging a corner would be better.
 
And given the nature of many of our UIs I think this would often be used.
 
Any comments before I submit a product suggestion?
 
--Ian
0 Kudos
Message 1 of 6
(3,786 Views)
It is a very good suggestion. I agree with you, this function should be native.



0 Kudos
Message 2 of 6
(3,771 Views)
This is possible using the EVENT_PANEL_SIZING. This method shows the constaint while dragging the corner or side of the panel. Check out the attached example program.
Message 3 of 6
(3,745 Views)

That is much nicer to see the constraint live, rather than have the window unexpectedly snap to a different size after releasing the mouse button.

While a simple checkbox for the panel attribute would have been ideal, this solution works for me.

Thanks, Jared!

--Ian

0 Kudos
Message 4 of 6
(3,716 Views)

I realize that this topic is very old; however, this example in LabWindows does exactly what I would like to do in a LabView GUI.  If anyone could suggest how to do this in LabView, either natively or through a call to a DLL based upon this LabWindows example, I would greatly appreciate it. 

Thanks,

Jason

 

0 Kudos
Message 5 of 6
(3,102 Views)

Since this is now a LabVIEW question, I would recommend to post it in the LabVIEW forum!

 

The event structure has a "This VI...panel resize" event and you can probably use it to enforce a certain aspect ratio. 

0 Kudos
Message 6 of 6
(3,096 Views)