LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Upper and lower pane ref. from splitter ref

What I want to do is as follows

 

I have the Splitter reference and i want to get the ref of the pane which is above and below(assuming Splitter is horizontal) the Splitter. however i couldnt find any straight away method to achieve this.

 

 

Also while trying out various properties i found thant position.top property gives some strange values(or i cant understand the meaning of it)

see screenshot of the result i got and the trial vi attached. can anybody explain me what is the significance of position.top value returned.

 

screenshot.png

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 1 of 2
(1,147 Views)

The top position means your controls are offset from the origin by 46 pixels.  The VI Panel has an origin.  With the alignment grid turned on, it is shown as a diamond.  So if you scroll up, you should see it 46 pixels above where your controls are.

 

I can find no direct way to determine the panes relation to the splitter.  There are some indirect ways.  You can use the position of all the elements to determine which panes are aligned with which splitters.  For horizontal splitters, all panes must have the same left position, the same width, and the bottom pane will be positioned just below the splitter, and the top pane's bottom will be just above.  There is probably a way to break it, but I think you would be trying to break it, and you wouldn't see it in practice.

 

Another option which would be relatively easy IF the user moved the splitter.  You can use the event structure to capture the user clicking on the splitter, and then get the pane references when the pane resize event occurs for each pane affected,  Of course, depending on how complex your splitter layouts are, you could get several pane resizes (if your top pane is split vertically, for example).

 

You didn't explain why you are trying to get this information, but the other option if this is specific to this project is to use a subVI to keep track of the panes and splitters.  You can pass the reference of the splitter in, get the label, do a lookup, then pass out the references of the panes.

0 Kudos
Message 2 of 2
(1,122 Views)