LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collapsing right side pane

I am trying to collapse the right side pane in this VI based on the window boundaries so I can run it on multiple screen sizes.  I got the left side one to work in another VI, but I cant seem to get teh right side to work without getting an error that I am trying to resize the pane too small.  What is the proper way to do this?

0 Kudos
Message 1 of 15
(5,322 Views)

The FP panel bounds info is relative to the location of it in the monitor and the splitter location is relative to the pane.  So you need to find the pane size first.  I did this by subtracting the bounds in the attached example.  Second it appears as though the splitter can’t be any further to the right than 26 pixels less than the size of the pane; I figured this out just by manually playing with it.  The same goes for the left the smallest it can be is 18 and since it is relative to the pane I am assuming your definition of collapsed will be setting the left side to 18 as in my example.  Note this was just a quick example and you need to add proper error handling and what not.

 

Hope this helps

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 2 of 15
(5,310 Views)

Thanks but in my app, I keep getting an error 1358 - The splitter bar cannot be moved to thisa position because it violates a minimum or maximum size of a pane.  I even used your code in my event structure for the pushbutton.

 

What is odd is that I dont have any minimum pane sizes specified anywhere.  Any clue as to what could be causing this to occur? 

0 Kudos
Message 3 of 15
(5,297 Views)

@id wrote:

Thanks but in my app, I keep getting an error 1358 - The splitter bar cannot be moved to thisa position because it violates a minimum or maximum size of a pane.  I even used your code in my event structure for the pushbutton.

 

What is odd is that I dont have any minimum pane sizes specified anywhere.  Any clue as to what could be causing this to occur? 


The minimum size of a pane is set by the width of the scrollbar (even if it is not visible) and this width is OS dependant. In Herrlin code the splitter position is set to 18 in the case "Collapse Left Pane", 17 seems to be the default scrollbar thickness in Windows 7 so you have to add 1 more pixel to avoid overlap (I think it bacause of the right minus left operation). Now the splitter position set the position of the left side of a splitter bar that's why the value of the splitter position in the "Collapse Right Pane" event is set to 26 (that is 18 px for the scrollbar + 8 px the default splitter width). If you make the splitter thicker you will get the same error.

You can deal with variable splitter bar width with the following code:

collapse right pane.png

 

Ben64

0 Kudos
Message 4 of 15
(5,278 Views)

Hello, i have the same error collapsing the left pane.

 

How can i solve it?

Image and video hosting by TinyPic
<script type="text/javascript" async src="//cdn.youracclaim.com/assets/utilities/embed.js"></script>
0 Kudos
Message 5 of 15
(5,086 Views)

I always have a hard time finding this.  I buried it in my harddrive a while ago and I don't remember where I found it.  Any way I think it was once called Messing around with Splitters, or Fun with Splitters, now I have it named Messing around with sliding a splitter.

 

In any case it is a demo that shows how panes can be collapsible.

Message 6 of 15
(5,058 Views)

Thank you

 

I'm going to try it!

Image and video hosting by TinyPic
<script type="text/javascript" async src="//cdn.youracclaim.com/assets/utilities/embed.js"></script>
0 Kudos
Message 7 of 15
(5,022 Views)

@Hooovahh

I am trying to implement similar splitters functionality in my VI as per implemented in the example you provided (Messing around with splitters pane demo.zip). I recently started using Splitters so I wanted to use it without OOPS concept. How can i do that?

0 Kudos
Message 8 of 15
(4,231 Views)

What's wrong with object oriented design and classes?  And why does a lack of knowledge of classes prevent you from using this functionality?  I think the demo is pretty easy to understand from the high level.  Just provide the inputs to Init regarding the object references, call the manager, and when done call the close.  That being said if I would have made this from scratch I wouldn't have went as class happy as this developer.

0 Kudos
Message 9 of 15
(4,221 Views)

I would like to use some of the demo code in a project? Do you know who the author is? Is it released under any king of license? Thanks.

0 Kudos
Message 10 of 15
(3,864 Views)