ChildPanelOnModuleReturn()

Opens a child panel in the module "ModuleName" with return values.

Synopsis

ChildPanelOnModuleReturn(string FileName, string PanelName, string ModuleName, dyn_string Parameter, int x, int y, dyn_float &resultFloat, dyn_string &resultText, time timeout=86400);

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 that are passed to the child panel
x, y Position of the child panel
resultFloat Return field for floats
resultText Return field for strings
timeout Optional timeout for the panel, default 1 day. 0 = no timeout. If the user does not close the panel, the function returns the value anyway after the specified timeout.

Return Value

None

Description

This function opens a child panel in a particular module with a return value. The function works like ChildPanelOnReturn(), except for the additional indication of the module in which the panel is to be opened. The return values are returned like via the function ChildPanelOnReturn(). 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.

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 child panel "ChildPanel.pnl" in the current module with return values. The return values are set in the child panel and are passed to the main panel. 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;
  dyn_float dreturnf;
  dyn_string dreturns;
  ChildPanelOnModuleModalReturn("ChildPanel.pnl",
  "Testpanel", myModuleName(), makeDynString("$p1:first",
  "$p2:"+strvar),x,y,dreturnf,dreturns);
  DebugN("Return values from the child panel",dreturnf, "and", dreturns);
}

Example

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

Child panel:

main()
{
  dyn_float value1;
  dyn_string value2;
  value1[1] = 66.23;
  //set the value of the variable value1
  value2[1] = "abc";
  //set the value of the variable value2

/* Set the values for the main panel (return values).
  The values are written to the variables dreturnf and dreturns */
  dpSet("_Ui_"+myManNum()+ ".ReturnValue.Float:_original.._value",value1);
  dpSet("_Ui_"+myManNum()+ ".ReturnValue.Text:_original.._value",value2);
  DebugN($p1);
  DebugN($p2);
}

Assignment

panel.ctl

Availability

Window functions