04-25-2013 09:21 PM
Hi -
I think I need to add a child panel to my UI. I'd put all of my control buttons/boxes on it, and then when I want to make them all disappear, I can just do so through the panel (please correct me if I'm incorrect about this).
Is there a way to create a child panel through the .uir editor? I can't find one. It'd be a lot easier than doing it through code, especially since all my controls exist already and are currently under the main panel.
Thanks.
04-26-2013 12:20 AM - edited 04-26-2013 12:21 AM
You can create child panels in the UI editor, too. There is actually no difference 😉 The only difference is when loading the panel where you specify a parent pamel:
hparent = LoadPanel (0, "panels.uir", PARENT);
g_hchild1 = LoadPanel (hparent, "panels.uir", CHILD1);
Have a look at the example "panels" provided with CVI.
I have to correct myself: there is one difference: for child panels you canset additional sttributes in the UI editor such as frame style...
04-26-2013 12:37 AM - edited 04-26-2013 12:38 AM
Hello mzimmers,
there is nothing special in a panel that designates it as a child or top-level panel: the childhood is given to a panel when you load it in memory, not when you design it! Specifically, if the first parameter in LoadPanel is a valid panel handle, the new panel will be a child of that panel; ir 0, the panel will be a top-level one.
Having said this, I'm not sure I understand the exact reason you want to use a child panel: if it'a just a way to show/hide controls, you can use SteCtrlAttribute (..., ..., ATTR_VISIBLE, ...); command to perform this task. If you have several controls, there are several ways to ease up the task, specifically:
04-26-2013 12:59 PM
Thank you both...helpful information, as always.