|
|
|
|
Functions
MioScript Reference
|
|
Syntax
| dialog.text(title, text, buttons, functionName, parentID, x,y) |
Parameters
| STRING | title | Optional. Title of the dialog box. If this parameter is set to null, the application title is used. The application title is defined with app.init or app.title.
| | STRING | text | Text in the dialog box. Two HTML tags are supported: <BR> for New line; <B> for Bold (applied to all the line).
| | STRING | buttons | List of buttons in the bottom of the dialog box, with | as separator. You can define tree buttons as follow: button A|button B|button C
| | CALLBACK | functionName | Optional. Name of the function to be called when the dialog box is closed.
| | ID | parentID | Optional. ID of the parent window. When a parent window is specified, the dialog box will always be in front of the parent window, and will be displayed in the same monitor than the specified window.
| | INT,INT | x,y | Optional. Position of the dialog box in the screen. If not specified, the dialog box is centered in the screen. |
Return value
No value is returned.
Description
Displays a dialog box with a title, a text and up to three buttons.
If Enter is pressed when the dialog box is visible, the callback function is called with the index set to 0 (first button).
The MioScript code is not stopped when the dialog box is displayed.
When the user clicks a button, the specified function is called with the index of the button as first argument.
To customize the color of the buttons, you can proceed as follow before calling the function:
&DLG_BT_A_color = num.rgb(240,255,240) // Color of the first button
&DLG_BT_B_color = num.rgb(255,255,255) // Color of the secondbutton
&DLG_BT_C_color = num.rgb(255,255,255) // Color of the third button
|
This function can be called from JavaScript with mio_dialog. |
MioScript Sample Code
event.load
dialog.text("My Application", "Please choose Ok or Cancel.", "Ok|Cancel", dialog_cb)
event.end
function.dialog_cb(&button)
alert(&button)
app.close()
function.end
|
|
|
|