LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding panes at run-time

Solved!
Go to solution

I have a front panel with 6 panes stacked vertically. Each pane has a single raph that scales with the window size. As the window could become quite small, I would like to give the user to hide some of the graph so the entire front panel is filled by just 2 graphs for example. To do this, I wanted to hide some of the panes containing the graphs. Basically this idea exchange from 13 (!) years ago, but that hasn't gotten any updates.

 

Moving the splitter bar only gets you so far since panes seem to have a minimun size, so the graphs aren't completely hidden.

 

The only sort-of elegant solution that I found working was to move each graph into its own subpanel. The subpanel can then be rescaled programatically and the subpanel itself can be hidden while the graph vi is still running in the background. But this method seems needlessly complex if we could you hide the panes themselves.

 

Does anyone have a better way of going about this UI problem?

0 Kudos
Message 1 of 6
(1,783 Views)

Some code would be nice if you posted it...

 

Hiding (graph) indicator can be just done with Hide option, but i don't know how that interacts with splitter bars etc.

0 Kudos
Message 2 of 6
(1,777 Views)

@AeroSoul wrote:

Some code would be nice if you posted it...

 

Hiding (graph) indicator can be just done with Hide option, but i don't know how that interacts with splitter bars etc.


Yes, I can just hide graphs, but the pane will still exist. It has a minimum size, so there'll be some dead space.

 

I've attached some sample code. One is a VI with 6 panes, each containing a graph. Just hiding the graph and moving the splitter bar doesn't look nice. Another is what I mentioned by using subpanels in stead of panes. Which does work, but when resizing the windows, the subpanels lag behing.

 

I was wondering if it was possible to hide a pane, so this process is much more elegant.

0 Kudos
Message 3 of 6
(1,725 Views)
Solution
Accepted by Basjong53

@Basjong53 wrote:

I was wondering if it was possible to hide a pane, so this process is much more elegant.


I'm very much inclined to say: No you can't!

 

The pane looks to me like a feature that is inherent to the front panel itself, not an independent front panel object like any other control. Trying to hide/show panes at runtime has all kinds of implications about resizing the other panes that gets very quickly out of hand when trying to implement it consistently. Much easier to declare it a deferred feature that may be added at a moment sometimes in a far far away future when LabVIEW has taken over the galaxy and nobody wants to program in anything else (which as we all know by now never will happen anyways) 😁

I was already in awe when I saw the pane support added in LabVIEW. Can't imagine how tricky the code would be to allow dynamic pane management but I bet it takes some serious Pythagorean mathematics to get that right. 😁 Not to talk about graphic port handling, clipping and all that stuff that must go on the current pane implementation already.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 6
(1,712 Views)

@rolfk  ha scritto:

@Basjong53 wrote:

I was wondering if it was possible to hide a pane, so this process is much more elegant.


I'm very much inclined to say: No you can't!


Thanks for your answer. I'll accept that I cannot hide panes. The example I have with subpanels will have to do for now.

0 Kudos
Message 5 of 6
(1,704 Views)

I do this kind of thing with "layouts": subVIs that contain nothing but panes and splitters with one subpanel on each pane.  The main front panel has one pane with one subpanel.  I put the desired layout inside that subpanel and then fill the subpanels of the layout.  This lets me switch between, say, six graphs or two graphs or a 3 by 2 set of graphs, or whatever.  All subpanels are set as "fit to pane" so resizing is automatic.

Message 6 of 6
(1,678 Views)