a custom dialog to input values More...
A custom input dialog. The dialog class was introduced with release 20200601. The widget of the dialog are added line by line. After composing the dialog will be displayed by calling the exec method.
Example:
dialog d;
d.setWindowTitle("Window Title");
d.addLabel("My text can be entered here!");
d.addLabel("Next line of text....");
stringList sl;sl.append("item1");sl.append("item2");sl.append("item3");
int cb=d.addComboBox(sl,"item3");
d.addLabel("Please enter a number");
int sb=d.addSpinBox(10,2,30);
d.addLabel("Please enter a text:");
int le=d.addLineEdit("text");
int ret= d.exec();
debug.clear();
debug("comboBox selection was:");
debug(d.getString(cb));
debug("spinBox number was:");
debug(d.getInt(sb));
debug("lineEdit text was:");
debug(d.getString(le));
debug("dialog closed with button:");
debug(ret);
debug.show();
The class dialog is available in C++ macros only. For Python and Ruby scripting please use dialog extensions of these scripting languages.
creates a new object
adds a checkBox to the dialog. With the returned id value the entered data can be read out.(introduced with release 20220602)
adds a comboBox to the dialog. With the returned id value the entered data can be read out.
adds a label to the dialog
adds a layer entry to the dialog (introduced with release 20220712)
Example:
dialog d;
d.setWindowTitle("Window Title");
d.addLabel("Please enter a layer:");
int ll=d.addLayer(5);
int ret= d.exec();
debug.clear();
debug("comboBox selection was:");
debug("layer entry was:");
debug(d.getString(ll)+" ("+d.getInt(ll)+")"); // outputs: layername (layernumber)
debug.show();
add a lineEdit to the dialog. With the returned id value the entered line can be read out
adds a spin box to enter integer numbers.
Example:
dialog d;
d.setWindowTitle("Window Title");
d.addLabel("Please enter a number between 1 and 10:");
int ll=d.addSpinBox(5,1,10);
int ret= d.exec();
adds a spin box to enter double numbers (introduced with release 20240301.
displays the dialog to the user and terminated the macro execution until the dialog is closed. The returned number gives the button used to close the dialog.
Return: the state of the check box. (introduced with release 20220602)
Return: the value entered into an double spin box. In case the id number represents an string entry element, the entered string is converted to a double. (introduced with release 20240301)
Return: the value entered into an integer spin box. In case the id number represents an string entry element, the entered string is converted to a integer.
Return: the string entered into the widget with id, integer values are converted to a string
set the title of the dialog display inside the top bar.