ChildPanelOnCentralModalReturn()
Opens a modal child panel, with return value, centered in the calling parent panel.
Synopsis
ChildPanelOnCentralModalReturn(string FileName, string PanelName, dyn_string Parameter, dyn_float &resultFloat, dyn_string &resultText);
Parameters
Parameter | Meaning |
---|---|
FileName | File name of the child panel that is opened |
PanelName | Name with which the panel is opened |
Parameters | List of the $ parameters that are passed to the child panel |
resultFloat | Return value from the child panel |
resultText | Return text from the child panel |
Return Value
None
Description
The function ChildPanelOnCentralModalReturn() opens a modal child panel centered in the calling parent panel with return values. 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. The values are written to the variables resultFloat and resultText of the main panel.
Otherwise the function is the same as ChildPanelOnReturn().
A child panel can not be resized. The only exception to this is the use of Layout Management in the child panel.
When a modal child panel is opened from a modal child panel, the opened child panel is modal application wise, ie. modal to the current UI.
Example
The main panel opens the child panel "childPanels.pnl" modally, centered with return values. The example also passes the dollar parameters "first" and "example".
main()
{
dyn_float dreturnf;
dyn_string dreturns;
string strvar = "example";
ChildPanelOnCentralModalReturn("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);
//Show the 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); returns 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);
}
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