(クラス)
public abstract sealed MenuItem
{inherits
HBox}
メニュー内のアイテムの基本的なインターフェイスです。
説明
| anchor-rect: | この Menu オブジェクトからポップアップされるメニュー ペインを置き換えるのに使用される四角形を返します。 |
アクセサ public MenuItem.anchor-rect:
GRect
フィールド public-get private-set MenuItem.cascade-marker-frame:
Frame
非ローカル オプション public MenuItem.enabled?:
bool
| icon: | MenuItem アイコンを取得または設定します。 |
フィールド public-get private-set MenuItem.icon-frame:#
Frame
フィールド public-get protected-set MenuItem.item-active?:
bool =false
ローカル オプション public MenuItem.label:
Label ={Label null}
アクセサ public MenuItem.menu-context:#
Visual プロパティ 継承 Graphic:
avoid-page-break?, background, border-color, border-spec, border-style, border-width, cell-border-spec, cell-border-width, cell-margin, discrete-select-in-range?, graphic-selectable, height, horigin, is-paginating?, layout, margin, opaque-to-events?, option-parent, outside-margin, pagination-state, parent, selection-context, shadow-color, shadow-spec, visible?, vorigin, width プロパティ 継承 Visual:
_style-element, cursor, data-source, dragee, font-size, input-method-enabled?, input-method-keyboard-mode, name, options, options-present-here, style-class, style-manager, style-options, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data
| add-option: | オプション リストにオプションを追加するか、あるいは既存のオプションの値を変更します。変更は、value がオプションの現在値と異なる場合にのみ行われます。 |
| public | {MenuItem.become-active-item}:void |
| public | {MenuItem.highlight}:void |
| public abstract | {MenuItem.take-action}:void |
| public | {MenuItem.unhighlight}:void |
| public | {MenuItem.unselect-item}:void |
メソッド 継承 SequenceBox:
add-at-index, add-at-index-with-layout, after-reposition, before-reposition, clear, compare-children, draw, end-pagination, find, graphical-child-visible-at, internal-remove-child, note-attached, note-detaching, notify-option-children, pick-child, register-options, request-draw, request-pointer-trace, swap-children, validate-layout-sequence-numbers メソッド 継承 Graphic:
create-pagination-state, detach, draw-range-as-selected, draw-shadow, find-ancestor, find-graphical-ancestor, fire-inferior-crossing-event, get-graphical-root, get-origin-in-graphical-ancestor, get-origin-in-root, get-pagination-state, get-top-left-in-ancestor, get-visible-bounds-into, on-drag-enter, on-inspection, on-pointer-enter, paint-with-decorations, replace-with, request-draw-rect, search-next, search-prev, set-layout, start-pagination, xy-offset-to メソッド 継承 Visual:
add-from-init-args, add-style-option, animate, change-cursor, clonable-appearance?, clone-appearance, get-focus-manager, get-layout-context, get-test-parent, get-test-property, get-text, get-view, maybe-fire-attach-event, maybe-fire-detach-event, non-keyword-init-arg, note-caret-position, on-drag-leave, on-pointer-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, release-key-focus, remove-style-option, request-key-focus, scroll-to-include, test-record, test-run, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-to-display-coordinates, transform-to-graphical-root-coordinates メソッド 継承 GuiEventTarget:
handle-event, on-action, on-cancel-mode, on-command-changed, on-commit, on-composition-change-event, on-composition-result-event, on-context-menu-event, on-current-record-change-request, on-current-record-changed, on-destroy-notify, on-destroy-requested, on-drag-over, on-drag-pointer, on-drag-started, on-drop, on-end-composition-event, on-focus-event, on-focus-in, on-focus-out, on-gui-event, on-input-method-event, on-key-event, on-key-press, on-pointer-button, on-pointer-crossing, on-pointer-motion, on-pointer-press, on-pointer-release, on-pointer-scroll, on-raw-key-event, on-raw-key-press, on-raw-key-release, on-reset, on-selectable-added, on-selectable-removed, on-selection-changed, on-selection-context-activated, on-selection-context-deactivated, on-selection-event, on-start-composition-event, on-start-event, on-stop-event, on-view-activate, on-view-deactivate, on-window-close, remove-event-handlers-for-event-class メソッド 継承 OptionListInterface:
change-option-parent-notify, clone-options, get-option, get-option-by-name, keyword-init-arg, local-add-notify, local-remove-notify, name-to-option-key, new-option-item, option-change-notify, option-lookup, option-lookup-here, option-propagate-notify, option-set?, propagate-option-change, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
(アクセサ)
アクセサ public MenuItem.anchor-rect:
GRect この Menu オブジェクトからポップアップされるメニュー ペインを置き換えるのに使用される四角形を返します。
導入:
バージョン 6.0
(フィールド)
public-get private-set MenuItem.cascade-marker-frame:
Frame MenuItem カスケード マーカーがあれば、そのコンテナです。
注意事項
導入:
バージョン 6.0
(非ローカル オプション)
このオプションで、コントロールのボタン部分の主な色を設定します。
例
| 例:
control-color の指定 |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true,
control-color="red",
{MenuAction label="Menu item..."},
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{Scrollbar width=.8in, direction=Orientation.horizontal},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(非ローカル オプション)
public MenuItem.enabled?:
bool Visual が有効であるかどうかを指定します。
説明
このオプションが false の場合、オブジェクトやGUI オブジェクトとのユーザー インタラクションは無効になります。
このオプションを
true に設定する代わりに、オプションを
unset する方が一般的です。これにより、一部の親コンテナの値は、有効な値を判別します。
- このオプションが false の場合、オプションに応じて、テキストは disabled-color および disabled-text-sunken? で表示されます。
例
| 例 |
 |
{paragraph I am enabled}
{paragraph enabled? = false, I'm not}
| |
このオプションが false で、
Visual がコントロールの場合、コントロールのユーザー インターフェイスは無効になります。前述したように、ラベル上の任意のテキストは、無効状態で表示されます。
例
| 例 |
 |
{radio-buttons
value = "first",
{RadioButton radio-value = "first"},
{RadioButton
radio-value = "second",
reactive-label = {ReactiveLabel
label-disabled = "(second)"
},
enabled? = false
},
{RadioButton radio-value = "third"}
}
| |
(アクセサ)
MenuItem アイコンを取得または設定します。
注意事項
icon が null の場合は、この MenuItem から前のメニュー アイコンが削除されます。そうでない場合は、新しいメニュー アイコンが設定され、古いメニュー アイコンがあれば、それと置き換わります。
(フィールド)
public-get private-set MenuItem.icon-frame:#
Frame MenuItem アイコンがあれば、そのコンテナです。
注意事項
これは、MenuItem がアイコンのスペースを予約している場合、非 null になります。
導入:
バージョン 6.0
(フィールド)
public-get protected-set MenuItem.item-active?:
bool =false
このアイテムがアクティブかハイライトになっているかどうかを示します。
導入:
バージョン 6.0
(ローカル オプション)
public MenuItem.label:
Label ={Label null}
(アクセサ)
(アクセサ)
アクセサ public MenuItem.menu-context:#
Visual この MenuItem(通常は MenuAction)がコンテキスト メニューに存在した場合、これはコンテキスト メニューが表示された時にマウス ポインタの下にある Visual を返します。
導入:
バージョン 6.0
(メソッド)
子アイテムを SequenceBox に追加します。
g: 追加するアイテム。
g がまだ
Graphic でない場合、
g は
Graphic に強制変換され、その結果が追加されます。
注意事項
SequenceBox.add はまた次の 3 つのパラメータを受け取ります。
- index=where では、SequenceBox の子のリストの where で示される位置に g がつなぎ合わせられることを示します。where が 0 の場合、g はリストの最初の子として追加されます。where が数字 n の場合、g は n 番目の子の後につなぎ合わされます。where の数字が SequenceBox の子の現在の数よりも大きい場合はエラーとなります。また、where には first または last の明確な意味を持つ文字列の 1 つを指定することもできます。
- before=sibling では、SequenceBox の子のリストの sibling の直前に g が 追加されることを示します。sibling は、SequenceBox の子 Graphic の 1 つか、Graphic の 1 つのレイアウト オブジェクトのいずれかになります。
- after=sibling では、SequenceBox の子オブジェクト リストの sibling の直後に g が 追加されることを示します。sibling は、SequenceBox の子 Graphic の 1 つか、Graphic の 1 つのレイアウト オブジェクトのいずれかになります。
戻り値
追加された実際の値。追加された
Graphic のサブタイプになります。
オーバーライド
子の追加にさらに別の処理を関連付けることができるように、
SequenceBox のサブクラスでオーバーライドできます。この種のオーバーライド メソッドは、以下を呼び出す必要があります。
{super.add g, ...}を呼び出して、
SequenceBox 自体の追加アクションを呼び出し、キーワード引数が指定されている場合はそのキーワード引数とともに渡します。
(メソッド)
オプション リストにオプションを追加するか、あるいは既存のオプションの値を変更します。変更は、value がオプションの現在値と異なる場合にのみ行われます。
value: オプションに関連付けられる値。
プログラミング注意事項
このメソッドは、Curl コンパイラが次のような式に対して生成するコードから呼び出されます。
set object.option-name = value
通常は、ユーザー コードにより直接呼び出されることはありません。
オーバーライド
オプションが追加または設定されるたびに追加操作を実行する必要があるサブクラスでは、これをオーバーライドすることができます。
(メソッド)
| public | {MenuItem.become-active-item}:void |
(メソッド)
| public | {MenuItem.highlight}:void |
(メソッド)
(メソッド)
PointerEvent のスタティック イベント ハンドラ。
オーバーライド
このメソッドは、
PointerEvent のスタティック ハンドラを提供するためにオーバーライドします。このメソッドをオーバーライドする標準的な方法は、以下のとおりです。
- 最初に、現在のオブジェクトの代わりに実行すべき演算を行います。
- 次に、{super.on-pointer-event e} を呼び出します。
(1) の演算でイベントが消費されると考えられる場合、イベントで
GuiEvent.consume を呼び出してこれを示します。ただし、この場合でも上記の 2 つの手順をその後で実行してください。消費されていないイベントに対してのみ実行されるスタティック イベント ハンドラは、
GuiEvent.consumed? をチェックして、イベントがすでに消費されているかどうかを調べることができます。
注意事項
すべてのスタティック イベント ハンドラ (
on-... 形式の名前を持つ
GuiEventTarget のメソッド) でこれと類似した動作が行われ、それらすべてにオーバーライドについての同じ注意事項が適用されます。
(メソッド)
バインディング オプションを削除します。
プログラミング注意事項
このメソッドは、Curl コンパイラが次のような式に対して生成するコードから呼び出されます。
{unset object.option-name}
通常は、ユーザー コードにより直接呼び出されることはありません。
オーバーライド
オプションが削除されるたびに追加操作の実行を必要とするサブクラスで、オーバーライドすることができます。
(メソッド)
| public abstract | {MenuItem.take-action}:void |
この MenuItem にあったアクションを実行します。
説明
これは、通常 enter キーが押されてメニュー アイテムがアクティブになると呼び出されます。
導入:
バージョン 6.0
(メソッド)
| public | {MenuItem.unhighlight}:void |
(メソッド)
| public | {MenuItem.unselect-item}:void |
この MenuItemの選択を解除します。
導入:
バージョン 6.0
(メソッド)
自身で再帰的にプロシージャを呼び出します。
f: 呼び出すプロシージャ。このプロシージャは、MenuItem を引数として受け取り、void を返す必要があります。
導入:
バージョン 6.0