Dialog boxes allow the user to send values to the macro from the program interface (before that there were several parameters that can be sent using a G-code string).
The function of calling a dialog window is implemented through the ShowDialogSimple() command. It is designed to call a window that has a text description and several fields for entering a value.
An example of calling the ShowDialogSimple() function:
The result of this command is shown in the screenshot.
A general function template:
|Bool result||a variable that takes on the value true if the "OK" button was clicked and false if the "Cancel" button was clicked.|
|String out1, String out2,..., String outn||the values of the fields that were filled in in the dialog window.|
|String label||a string with a description that will appear in the called window.|
|String in1,..., String inn||strings with values that will be filled fields by default. Count of fields that will be displayed in the dialog window depends on the number of values among the function arguments in1, in2, .., inn.|
The function can also output simple yes/no queries. To do this, it is enough to add one parameter which will be displayed as text and request the result into a variable. Example: