05-24-2022 02:45 AM
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?
Solved! Go to Solution.
05-24-2022 03:14 AM
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.
05-25-2022 03:13 AM
@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.
05-25-2022 03:47 AM - edited 05-25-2022 03:49 AM
@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.
05-25-2022 04:18 AM - edited 05-25-2022 04:19 AM
@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.
05-25-2022 09:21 AM
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.