DAZ Script | |
---|---|
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=“” ) |
A global static object available via the Global::MessageBox variable.
This object 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( qsTr("MyScript finished successfully."), qsTr("MyScript"), qsTr("&OK") );
Example:
Ask the user a question with 'Yes'/'No' buttons
if( MessageBox.question( qsTr("Do you want to reset the entire figure?"), qsTr("MyScript"), qsTr("&Yes"), qsTr("&No") ) == 0 ){ resetEntireFigure(); }
Example:
Display a warning message to the user
if( MessageBox.warning( qsTr("If you continue, the entire figure will be reset!"), qsTr("MyScript"), qsTr("&OK"), qsTr("&Cancel") ) == 1 ){ return; }
Example:
Display a critical message to the user
var error = doSomething(); if( error != 0 ){ MessageBox.critical( qsTr("The script has encountered a critical error!"), qsTr("MyScript"), qsTr("&OK") ); return; }
Number : critical( String text, String title, String button0, String button1=“”, String button2=“” )
Displays a modal “critical” message box to the user.
Parameter(s):
Return Value:
Esc
key is pressed. Otherwise, the index of the button that the user pressed (i.e., 0, 1, or 2).Attention:
See Also:
Number : information( String text, String title, String button0, String button1=“”, String button2=“” )
Displays a modal “information” message box to the user.
Parameter(s):
Return Value:
Esc
key is pressed. Otherwise, the index of the button that the user pressed (i.e., 0, 1, or 2).Attention:
See Also:
Number : question( String text, String title, String button0, String button1, String button2=“” )
Displays a modal “question” message box to the user.
Parameter(s):
Return Value:
Esc
key is pressed. Otherwise, the index of the button that the user pressed (i.e., 0, 1, or 2).Attention:
See Also:
Number : warning( String text, String title, String button0, String button1, String button2=“” )
Displays a modal “warning” message box to the user.
Parameter(s):
Return Value:
Esc
key is pressed. Otherwise, the index of the button that the user pressed (i.e., 0, 1, or 2).Attention:
See Also: