LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Windows inside a main window

Hi,

 

I'm developping an application which, basically, puts data in graphs. The user can add as many graphs as he wants and resize them.

 

Currently graphs are displayed in floating windows than can be placed anywhere on the screen. However my customer wants the graph windows to be constrained inside the window of the main application.

 

This is exactly the behavior of spreadsheet windows in Excel 2007:  when you launch Excel, the spreadsheet windows will always be inside the boundaries of the main Excel window (the orange square on the picture below). Hence, when the main Excel window is moved, the spreasheet windows follow the main window.

 

 

Windows behavior.png

 

I don't know how to easily reproduce this behavior in Labview. Is it even possible?

 

Thanks in advance,

 

Regards,

 

peper

0 Kudos
Message 1 of 7
(3,406 Views)

@peper2001 wrote:

 

I don't know how to easily reproduce this behavior in Labview. Is it even possible?


Yes. The easiest way is to do exactly what Excel does, which is to set the main window to be the parent of the graph window. This is easy enough to do and you can find examples here if you search for SetParent or MDI.

 

This does work, but in my limited experience might have some issues because of the way LV handles its windows and the way it draws things. If you run into issues, a more complex option is to show the VIs in subpanels. This will require you to place enough subpanels in advance so that you can open enough of them (this is very easy) and will require you to manage moving them around as windows, etc. I have also seen examples of this online, including XControls which wrap the window behavior, but I have no specific links.


___________________
Try to take over the world!
Message 2 of 7
(3,391 Views)

Hi tst,

 

Thanks for pointing out that this behavior was refered as "MDI", it makes searching the forum easier!

 

About the subpanel solution that you mentionned, do you mean that I should split the front panel with splitter, add subpanel control to each subpane and then put the front panel of the graph vis in the subpanel?

 

Regards,

 

peper

0 Kudos
Message 3 of 7
(3,361 Views)

peper2001 wrote:

About the subpanel solution that you mentionned, do you mean that I should split the front panel with splitter, add subpanel control to each subpane and then put the front panel of the graph vis in the subpanel?


You don't really need the spllitter.  But your graph VIs will go into the subpanels


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 7
(3,353 Views)

Here is a sample project using a sub panel.

Start it from the run folder using the main.vi

 

It is a work in progress...

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
0 Kudos
Message 5 of 7
(3,325 Views)

Here is an improved and easier to follow version. The naming is more obvious, and I fixed a stopping problem that happened when I changed it to an event structure, but didn't test the stop function.

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
Message 6 of 7
(3,251 Views)

Hi,

 

Thanks for clarifying how to use subpanel in this particular situation.

 

My colleague is currently investing both solutions and so far, the one leveraging the windows dll seems to work fine.

 

Regards,

 

peper

0 Kudos
Message 7 of 7
(3,206 Views)