ChildPanelOnCentralReturn()
Opens a child panel with return value centered in the calling parent panel.
Synopsis
void ChildPanelOnCentralReturn(string FileName, string PanelName, dyn_string Parameter,dyn_float&resultFloatdyn_string &resultText, time timeout=86400);
Parameters
Parameter | Meaning |
---|---|
FileName | File name of the child panel to be opened |
PanelName | Name with which the panel is opened |
Parameters | Parameters for transfer to the child panel |
resultFloat | Return values from the child panel |
resultText | Return text from the child panel |
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
The function ChildPanelOnCentralReturn() opens a centered child panel in the calling main (parent) panel. 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. The return values are the values that were set in the child panel. These values are written to the variables resultFloat and resultText of the main (parent) panel.
A child panel can not be resized. The only exception to this is the use of Layout Management in the child panel.
Example
Main panel:
Opens the child panel "ChildPanels.pnl " and passes dollar parameters to it.
main()
{
dyn_float dreturnf;
dyn_string dreturns;
string strvar = "example";
ChildPanelOnCentralReturn("ChildPanels.pnl",
"Testpanel", makeDynString("$p1:first", "$p2:"+strvar),
dreturnf, dreturns);
/* Opens the child panel "ChildPanels.pnl" with the name
"Testpanel" and passes the dollar parameters
"first" and "example" to the child panel*/
DebugN("Return values from the child panel", dreturnf);
// Output of return values
DebugN(dreturns);
}
Example
Childpanel "ChildPanels.pnl" :
The values are set here and when the panel is closed they are automatically written to the result fields of the main panel.
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".
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