ChildPanelOnModalReturn()

Opens a modal child panel with return values at the position x,y.

Synopsis

void ChildPanelOnModalReturn(string FileName,string PanelName, dyn_string Parameter,int x, int y, 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
x, y Position where the child panel is opened
resultFloat Return value (float) from the child panel
resultText Return text (string) from the child panel
Note: If the user does not close the panel, the function returns the value anyway after a timeout of 24 hours.

Return Value

None

Description

The function works in the same way as ChildPanelOnReturn() with the difference that the panel is opened modally. 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.

  • Open the GNOME window manager configs by executing /usr/bin/gnome-tweaks.

  • Set the "Attach Modal Dialog" property to "off".

On Linux systems the child panel may open centrally to the parent panel and not at the desired position. This is related to the window manager settings. When using the window manager GNOME, this behavior is controlled by the "Attach Modal Dialog" which is set to "on" by default and will set the modal child window centrally to the parent. To deactivate this property, follow these steps:

Please note that this is be a different property in other window managers.

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.

The child panel "ChildPanel.pnl" is opened in the module "Testpanel" at the position x = 300 and y = 100. Dollar parameters "first" and "example" are passed to the child panel. In the child panel values are set and these are passed to the main panel. The values from the child panel are saved in the variables "dreturnf" and "dreturns" and are shown via the DebugN() calls in the main panel.

The first code is the code of the main panel. The second code is the code of the child panel.

main()
{
  dyn_float dreturnf;
  dyn_string dreturns;
  string strvar = "example";
  int x, y;
  x = 300;
  y = 100;
  ChildPanelOnModalReturn("ChildPanel.pnl",
  "Testpanel", makeDynString("$p1:first",
  "$p2:"+strvar),x,y,dreturnf, dreturns);
  DebugN("Return values", dreturnf);
  DebugN(dreturns);
}

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