LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add a title bar to a sub panel and make it movable?

How do I add a title bar to a sub panel and make it movable?

0 Kudos
Message 1 of 18
(5,223 Views)

Hi Steve,

 

you want to move the FP of a VI inside a subpanel container?

 

Create a button, check it's mouse click/move events and move the origin of the subVI's FP accordingly!

There used to be an example VI showing how to do this with FP objects, use it as reference.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(5,214 Views)

Hello,

 

On the Controls palette select Decorations, there is a free label in there you can use for your front panel.

 

Best regards.

0 Kudos
Message 3 of 18
(5,211 Views)

Well, I've never tried to programmatically size, move, or "name" my sub-panels, but they do have some properties and you could write a little test VI (which is how you really learn how LabVIEW works) to try things out.  First of all, the Sub-Panel has a Label, which you can make Visible.  It also has the Position, Bounds, and Container Bounds properties.  I'd suggest creating a Sub-Panel, populate it, read the values of "interesting" Properties and see how they change as you move and resize the Sub-Panel, then try setting them and seeing what that does.

 

Bob Schor

0 Kudos
Message 4 of 18
(5,205 Views)

Take a look at Mike Porter's (Not a Tame Lion) blog on the subject.  I've never been a big sub-panel user but his techniques have me interested in incorporating them more often:  http://www.notatamelion.com/category/subpanels/

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 5 of 18
(5,189 Views)

This is the method I got to work, but it is too messy for practical use and does not look standard compared to all the other windows. Can't NI just add this as a built in feature to the subpanel control?

0 Kudos
Message 6 of 18
(5,132 Views)

@Steve_Block wrote:

This is the method I got to work, but it is too messy for practical use and does not look standard compared to all the other windows. Can't NI just add this as a built in feature to the subpanel control?


I suppose they could.  LabVIEW is a programming language and at some point the programmer has to take responsibility to use the language to create what he needs.  LabVIEW tries hard to provide advanced built-in tools so if enough people want something, they will often oblige.  Post your request in the NI Idea Exchange:  http://forums.ni.com/t5/LabVIEW-Idea-Exchange/idb-p/labviewideas  I would love to have a versitile sub-panel control that came with options for a title bar on top, a status bar on the bottom and maybe docking/floating side bars for user controls and indicators.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 7 of 18
(5,115 Views)

@Steve_Block wrote:

This is the method I got to work, but it is too messy for practical use and does not look standard compared to all the other windows. Can't NI just add this as a built in feature to the subpanel control?


I'm sure they could, but you would have to justify the need. Personally, I can't say I have had the need.

 

In any case, the only "standard" I know of is using the OS parenting functions to define windows as children of other windows, and I'm having a hard time coming up with programs which actually use this. Office used to do it, but they stopped quite a few versions ago (except maybe for comparing documents)? There are programs which do this for floating toolbars by setting them to be modeless windows (and that includes things like the context help in LV, although I don't think that's actually set as a child of any window), but those are generally used as helper windows, not as the actual content. When I think of things like the tab grouping arrangement window in Firefox or the multiple panes in Blender, those are set up using custom code.

 

Anyway, you can certainly call the code as a separate VI and then set that VI window to be a child of your window, and then you won't need a subpanel. You should be able to find examples by searching for MDI.

 

Otherwise, it should certainly be possible to wrap up the subpanel in an XControl or hide its handling code in brat VI and I have seen multiple examples over the years of people doing this, including things like minimizing and restoring. That way, your calling code stays simple.


___________________
Try to take over the world!
0 Kudos
Message 8 of 18
(5,090 Views)

Yeah MDI and parent child things are fun to play with.  I have a couple fun examples.

 

Inserting Notepad into a front panel.

http://forums.ni.com/t5/LabVIEW/How-to-run-an-exe-as-a-window-inside-a-VI/m-p/3113729#M893102

 

Very preliminary API for inserting multiple VIs into a front panel and tabs.

https://lavag.org/topic/17046-multi-panel-interface/

0 Kudos
Message 9 of 18
(5,032 Views)

I was able to use the Set Parent call from user32.dll to do what I wanted, however, I get a crash report half the time when I close the executable. Do I need to do anything to close the dll? I noticed that LabView 2014 tends to give this crash report for DLLs that are not closed while 2009 didn't. Is there any way to just disable the crash report since I don't care when we are just exiting? Thanks.  

0 Kudos
Message 10 of 18
(4,913 Views)