Lets you display various types of dialog to the user and retrieve the selection or entered text.
Dialog(
string:dlgtype,
string:message,
[string:buttons],
[string:title]
)
→ int
Shows a request dialog with one or more buttons. Returns the ID of the chosen button.
The buttons string can separate multiple buttons with a | symbol. If buttons is not provided the default value is OK|Cancel.
The last button (i.e. Cancel) always has ID 0. Other buttons are numbered from left-to-right beginning with 1.
Dialog(
string:dlgtype,
string:message,
[string:default],
[int:max],
[string:buttons],
[string:title]
)
→ map
Shows a string dialog with one or more buttons. The user can enter a string up to the specified maximum.
Set the dlgtype argument to "s" for a standard string dialog, or "sp" for a password dialog.
The buttons string can separate multiple buttons with a | symbol. If buttons is not provided the default value is OK|Cancel.
The return value is a map with two members; choice provides the selected button ID and text provides the string the user entered.
Dialog(
string:dlgtype,
string:message,
string:options,
[string:title]
)
→ string
Shows a dialog with a drop-down list of choices.
Set the dlgtype argument to "c" for a standard choice dialog, or "cs" for a sorted choice dialog.
The options string should contain one or more choices in the following format: <option 1>[=<value 1>][+<option 2>[=<value 2>]...].
Dialog(
string:dlgtype,
[string:title],
[string:default],
[string:type]
)
→ path or array
Shows a file "open" or file "save" dialog.
Set the dlgtype argument to "f" for a file open dialog, "fm" for a multiple file open dialog, or "fv" for a file save dialog.
The optional type argument lets you provide a filetype mask. For example, *.jpg;*.bmp;*.gif would filter the dialog for JPG, BMP and GIF files. You can also specify file extensions and descriptions separately if desired; for example, Text Files!*.txt!Doc Files!*.doc. Add # to the beginning of the type string to add "All Files" automatically.
For a multiple file open dialog the return value is an array containing all selected files. Otherwise, the return value is a path containing the selected file.
Dialog(
string:dlgtype,
[string:title],
[string:default],
[bool:expand]
)
→ path
Shows a folder selection dialog.