Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | dialog.text SEARCH    

  Functions
dialog.close
dialog.html
dialog.isVisible
dialog.show
dialog.text

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

Function
dialog.text

Language: MioScript
Product: MioFactory


Syntax

dialog.text(title, text, buttons, functionName, parentID, x,y)


Parameters

STRINGtitleOptional.
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.
STRINGtextText in the dialog box.
Two HTML tags are supported:
<BR> for New line;
<B> for Bold (applied to all the line).
STRINGbuttonsList 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
CALLBACKfunctionNameOptional.
Name of the function to be called when the dialog box is closed.
IDparentIDOptional.
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,INTx,yOptional.
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.

Dialog Box

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