LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix control's position in front panel pane

Hello all,

I'd like to share some of my experiences I had while trying to place different controls on a front panel with splitters. In the following I will only use the term control although the same is true for indicators.
The aim was to place a graph indicator which should always fit to the pane while resizing the front panel. To save space I didn't want to use the built in axis labels and placed string indicators near to the end of both the X- and Y- axis. There are other cases where it is necessary to place a control on top of another, self resizing control, e.g. buttons over a table control, menu rings over a multicolumn listbox and so on. This makes it necessary, that the position of the floating controls relative to the underlying control stays the same. But LabVIEW tries to distribute the controls in a pane on its own (probably by the distance to a pane border proportionally to the pane size).

 

 

To illustrate the problem, I attached a VI, divided into four panes, three of them containing a graph control with two string controls, representing the axis labels. Picture 1 shows the front panel. In the upper left pane the controls are only placed and as the VI is resized in height, you can see that the string controls lose their position. This effect is even worse in the lower left pane, where there is activated the "Scale Objects While Resizing" option. With this property activated, the X- axis label even doesn't return to its position, when you drag the bottom edge of the window to enlarge the height of the window and without releasing the mouse button drag the window height to its original size.
To prevent the string controls from changing their position, an anchor is needed. I took a decoration flat box, made it transparent, placed it in the corner near to the string control, grouped the deco and string control and locked it. All this is shown in Picture 2.


When the controls are locked they don't change their position relative to the border of the surrounding pane. You can verify this by changing the window size and view the upper and lower right panes. The difference between the panes is the activated "Scale Objects While Resizing" option for the upper right pane. This is the behaviour I wanted.
But there is still one thing to do: If you drag the horizontal splitter very down, release the mouse button and drag it back to the original position, the X-axis label sticks to the top of the pane. This is because the pane size became smaller than the size of the String control - deco group. This makes it necessary to prevent the pane from getting smaller than a certain size. This can (as far as I know) only be done by a property node of the pane, called "Minimum Pane Size". I don't understand why this property is not settable via the pane properties dialog window.
It was set for the upper right pane. This pane now is the only one which has all needed features and behaves as expected.
After the string control - deco group is locked it is hard to change the position since it isn't selectable from the front panel. The only way to select it is to draw a frame with the mouse into the string control. Then the group is surrounded by a grey selection frame and it is possible to unlock the group. In this case it is necessary first to hide the graph control from its block diagram terminal's context menu since trying to draw a frame with the mouse would result in moving the graph control.
Another word to the position of the group: it is essential to place the group at least one pixel outside the visible portion of the pane or align it with the edges of the graph control via the align buttons. This is illustrated in picture 3.

 

 

I really would appreciate any comments and recommendations.
Greets, Dave

Message Edited by daveTW on 10-27-2009 05:41 PM
Greets, Dave
Message 1 of 9
(9,796 Views)

Hello all,

I forgot to write some default values into the string controls, that's why they are invisible. Now the FP looks like:

 

 

 

greets, Dave

Greets, Dave
Download All
0 Kudos
Message 2 of 9
(9,720 Views)
When I tested the VI in the original post in LV 2009 all panes seemed to behave the same (i.e. OK) regardless of the tricks I tried. Can you post an image or a video showing the actual problem you're having?

___________________
Try to take over the world!
0 Kudos
Message 3 of 9
(9,688 Views)

Hello tst,

 

I forgot to write some values into the axis-label strings and set them as default. This is done with the VI in my second post. It looks now like this:

 

 

 Now change the FP window in size and move the splitter as I described in my first post and you will see, that in the left panesthe string controls move around.

 

greets, Dave

Greets, Dave
0 Kudos
Message 4 of 9
(9,660 Views)

Ah, I see what you're saying.

 

I don't have any suggestions, though, as this isn't an area I have any experience with.


___________________
Try to take over the world!
0 Kudos
Message 5 of 9
(9,653 Views)

I will preface this by saying I have never tried to do exactly what you are doing, but similar issue occur when simply resizing a panel.  There are several:

  1. LabVIEW does not remember the original position of controls, so resizing the front panel and proportionally moving things can result in a lot of hysteresis due to roundoff.
  2. Not all things resize properly on resize of the panel/pane.
  3. Changing the size of an object can be an exercise in frustration, since almost all objects have different ways to change their sizes.

As a result, I usually turn off all LabVIEW automatic behavior (uncheck all things on the Window Size pane of VI Properties) and do everything myself.  It is more tedious, but you get exactly what you want.  Use the event structure to determine when the panes have changed size and modify your positions and sizes as needed.  If you find yourself flooded with events and are not keeping up with processing them, there are good techniques to throw away the unneeded ones.  You may also want to Defer Panel Updates while you resize things.

 

If any of this does not make sense or you need more help, let us know.

Message 6 of 9
(9,647 Views)

I found an easier way to anchor a control's position on the front panel. Smiley Happy

 

For the control you want to anchor, show the label and place it outside the panel (above or to left). You don't even need to place it in a "safe zone". Use the caption instead of the label if you need to show it next to the control.

Certified LabVIEW Architect
Message 7 of 9
(8,093 Views)

Thank you for this very strange trick to solve this problem. It still works in LabView 2019 🙂 even though I would considered it more a bug than a feature.

0 Kudos
Message 8 of 9
(3,938 Views)

Its even possible to "anchor" some controls to the left of a pane AND some to the right, without using a splitter. Do this by placing an invisible indicator (e.g. a "simple string") at the place of the pane where all things to the left shall stay left, and all to the right shall stay right. Make the invisible control scale to pane:

 

resize pane.gif

 (The VI is not in run mode, so you can see the size-to-pane-lines around the invisible string)

Certified LabVIEW Architect
Message 9 of 9
(3,405 Views)