Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

confirmDialog [-backgroundColor float float float] [-button string] [-cancelButton string] [-defaultButton string] [-dismissString string] [-message string] [-messageAlign string] [-parent string] [-title string]

confirmDialog is undoable, NOT queryable, and NOT editable.

The confirmDialog command creates a modal dialog with a message to the user and a variable number of buttons to dismiss the dialog. The dialog is dismissed when the user presses any button or chooses the close item from the window menu. In the case where a button is pressed then the name of the button selected is returned. If the dialog is dismissed via the close item then the string returned is specified by the dismissString flag.

The default behaviour when no arguments are specified is to create an empty single button dialog.

Return value

stringIndicates how the dialog was dismissed. If a button is pressed then the label of the button is returned. If the dialog is closed then the value for the flag dismissString is returned.

Flags

backgroundColor, button, cancelButton, defaultButton, dismissString, message, messageAlign, parent, title
Long name (short name) Argument types Properties
-title(-t) string create
The dialog title.
-message(-m) string create
The message text appearing in the dialog.
-messageAlign(-ma) string create
Align the message left, center, or right.
-button(-b) string createmultiuse
Create a button with the given string as it's text.
-defaultButton(-db) string create
The default button is activated by pressing the enter key. Note that this flag does not create a button, it simply indicates which button created via the button flag shall respond to the enter key.
-cancelButton(-cb) string create
The cancel button is activated by pressing the escape key. Note that this flag does not create a button, it simply indicates which button created via the button flag shall respond to the escape key.
-dismissString(-ds) string create
The string returned when the user selects the 'Close' item from the Window Manager menu. If this flag is not set then the string "dismiss" is returned.
-parent(-p) string create
Specify the parent window for the dialog. The dialog will be centered on this window and raise and lower with it's parent. By default, the dialog is not parented to a particular window and is simply centered on the screen.
-backgroundColor(-bgc) float float float create
The background color of the dialog. The arguments correspond to the red, green, and blue color components. Each component ranges in value from 0.0 to 1.0. (Windows only flag)

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

// Create an empty single button dialog.
//
// +-+----------------+
// |-| Confirm Dialog |
// +------------------+
// |                  |
// +------------------+
// | +--------------+ |
// | |   Confirm    | |
// | +--------------+ |
// +------------------+
//
confirmDialog;

// Create a basic Yes/No dialog.
//
// +-+----------------+
// |-|    Confirm     |
// +------------------+
// |  Are you sure?   |
// +------------------+
// | +-----+  +-----+ |
// | | Yes |  | No  | |
// | +-----+  +-----+ |
// +------------------+
//
confirmDialog -title "Confirm" -message "Are you sure?"
    -button "Yes" -button "No" -defaultButton "Yes"
    -cancelButton "No" -dismissString "No";