ChildPanelOnModuleCheckPos()

Opens a child panel and also checks the validity of the position and size.

Synopsis

void ChildPanelOnModuleCheckPos(string fileName, string panelName, string moduleName, 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
moduleName Module in which the panel is opened
parameter Parameters for transfer to the child panel
x, y Required position of the child panel

Return Value

None.

Description

ChildPanelOnModuleCheckPos() opens a child panel and also checks its position and size: Before the panel is opened a check is made as to whether this panel is already open ( 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 .

If the entire child panel does not fit in the parent panel, the child panel is positioned so that it can be seen entirely in the parent panel. If it is not possible to display the entire child panel within the parent panel, the position is set to 0,0.

If "moduleName" is empty, the child panel is opened in the current module via myModuleName() .

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" with the name "Testpanel" in the current module myModuleName() ). If the specified position of 300, 100 is invalid, it is automatically corrected. The function also passes the dollar parameters "first"; and "example"; to the child panel.

main()
{
  string strvar = "example";
  int x, y;
  x = 300;
  y = 100;
  ChildPanelOnModuleCheckPos("ChildPanel.pnl",
  "Testpanel", myModuleName(),
  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()