LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

creating child panel in .uir editor

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.

0 Kudos
Message 1 of 4
(3,312 Views)

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...

Message 2 of 4
(3,307 Views)

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:

 

  • Use an array of control IDs and iterate on all controls in a loop (see the solution proposed by DaveC in this discussion; the while discussion can be of some help to understand something on UIR file constants and how are they used)
  • Use a list of controls and SetAttributeForLists: this relies on Lists found in the Programmer's toolbox, a tool that can be of help in some situation
  • Use an array of controls (a feature introduced in CVI 2010)


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 4
(3,303 Views)

Thank you both...helpful information, as always.

0 Kudos
Message 4 of 4
(3,288 Views)