移動先: 概要 戻り値 フラグ. 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
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: 1 つのコマンドで複数回使用可能なフラグ
|
// 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;
}
}