ChildPanelOnParent()

Opens a child panel in the specified panel.

Synopsis

ChildPanelOnParent(string FileName, string PanelName, string ParentName, dyn_string Parameter, int x, int y);

Parameters

Parameter Meaning
FileName File name of the child panel to be opened
PanelName Name under which the child panel is to be displayed
ParentName Module in which the panel is to be opened
Parameters Parameters for transfer to the child panel
x, y Position of the child panel

Return Value

None.

Description

Opens a panel in the parent panel "ParentName". The own root panel can be determined with the function rootPanel(). Except for the additional parameters the function behaves just like ChildPanelOn(). Before the panel is opened a check is made as to whether this panel has already been opened (isPanelOpen()). The size ratio between child and parent panel is 1 (scale = 1). If the size of the parent panel is changed, the child panel is not scaled to the new size.

A child panel can not be resized. The only exception to this is the use of Layout Management in the child panel.

Example

Opens the panel "ChildPanel.pnl" with the name "Testpanel" in the own parent panel at the position 300, 100. Dollar parameters are also passed to the child panel.

main()
{
  string strvar = "example";
  int x, y;
  x = 300;
  y = 100;
  ChildPanelOnParent("ChildPanel.pnl",
  "Testpanel", rootPanel(),
  makeDynString("$p1:first", "$p2:"+strvar),x,y);
}

Since you passed dollar parameters, you can call , for example,

DebugN($p1); and

DebugN($p2); in the child panel.

The first definition DebugN($p1); shows the string "first"; and the second definition the string "Example".

Assignment

panel.ctl

Availability

UI

See also

ChildPanel...(), isPanelOpen(), rootPanel()