DzMessageBox Class Reference
[Interface Dialog Objects]

DAZ Script's global static object for displaying message dialogs. More...

List of all members.

Methods

Number critical (String text, String title, String button0, String button1="", String button2="")
Number information (String text, String title, String button0, String button1="", String button2="")
Number question (String text, String title, String button0, String button1, String button2="")
Number warning (String text, String title, String button0, String button1, String button2="")


Detailed Description

DAZ Script's global static object for displaying message dialogs.

The DzMessageBox class is available in DAZ Script via the global variable MessageBox. It provides functions that display pre-built message boxes to the user. This is the easiest way for a script to interact with a user - simply call one of the functions as shown in the following examples:

Example:
Display an information box with an 'Ok' button
    MessageBox.information( "MyScript finished successfully.", "MyScript", "&OK" );

Example:
Ask the user a question with 'Yes'/'No' buttons
    if( MessageBox.question( "Do you want to reset the entire figure?", "MyScript", "&Yes", "&No" ) == 0 ){
        resetEntireFigure();
    }

Example:
Display a warning message to the user
    if( MessageBox.warning( "If you continue, the entire figure will be reset!", "MyScript", "&OK", "&Cancel" ) == 1 )
        return;

Example:
Display a critical message to the user
    var error = doSomething();
    if( error != 0 ){
        MessageBox.critical( "The script has encountered a critical error!", "MyScript", "&OK" );
        return;
    }


Member Function Documentation

Number DzMessageBox::critical ( String  text,
String  title,
String  button0,
String  button1 = "",
String  button2 = "" 
)

Shows a critical dialog box to the user.

Parameters:
text The text that is shown in the body of the dialog.
title The title of the dialog.
button0 The text of button 0
button1 The text of button 1 (if empty, no button will be shown)
button2 The text of button 2 (if empty, no button will be shown)
Returns:
The index of the button that the user pressed (0, 1, or 2)

Number DzMessageBox::information ( String  text,
String  title,
String  button0,
String  button1 = "",
String  button2 = "" 
)

Shows an information dialog box to the user.

Parameters:
text The text that is shown in the body of the dialog.
title The title of the dialog.
button0 The text of button 0
button1 The text of button 1 (if empty, no button will be shown)
button2 The text of button 2 (if empty, no button will be shown)
Returns:
The index of the button that the user pressed (0, 1, or 2)

Number DzMessageBox::question ( String  text,
String  title,
String  button0,
String  button1,
String  button2 = "" 
)

Shows a question dialog box to the user.

Parameters:
text The text that is shown in the body of the dialog.
title The title of the dialog.
button0 The text of button 0
button1 The text of button 1
button2 The text of button 2 (if empty, no button will be shown)
Returns:
The index of the button that the user pressed (0, 1, or 2)

Number DzMessageBox::warning ( String  text,
String  title,
String  button0,
String  button1,
String  button2 = "" 
)

Shows a warning dialog box to the user.

Parameters:
text The text that is shown in the body of the dialog.
title The title of the dialog.
button0 The text of button 0
button1 The text of button 1
button2 The text of button 2 (if empty, no button will be shown)
Returns:
The index of the button that the user pressed (0, 1, or 2)


Generated on Thu Sep 24 12:21:13 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.