LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit Front Panel Bounds programmably

Hi,
 
   My front panel contains a picture control that fills the panel. I allow the user to resize the window and also apply zoom factors to it. At times, I have to limit the panel size to prevent the panel from being larger than the drawing area of the picture. This is easy to do when the zoom factor is changed, but I'm having trouble finding a good solution when the user reszes the panel.
 
   Currently I am using the "Panel Resize" event to detect when the panel size has changed and if it is too big I use a property node to reset the front panel bounds. This works but is not ideal. Since this is not a filtered event, I can only fix it after it has been moved which means the user can see the front panel background momentarily before I can properly set the size.
 
  Is there a more elegant way to accomplish this task?
 
  Ideally, I'd like to programmably set a limit on the maximum front panel size such that as the user resizes then panel, it just stops at that limit.
 
Thanks in advance,
steve
 
LV 8.2 but soon 8.5
----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 1 of 5
(3,407 Views)
Hello,

Tell me something... Have you tried to right click the picture control and select "scale object with pane"?

This is very basic and I'm sure you already know. But sometimes we don't remenber these simple features.


Software developer
www.mcm-electronics.com





PORTUGAL
Message 2 of 5
(3,379 Views)
Steve,
 
Can you please post the code for me to know more?
- Partha ( CLD until Oct 2027 🙂 )
Message 3 of 5
(3,369 Views)
Thanks for the responses so far,
 
Here are some examples to better illustrate the issue.
 
The first  one (res_win)  shows the default behavior with the picture set to fill the panel and to Scale object with pane. The picture control displays a circle that fills the front panel. When you drag the right side of the front panel, first you see some of the background, then the picture is resized and the background is covered.  This is sort of ugly imho plus I only want the customer to see the circle, not the empty space next to it.
 
The second example (res_win1) uses the Panel Resize event to check for and limit the front panel size, but it still shows the background momentarily which I don't like.
 
 
Thanks again,
steve
 
LV 8.2.1
----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Download All
0 Kudos
Message 4 of 5
(3,362 Views)
A quick & temporary workaround is to colour the FP in White. Smiley Happy
- Partha ( CLD until Oct 2027 🙂 )
Message 5 of 5
(3,352 Views)