ジャンプ先: 概要. 戻り値. フラグ. MEL 例.

概要

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

layoutDialog は、取り消し可能、照会不可能、および編集不可能です。

layoutDialog コマンドは、100 個のディビジョンがある formLayout を含むモーダル ダイアログを作成します。formLayout は、「-ui/-uiScript」フラグを使用して任意の UI 要素で埋めることができます。

注:
layoutDialog はウィンドウではないため、一部の UI 要素は内部で適切に機能しません。特に、menuBars と menuBars を含むパネルは layoutDialog と一緒に使用しないでください。

戻り値

string-dismiss フラグで指定した文字列、またはダイアログが閉じた場合は「dismiss」。

フラグ

backgroundColor, dismiss, parent, resizable, title, uiScript
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
-backgroundColor(-bgc) float float float create
ダイアログのバックグラウンド カラーです。引数は、赤、緑、青のカラー成分に対応しています。それぞれの成分の値は、0.0~1.0 です。(Windows のみのフラグです)。
-dismiss(-dis) string create
現在の layoutDialog を終了します。指定した文字列は、最初の layoutDialog コマンドの結果として設定されます。
-parent(-p) string create
ダイアログの親ウィンドウを指定します。ダイアログは親ウィンドウの中央に配置され、親ウィンドウの動きにつれて上下します。既定では、ダイアログは特定のウィンドウにはペアレント化されておらず、画面の中央に配置されます。
-resizable(-res)
2025
boolean create
ダイアログのサイズ変更が可能かどうかを示します。既定値は true です。
-title(-t) string create
ダイアログのタイトルです。
-uiScript(-ui) script create
layoutDialog の UI を構築するために、指定した MEL プロシージャ名を使用します。このフラグは、layoutDialog を作成するときに必要です。layoutDialog の最上位コントロールは、100 個のディビジョンがある formLayout です。formLayout には、指定した MEL プロシージャの先頭で「setParent -q」をコールすることによりアクセスできます。

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます コマンド内でフラグを複数回使用できます。

MEL 例

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";