01-28-2020 12:01 PM - edited 01-28-2020 12:04 PM
Scenario:
VI_1.vi is a VI with a vertical locked splitter down the middle
VI_2.vi is a VI with a SubPanel that scales with pane
VI_2's SubPanel is inserted with VI_1. When I resize VI_2, VI_1's splitter moves. I don't want that to happen. How can I lock the splitter of VI_1 in place even if I resize VI_2?
01-29-2020 10:43 AM
Anyone?
01-29-2020 03:36 PM
I tried running your VI and I see that VI_1's splitter only moves when you resize VI_2 smaller than VI_2's left pane. I don't think there is a way to have it not do this since the minimum pane size for panes can't be smaller than 1px, so the right pane has to be at least one pixel when you make it small and that means the left pane has to get smaller (at least as far as I know, I could be proven wrong).
But why is this a problem for you? Maybe if you explain what you're trying to do and why it's causing a problem, we could help you find a way to make it work for what you want to do.
01-29-2020 03:59 PM
Let me explain my intent. I am currently constructing a viewer system with a host VI with multiple splitters, dividing the Front panel of the host into multiple panes. One of the panes contains the sub-panel, which fits the pane in its entirety and scales when the pane resizes.
The host's sub-panel can load and run different Process VIs. Some of these process VI's contain vertical splitters. Note that all splitters, across all VIs in the system, are locked.
Now, if I run my Process VI standalone and resize the window, the splitters don't move. This is expected behavior of course as the splitter(s) are locked. However, when the same Process VI is called from the Host SubPanel, resizing the host SubPanel creates all kinds of chaos in my Process VI.
I was wondering if there was a way to prevent this from happening.
Note: Removing splitters in not an option
01-29-2020 04:10 PM
So here is what I see when I run your VIs (and let me know if you see something different) When your VI_1 is subpanelled in VI_2, I can size the window small enough that it moves the splitter in VI_1. When I run VI_1 standalone (adding an event structure in it so it stays running), I am prevented from sizing the window that small, so the splitter does not move.
So, do you just want to prevent the user from sizing the window too small when running it in a subpanel? If so, then you should just set the minimum pane size of the pane that the subpanel is in.
01-29-2020 04:20 PM - edited 01-29-2020 04:21 PM
No, that's not it. VI_1 could have any splitter configuration. The one I attached is just an example with a splitter down the middle. It could be replaced in the SubPanel during runtime with another VI which has 12 Splitters. My users design those VIs. AS the Architect, I have to ensure that their front panel design isn't modified by resizing the Host, i.e. VI_2.
Also, setting minimum size on VI_1 won't work in any case. That is applicable only in stand-alone mode. Inside a Sub-Panel, the concept doesn't apply anymore.
Because this is not challenging enough, my code will be deployed across at least 15 stations with different monitor resolutions.So, I was looking to see if there was a way to tell the Host process to not mess around with the sub-panel UI. Everything works brilliantly without splitters. The UI is left intact by the host.
PS: My team presented another flavor of this system in NI-WEEK 2018 here in Austin (The presentation by Cirrus Logic in the keynote).
01-29-2020 04:32 PM
I'm not saying set the minimum size on VI_1, I'm saying set the minimum pane size of the pane that the subpanel is in in VI_2.
01-29-2020 05:14 PM
https://forums.ni.com/t5/LabVIEW/Minimum-Subpanel-Bounds-Based-on-Inserted-VI/td-p/3743393
This thread might be helpful for setting minimum pane size.
Or could be there is another way solve your issue - hopefully someone else can chime in if so.
01-29-2020 05:16 PM
Ohh okay! I misunderstood! This is a good discussion!!
Yes, I already have that in place. But depending on which VI is being called, there are cases where the splitter placement in the process VI is beyond the horizontal or vertical extent of the minimum sized pane.
If I knew for a fact that all the process VIs have the same placement location of splitters, I can cache default positions and write an event case on panel resize in the Process VI (VI_1) to restore original placement.
Unfortunately, I don’t have that flexibility. And more importantly, I don’t want to stifle the UI creativity of the other engineers who give me the Process VIs. They’re doing their job right by locking the splitters.
It’s my job that I display their pages correctly in my SubPanel.
01-29-2020 10:01 PM
If the left pane in VI_1 has it's minimum pane size set to (540,1) (horizontal,vertical) then the splitter bar does not move when the subpanel is shrunk (it ends up hidden). Is this what you want? Obviously it becomes a requirement of the process VI designer to do this. You can use a property node to set the panel size at runtime.