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

Synopsis

layoutDialog [-backgroundColor float float float] [-dismiss string] [-parent string] [-title string] [-uiScript script]

layoutDialog is undoable, NOT queryable, and NOT editable.

The layoutDialog command creates a modal dialog containing a formLayout with 100 divisions. The formLayout can be populated with arbitrary UI elements through use of the '-ui/-uiScript' flag.

NOTE:
A layoutDialog is not a window and certain UI elements will not function properly within it. In particular menuBars and panels containing menuBars should not be used with the layoutDialog.

Return value

stringThe string specified by the -dismiss flag, or "dismiss" if the dialog was closed.

Flags

backgroundColor, dismiss, parent, title, uiScript
Long name (short name) Argument types Properties
-title(-t) string create
The dialog title.
-dismiss(-dis) string create
Dismiss the current layoutDialog. The specified string will be set as the result of the initial layoutDialog command.
-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)
-uiScript(-ui) script create
The specified MEL procedure name will be invoked to build the UI of the layoutDialog. This flag is required when creating a layoutDialog. The top-level control of a layoutDialog is a formLayout with 100 divisions. It can be accessed by calling 'setParent -q' at the beginning of the specified MEL procedure.

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

global proc checkboxPrompt()
{
    // Get the dialog's formLayout.
    //
    string $form = `setParent -q`;
    // layoutDialog's are not resizable, so hard code a size here,
    // to make sure all UI elements are visible.
    //
    formLayout -e -width 300 $form;
    string $t = `text -l "What do you want to do?"`;
    string $b1 = `button -l "Abort"    -c "layoutDialog -dismiss \"Abort\""`;
    string $b2 = `button -l "Skip"     -c "layoutDialog -dismiss \"Skip\""`;
    string $b3 = `button -l "Continue" -c "layoutDialog -dismiss \"Continue\""`;
    string $cb1 = `checkBox -label "Remember my choice"`;
    int $spacer = 5;
    int $top = 5;
    int $edge = 5;
    formLayout -edit
        -attachForm            $t   "top"    $top
        -attachForm            $t   "left"   $edge
        -attachNone            $t   "bottom"
        -attachForm            $t   "right"  $edge
        -attachControl         $b1  "top"    $spacer $t
        -attachForm            $b1  "left"   $edge
        -attachNone            $b1  "bottom"
        -attachPosition        $b1  "right"  $spacer 33
        -attachControl         $b2  "top"    $spacer $t
        -attachPosition        $b2  "left"   $spacer 33
        -attachNone            $b2  "bottom"
        -attachPosition        $b2  "right"  $spacer 66
        -attachControl         $b3  "top"    $spacer $t
        -attachPosition        $b3  "left"   $spacer 66
        -attachNone            $b3  "bottom"
        -attachForm            $b3  "right"  $edge
        -attachControl         $cb1 "top"    $spacer $b1
        -attachForm            $cb1 "left"   $edge
        -attachForm            $cb1 "bottom" $spacer
        -attachNone            $cb1 "right"
    $form;
}
layoutDialog -ui "checkboxPrompt";