移動先: 概要 戻り値 フラグ. MEL 例.

概要

panelHistory [-back] [-clear] [-defineTemplate string] [-exists] [-forward] [-historyDepth int] [-isEmpty] [-suspend boolean] [-targetPane string] [-useTemplate string] [-wrap boolean] [name]

panelHistory は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。

パネル ヒストリ オブジェクトが作成されます。特定 paneLayout のオブジェクトが対象となり、その paneLayout 内のビュー構成の変更でヒストリ リストが作成されます。リストでは、前後に移動できます。

戻り値

string作成された panelHistory の名前。

戻り値の型は照会モードでは照会フラグが基になります。

フラグ

back, clear, defineTemplate, exists, forward, historyDepth, isEmpty, suspend, targetPane, useTemplate, wrap
ロング ネーム(ショート ネーム) 引数型 プロパティ
-exists(-ex) create
指定したオブジェクトが存在するかどうかによって、 true または false を返します。他のフラグは無視されます。
-defineTemplate(-dt) string create
他の任意のフラグと引数を解析し、かつ引数で指定したコマンド テンプレートに 追加するモードに、コマンドのモードを変更します。 templateName がカレントのテンプレートとして設定されていれば、 その後コマンドが実行されるたびに、この引数がデフォルトの引数として使用されます。
-useTemplate(-ut) string create
コマンドに、カレント以外のコマンド テンプレートの使用を強制します。
-targetPane(-tp) string createquery
ヒストリを維持する paneLayout を指定します。
-back(-b) edit
ヒストリ リストで 1 レベル戻ります。
-forward(-f) edit
ヒストリ リストで 1 レベル進みます。
-clear(-cl) edit
ヒストリ スタックをクリアします。
-historyDepth(-hd) int queryedit
維持するヒストリのレベル数を指定します。
-suspend(-s) boolean edit
パネル ヒストリの更新を停止するか再開するかを指定します。 多数の変更を 1 つのヒストリ イベントにまとめる場合に便利です。
-wrap(-w) boolean queryedit
ヒストリを末尾と先頭で折り返すかどうかを指定します。この値はデフォルトで true になっています。
-isEmpty(-ie) query
パネル ヒストリが現在存在しない場合に true を返します。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : 1 つのコマンドで複数回使用可能なフラグ

MEL 例

//    Create a window containing a pane layout.  The window also contains
//    an option menu for changing the layout configuration and two buttons
//    for stepping through the configuration history.
//
string $window = `window -title "panelHistory Example"`;
string $form = `formLayout`;

//    Create the option menu for panel configuration.
//
string $configuration = `optionMenuGrp -label "Configuration"
    -columnWidth2 100 150`;
    string $single, $stacked, $sideBySide, $four;
    $single     = `menuItem -label "Single"`;
    $stacked    = `menuItem -label "2 Stacked"`;
    $sideBySide = `menuItem -label "2 Side by Side"`;
    $four       = `menuItem -label "Four"`;

//    Create the buttons for stepping through configuration history.
//
string $history = `rowLayout -numberOfColumns 3
    -columnWidth3 100 75 75
    -columnAttach 2 "both" 0 -columnAttach 3 "both" 0`;
    text -label "History";
    string $backBtn = `button -label "Back"`;
    string $forwardBtn = `button -label "Forward"`;
    setParent ..;

//    Create the pane layout.
//
string $frame = `frameLayout -labelVisible false`;
string $panes = `paneLayout`;
    text -label "Pane 1";
    text -label "Pane 2";
    text -label "Pane 3";
    text -label "Pane 4";

//    Set up the attachments.
//
formLayout -edit
    -attachForm    $configuration "top"    5
    -attachForm    $configuration "left"   5
    -attachControl $history       "top"    5 $configuration
    -attachForm    $history       "left"   5
    -attachForm    $history       "right"  5
    -attachControl $frame         "top"    5 $history
    -attachForm    $frame         "left"   5
    -attachForm    $frame         "right"  5
    -attachForm    $frame         "bottom" 5
    $form;

//    Create the panel history object.
//
string $panelHistory = `panelHistory -targetPane $panes`;

//    Attach a command to the option menu to change the panel layout
//    configuration accordingly.
//
optionMenuGrp -edit
    -changeCommand ("ExampleUpdatePaneLayout " + $configuration + " " + $panes)
    $configuration;

//    Attach commands to the buttons for stepping through the configuration
//    history.  The commands should also update the value of the option menu.
//
button -edit
    -command ("panelHistory -edit -back $panelHistory; "
        + "ExampleUpdateConfiguration " + $configuration + " " + $panes)
    $backBtn;
button -edit
    -command ("panelHistory -edit -forward $panelHistory; "
        + "ExampleUpdateConfiguration " + $configuration + " " + $panes)
    $forwardBtn;

showWindow $window;

//    Call this procedure whenever the option menu's configuration value
//    changes.  This procedure will update the configuration of the
//    pane layout to reflect the change.
//
proc ExampleUpdatePaneLayout(string $optionMenuGrp, string $paneLayout)
{
    if ("" == $optionMenuGrp || "" == $paneLayout) return;

    string $value = `optionMenuGrp -query -value $optionMenuGrp`;
    if ("Single" == $value) {
        paneLayout -edit -configuration "single" $paneLayout;
    } else if ("2 Stacked" == $value) {
        paneLayout -edit -configuration "horizontal2" $paneLayout;
    } else if ("2 Side by Side" == $value) {
        paneLayout -edit -configuration "vertical2" $paneLayout;
    } else if ("Four" == $value) {
        paneLayout -edit -configuration "quad" $paneLayout;
    }
}

//    Call this procedure whenever the panel configuration changes due to
//    stepping through the panel history (ie. pressing either the "Forward"
//    or "Back" buttons.  This procedure will update the value of the
//    option menu to reflect the new pane layout configuration.
//
proc ExampleUpdateConfiguration(string $optionMenuGrp, string $paneLayout)
{
    if ("" == $optionMenuGrp || "" == $paneLayout) return;

    string $configuration = `paneLayout -query -configuration $paneLayout`;
    if ("single" == $configuration) {
        optionMenuGrp -edit -value "Single" $optionMenuGrp;
    } else if ("horizontal2" == $configuration) {
        optionMenuGrp -edit -value "2 Stacked" $optionMenuGrp;
    } else if ("vertical2" == $configuration) {
        optionMenuGrp -edit -value "2 Side by Side" $optionMenuGrp;
    } else if ("quad" == $configuration) {
        optionMenuGrp -edit -value "Four" $optionMenuGrp;
    }
}