LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Minimum Subpanel Bounds Based on Inserted VI?

So I think I know the answer to this and it is "You can't normally but you can write code that gets close" which isn't what I want to hear.

 

So I have a VI that is set to a minimum VI front panel size.  Wouldn't it be great if I could set a Subpanel to have a minimum size, and set to that VI size?  Then I wouldn't have issues like the attached VI.

 

The front panel has instructions but basically you can make a subpanel so small, that objects on the inserted VI get moved in ways they shouldn't, even when breaking the UI up into panes.  Then things are messed up in a way that can't be recovered without stopping and reinserting the VI.

 

Any suggestions?  I realize there is a minimum pane size, and that works most of the time, but there isn't a guarantee that the subpanel is in a pane and set to resize with the pane.  In this case it is and setting a minimum pane size might be the solution, based on the minimum VI size.

0 Kudos
Message 1 of 6
(3,991 Views)

I almost made a mistake, and posted a reply before reading your very last paragraph 🙂

I also do not think there is a direct way, as you wrote, we need to code around. Silly approach: place the SubPanel into a system TAB control? With this at least you solve the rescaling problem...The TAB control might get hidden when you play with the owning pane, but its absolute size will protect screwing up the inserted SubPanel...

 

"Subpanel to have a minimum size":

Idea exchange candidate?

 

 

0 Kudos
Message 2 of 6
(3,951 Views)

Thanks but this doesn't quite achieve what I was looking for.  The VI I posted gives me the functionality I want, except for when it is made too small.  My that I mean I actually do want the top string to grow in size with the subpanel.

 

Anyway I implemented the minimum pane size, which is calculated based on the minimum VI size of the VI being inserted, after it has been inserted and is running (part of the startup of my VI is to set the minimum FP size).  I wrote code to do this in the nested subpanels I deal with and the result works well enough, as long as that subpanel is made to fit to the pane.  Which in all of my situations will be the case, but I wanted to write code that other developers would use and in those cases I can't guarantee it will be in a pane made to fit.  I posted the idea here.

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

Maybe you could use this as a starting point.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 6
(3,906 Views)

Did you just suggest an XControl?  I'd like to take a kudo away from you now.

 

But this would solve this problem for sure...but everytime I go an XControl one problem is solved and 10 new ones are made.  That being said the XControl I had in mind for this is relatively simple, and has minimal user interactions...Maybe some day for but now I'm still going to implement this with normal subVIs and maybe move to an XControl one day.

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

@Hooovahh wrote:

Did you just suggest an XControl?  I'd like to take a kudo away from you now.

 

But this would solve this problem for sure...but everytime I go an XControl one problem is solved and 10 new ones are made.


I never get to the 10:1 problem.  Whenever a potential solution that I'm pursuing starts creating more problems than it solves, I abandon it and take another route.

Although their quirks can be bothersome, XControls do have their place.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 6
(3,879 Views)