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

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

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