07-11-2014 11:16 AM - edited 07-11-2014 11:16 AM
Hi,
I had question regarding parent and child window. If i create many child windows in a single parent window, is it possible to save the parent windows and load the same again? I don't need the values of particular control or a indicator in a child window, which is done using config file. So, how to do it? any examples please do post.
07-11-2014 11:25 AM - edited 07-11-2014 11:26 AM
Sorry I am not able to understand your question about Parent and Child window concept, can you please explain that with an image may be? Are you calling the Main and the sub VI windows as Parent and child? Also what do you mean by Saving the Parent window?
07-11-2014 01:10 PM
I believe he is talking about user32.dll calls to make a parent child window relationship. Something like an MDI.
This might be what you want for loading a position relative to a parent..
https://decibel.ni.com/content/docs/DOC-20462
Also you can still use the normal windows dll calls on a window that is a child.
http://www.ni.com/example/29935/en/
In there, there is a VI that can move a window based on a HWND.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-11-2014 01:28 PM
07-11-2014 01:33 PM
What do you want to save and load? The parent control values? The parent position? The child position? The child control values? The children parent relationship?
All can be done you just need to code it. On exit perform the save of whatever it is you want. Then on load go through a routine that loads those settings from a file. The OpenG Variant Configuration palette has Write Panel to INI and Load Panel from INI which makes loading and saving control values quite easy.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-14-2014 03:37 AM
Hi,
To be more clear i have attached a pic of front panel of the current project. In the pic you can see there are many child window (sub vi's) on single parent window (main.vi). The problem, If i save and current parent window and load the same window later, the indicators or child windows should be present with default values. So, how to do it in this manner? any examples?
07-14-2014 03:41 AM - edited 07-14-2014 03:42 AM
Well, first the proper way to do child windows in a main windo is really to use sub panels. They are the LabVIEW native way of embedding VI front panels in other VI front panels and work across all LabVIEW platforms the same. Using Windows API calls, if you do that, is cumbersome, likely to cause all kinds of troubles if you do not know EXACTLY what you are doing and a maintenance nightmare as you will keep running into strange effects with new Windows versions sooner or later.
That said, whatever you do, LabVIEW subpanels or Windows parent-child windows, they are setup at runtime and you as the programmer are the sole responsible person to load them at the right time in the right plkace and with the right content. If you want to have an ability to rebuild a particular constallation of UI, you will have to program a way to save the current constellation into some config file and on reopening that constellation rebuilding that from the config file.
07-14-2014 11:09 AM - edited 07-14-2014 11:11 AM
What did you do when you "save" ?
You can use invoke node "Reinitialize To Default" to make those indicators show default values.
LabVIEW doesn't support child window.
SubVIs are NOT child windows unless you call Windows API to make them child windows.
Are you make Windows API calls with Call Liberary Fuction Node (CLFN) ?
Sorry I have to ask. You didn't give enough information.
07-14-2014 11:34 AM
SubPanels, (since about LabVIEW 7) are not the same as subVIs although you place VIs in them. They are pretty good to implement something akin parent-child Windows but fully LabVIEW native.
08-13-2014 09:08 AM
Hi rolfk,
I tried saving and loading the child vis, but no success. Do u have any example, so that i can clearlz understand how to do it? Or any other ideas pls do tell me.