MenuButton (クラス)
public MenuButton {inherits MultiUIControlFrame}
インポート元: CURL.GUI.STANDARD. package 内で定義されています CURL.GUI.CONTROL-LOGICAL.

これに関連づけられたメニューを保持しているコントロールです。

注意事項

通常、メニューにおける基本的な push-button コントロールの実装に使用されます。
このオブジェクトは、 "MenuButton"、"MenuButton/button-box"、"MenuButton/drop-button"のスタイル ルールを記述することによってスタイル化することが出来ます。詳細は スキンが適用されたメニューボタン をご覧下さい。

このコントロールの典型的な使用例です。
{import * from CURL.GUI.CONTROL-HELPERS}
{value
    {MenuButton
        takes-focus? = false,
        {CommandButton
            label = 
                {spaced-hbox
                    valign = "center",
                    {TriangleControlPart
                        TriangleDirection.left, 12pt
                    }, 
                    "Back"
                },
            takes-focus? = false,
            style = CommandButtonStyle.rollover,
            {on Action do
                {popup-message "Go to the last page"}
            }
        },
        {MenuAction
            label = "Page 1",
            {on Action do {popup-message "Go to Page 1"}}
        },
        {MenuAction
            label = "Page 2",
            {on Action do {popup-message "Go to Page 2"}}
        },
        {MenuAction
            label = "Page 3",
            {on Action do {popup-message "Go to Page 3"}}
        }
    }
}

{value
    let tf:TextField = {TextField}
    {MenuButton
        takes-focus? = false,
        tf,
        {MenuAction
            label = "To Upper",
            key-accel-string = "Ctrl+U",
            {on Action do
                {if-non-null str = tf.value then
                    set tf.value = {str.to-upper-clone}
                }
            }
        },
        {MenuAction
            label = "To Lower",
            key-accel-string = "Ctrl+L",
            {on Action do
                {if-non-null str = tf.value then
                    set tf.value = {str.to-lower-clone}
                }
            }
        }
    }
}

ビジュアル テスト

このクラスは、CurlMenuButton ビジュアル テスト タイプを実装します。
すべての Visual によってサポートされる既定のビジュアル テスト アクションの他に、このクラスのオブジェクトは次のアクションをサポートします。
アクション 引数 説明
Select path:Stringこのメニューボタンからのパスを使用して、メニュー アクションを選択し、アクティブにします。たとえば、「colors;green」を使用すれば、このメニューの「colors」のボタンで「green」の項目を選択できます。
すべての Visual によってサポートされる既定のビジュアル テスト プロパティの他に、このクラスのオブジェクトは次のビジュアル テスト プロパティをサポートします。
プロパティ 説明
other items count:int選択対象のこのメニュー ボタンのアイテムの数。サブメニュー アイテムの数を取得するには、そのサブメニューを開いて、その menu items count プロパティの値を取得します。
menu items count:int 選択対象のこのメニュー ボタンの他のアイテム数。
導入: バージョン 6.0

コンストラクタ
default:MenuButton オブジェクトを作成します。
コンストラクタ public {MenuButton.default ui-object:#MenuButtonUI = null, ...}
from-proc:MenuButton オブジェクトを作成します。
コンストラクタ public {MenuButton.from-proc
menu-proc:{proc-type {}:{Array-of Graphic}},
ui-object:#MenuButtonUI = null,
...
}

プロパティ
menu-element-count:MenuButton.menu-elements にリストされたアイテムの数を返します。
アクセサ public MenuButton.menu-element-count:int
menu-elements:MenuButton のメニューの要素に関するイテレータを返します。
アクセサ public MenuButton.menu-elements:{Iterator-of Graphic}
menu-label:MenuButton のメニューに使用されるラベルです。
ローカル オプション public MenuButton.menu-label:#Label =null
menu-proc:動的にメニューのコンテンツを作成するプロシージャです。
フィールド public constant MenuButton.menu-proc:#{proc-type {}:{Array-of Graphic}}
other-element-count:MenuButton.other-elements にリストされたアイテムの数を返します。
アクセサ public MenuButton.other-element-count:int
other-elements:MenuButton.menu-elements のリストにない MenuButton の子のイテレータを返します。
アクセサ public MenuButton.other-elements:{Iterator-of Graphic}
rollover?:ポインタがロール オーバーした時に、MenuButton は視覚的な印を表示します。
ローカル オプション public MenuButton.rollover?:bool =true
show-focus?:MenuButton がキー フォーカスを視覚的に表示するかどうかを示します。
ローカル オプション public MenuButton.show-focus?:bool =true
style-element:スタイリングの目的のための、この Visual の "要素" や "型" です。
アクセサ public MenuButton.style-element:String
test-type-name:このオブジェクトをテストのメソッドとプロパティにマッピングするために、ビジュアル テスト インフラストラクチャが使用するタイプ名。
アクセサ public MenuButton.test-type-name:#String
プロパティ 継承 MultiUIControlFrame: _ui-object, _ui-set-locally?, control-appearance-changeable?, display-context, focus-object, look-and-feel, options-present-here, ui-object
プロパティ 継承 ControlFrame: color, control-color, control-content-background, enabled?, font-family, font-size, font-style, font-weight, text-breakable?, text-line-through?, text-preserve-whitespace?, text-underline?, visible?
プロパティ 継承 BaseFrame: child, clonable-class?, completely-clonable-children?, graphical-children, halign-spec, hstretch?-spec, ordered-children, reverse-ordered-children, valign-spec, vstretch?-spec, width-first?
プロパティ 継承 CommandBinding: bound-command, bound-command-impl
プロパティ 継承 Control: control-container, dialog, focus-skin, form, has-value?, skin
プロパティ 継承 GetBoundsBox: layout-locally-valid?, layout-valid?
プロパティ 継承 ActiveTraversor: _active-traversal-container, active-traversal-container, mnemonic, tab-index, takes-focus?, valid?, validation-result
プロパティ 継承 EventTarget: event-handlers
プロパティ 継承 Box: clip-child-shadows?
プロパティ 継承 Visual: _style-element, cursor, data-source, dragee, graphical-parent, has-key-focus?, input-method-enabled?, input-method-keyboard-mode, name, options, style-class, style-manager, style-options, test-child?, test-description, test-name, test-parent?, test-visible?, tooltip, user-data
プロパティ 継承 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, possibly-displayed?, selection-context, shadow-color, shadow-spec, visual-parent, vorigin, width
プロパティ 継承 DataBindingTarget: data-binding-context, data-bindings
プロパティ 継承 OptionListInterface: option-register-proc, registered-option-keys

メソッド
add:MenuButton に、設定されたアイテムを追加します。
public {MenuButton.add g:any, ...}:#Visual
add-at-index:設定されたアイテムを、設定されたインデックスの MenuButton に挿入します。
protected {MenuButton.add-at-index g:#Graphic, where:any}:void
clear:MenuButton から全てのアイテムを削除します。
public {MenuButton.clear}:void
create-default-ui-object:このオブジェクトに適切な UI オブジェクトを作成します。
protected {MenuButton.create-default-ui-object}:ControlUI
get-menu-element-at-index:MenuButton.menu-elements リストから設定されたインデックスのGraphic を返します。
public {MenuButton.get-menu-element-at-index index:int}:Graphic
get-other-element-at-index:MenuButton.other-elementsリストから設定されたインデックスのGraphic を返します。
public {MenuButton.get-other-element-at-index index:int}:Graphic
get-test-property:このオブジェクトのテスト プロパティ値を返します。
public {MenuButton.get-test-property name:String}:any
note-items-cleared:MenuButton からアイテムを削除するために MenuButton.clear が呼び出される時に、MenuButton によって呼び出されるメソッドです。
protected {MenuButton.note-items-cleared}:void
note-menu-item-added:MenuItemMenuSeparator が追加される時に、MenuButtonによって呼び出されるメソッドです。
protected {MenuButton.note-menu-item-added index:int}:void
note-menu-item-removed:MenuItemMenuSeparator が削除される時に、MenuButton によって呼び出されるメソッドです。
protected {MenuButton.note-menu-item-removed index:int}:void
note-other-item-added:MenuItemMenuSeparator でない Graphic が追加される時に、MenuButton によって呼び出されるメソッドです。
protected {MenuButton.note-other-item-added index:int}:void
note-other-item-removed:MenuItemMenuSeparator でない Graphic が削除される時に、MenuButtonによって呼び出されるメソッドです。
protected {MenuButton.note-other-item-removed index:int}:void
remove:MenuButton から設定されたアイテムを削除します。
public {MenuButton.remove
g:Graphic,
error-if-missing?:bool = true
}:void
synchronize-menu-elements:MenuButton.menu-proc によって返されるリストからメニューの要素の同期をとるよう、ユーザー インターフェイス オブジェクトに通知します。
public {MenuButton.synchronize-menu-elements}:void
test-run:オブジェクトに対してビジュアル テスト アクションを実行します。
public {MenuButton.test-run action:String, args:FastArray}:any
メソッド 継承 MultiUIControlFrame: generate-ui-object, handle-look-and-feel-change, handle-observer-message, on-focus-in, option-changed, option-lookup-here, option-propagate-notify, react-to-state-change, react-to-visual-change, request-key-focus, set-layout
メソッド 継承 ControlFrame: become-active
メソッド 継承 BaseFrame: add-internal, after-reposition, allocate-layout-object, attempt-revalidate-layout, before-reposition, clone-appearance-helper, compute-child-bounds, compute-parent-elastic, constrain-height, constrain-width, draw, end-pagination, get-height-preference, get-text, get-width-preference, install-child-bounds, internal-remove-child, note-attached, note-detaching, notify-option-children, paginate, pick-child, propagate-request-layout, register-options, set-size
メソッド 継承 BasicBox: contains-point?, find-graphic-at, handle-crossing, on-pointer-envelope-event, pointer-enter-occurred, pointer-leave-occurred
メソッド 継承 Control: on-pointer-press
メソッド 継承 StandardActiveTraversor: become-active-from-traversal, fire-event-at-container, handle-mnemonic, on-key-press
メソッド 継承 Observer: observe, stop-observing
メソッド 継承 GuiEventTarget: handle-delegate-event, 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-out, on-gesture, on-gesture-begin, on-gesture-end, on-gesture-magnify, on-gesture-pan, on-gesture-rotate, on-gesture-swipe, on-gesture-tap, on-gesture-touch, on-grab-release, on-gui-event, on-input-method-event, on-key-event, on-pointer-button, on-pointer-crossing, on-pointer-event, on-pointer-motion, 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
メソッド 継承 GetBoundsBox: get-bounds, get-elastic-bounds-into, get-nonparent-bounds-into, request-layout, validate-layout
メソッド 継承 ActiveTraversor: mark-invalid, mark-valid
メソッド 継承 EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
メソッド 継承 Box: compare-children, find-test-children, get-delimited-child-text-selection, get-gui-path-to-child, get-range-as-selected-text, get-visible-rect-in-root-into, graphical-child-visible-at, make-gui-mark, search-next-here, search-prev-here
メソッド 継承 Visual: add-from-init-args, animate, change-cursor, clonable-appearance?, clone-appearance, get-focus-manager, get-layout-context, get-test-parent, 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, refresh-style-options, release-key-focus, scroll-to-include, test-record, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-to-display-coordinates, transform-to-graphical-root-coordinates
メソッド 継承 BasicEventTarget: enqueue-event
メソッド 継承 Graphic: create-pagination-state, detach, draw-range-as-selected, draw-shadow, find-ancestor, find-graphical-ancestor, fire-inferior-crossing-event, get-graphical-root, get-gui-path, 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, request-draw-rect, request-pointer-trace, search-next, search-prev, start-pagination, xy-offset-to
メソッド 継承 GraphicOptions: any-to-Distance, get-display-context
メソッド 継承 DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, unset-property, update-data-binding, validate-data-binding
メソッド 継承 OptionListInterface: add-option, add-style-option, 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-set?, propagate-option-change, remove-option, remove-style-option, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
メソッド 継承 InitRestArgParser: process-rest-args
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize



コンストラクタ詳細
default (コンストラクタ)
public {MenuButton.default ui-object:#MenuButtonUI = null, ...}

MenuButton オブジェクトを作成します。

ui-object: 描画とイベントを処理する UI デリゲート。
...: イベント ハンドラとオプションが設定された Graphic です。
導入: バージョン 6.0


from-proc (コンストラクタ)
public {MenuButton.from-proc
menu-proc:{proc-type {}:{Array-of Graphic}},
ui-object:#MenuButtonUI = null,
...
}

MenuButton オブジェクトを作成します。

menu-proc: 動的にメニューのコンテンツを作成するプロシージャです。
ui-object: 描画とイベントを処理する UI デリゲート。
...: イベント ハンドラとオプションが設定された Graphic です。
導入: バージョン 6.0



プロパティ詳細
menu-element-count (アクセサ)
アクセサ public MenuButton.menu-element-count:int

MenuButton.menu-elements にリストされたアイテムの数を返します。

注意事項

このオブジェクトを作成するのに MenuButton.from-proc が使用されると、0 を返します。
導入: バージョン 6.0


menu-elements (アクセサ)
アクセサ public MenuButton.menu-elements:{Iterator-of Graphic}

MenuButton のメニューの要素に関するイテレータを返します。

注意事項

このオブジェクトを作成するのに MenuButton.from-proc が使用されると、メニューの要素を取得するために MenuButton.menu-proc を呼び出す必要があります。これを呼び出すと空のイテレータが返されます。
導入: バージョン 6.0


menu-label (ローカル オプション)
public MenuButton.menu-label:#Label =null

MenuButton のメニューに使用されるラベルです。

注意事項

null の場合、MenuButtonUI のサブクラスで既定のラベルが提供されます。 Label も参照してください。
導入: バージョン 6.0


menu-proc (フィールド)
public constant MenuButton.menu-proc:#{proc-type {}:{Array-of Graphic}}

動的にメニューのコンテンツを作成するプロシージャです。

注意事項

MenuButton.from-proc がこのオブジェクトを作成するために使用される場合、これは non-null となります。
non-null の場合、これはメニュー要素のリストを返します。そうでない場合、MenuButton のメニュー要素リストを取得するために MenuButton.menu-elements を使用します。
このオブジェクトは、"MenuButton"、"MenuButton/button-box"、"MenuButton/drop-button"のスタイル ルールを記述することによってスタイル化することが出来ます。詳細は スキンが適用されたメニューボタン をご覧下さい。
導入: バージョン 6.0


other-element-count (アクセサ)
アクセサ public MenuButton.other-element-count:int

MenuButton.other-elements にリストされたアイテムの数を返します。

導入: バージョン 6.0


other-elements (アクセサ)
アクセサ public MenuButton.other-elements:{Iterator-of Graphic}

MenuButton.menu-elements のリストにない MenuButton の子のイテレータを返します。

導入: バージョン 6.0


rollover? (ローカル オプション)
public MenuButton.rollover?:bool =true

ポインタがロール オーバーした時に、MenuButton は視覚的な印を表示します。

導入: バージョン 6.0


show-focus? (ローカル オプション)
public MenuButton.show-focus?:bool =true

MenuButton がキー フォーカスを視覚的に表示するかどうかを示します。

導入: バージョン 6.0


style-element (アクセサ)
アクセサ public MenuButton.style-element:String

スタイリングの目的のための、この Visual の "要素" や "型" です。

説明

この実装によって Visual._style-elementの値が返されますが、通常は定数を返すためにオーバーライドされます。

オーバーライド

Visual のサブクラスのスタイルが他のオブジェクトと異なる場合、このゲッターは適切な文字列を返すようにオーバーライドされる必要があります。 慣例では,この文字列はクラス名または、オブジェクトを生成するマークアップの名前です。
オーバーライドでは、空の文字列でないかぎり、self._style-elementを返さなければなりません。
導入: バージョン 6.0


test-type-name (アクセサ)
アクセサ public MenuButton.test-type-name:#String

このオブジェクトをテストのメソッドとプロパティにマッピングするために、ビジュアル テスト インフラストラクチャが使用するタイプ名。

説明

ビジュアル テストを正しく実行するには、テストは次のいずれかのタイプでなければなりません。特定のテスト タイプの詳細については、リストされている実装例の test-run および get-test-property メソッドの説明を参照してください。
オブジェクトのセマンティクスに近い、いずれかの定義済みテスト タイプの使用を検討してください。ただし、テスト タイプを変更せずにオブジェクトにテストのアクションとプロパティを追加する方が簡単な場合もあります。





メソッド詳細
add (メソッド)
public {MenuButton.add g:any, ...}:#Visual

MenuButton に、設定されたアイテムを追加します。

g: 追加するアイテム。g がまだ Graphic でない場合、gGraphic に強制変換され、その結果が追加されます。

戻り値

追加された実際の値。追加された Graphic のサブタイプになります。

注意事項

gMenuItem または MenuSeparator の場合、MenuButton.menu-elements のリストに追加されます。そうでなければ、MenuButton.other-elements のリストに追加されます。
MenuButton.from-proc がこのオブジェクトを作成するのに使用された場合、gMenuItem または MenuSeparator であれば IllegalArgumentException がスローされます。
g が既に MenuButton に追加されている場合、まず削除されその後再び追加されます。
gMenuButton.menu-elementsMenuButton.other-elements のリストにそれぞれ挿入した後、このメソッドは MenuButton.note-menu-item-addedMenuButton.note-other-item-added を呼び出します。
MenuButtonUI のサブクラスは、ユーザー インターフェイス オブジェクトにこの新しく追加されたアイテムが追加されたことを確認することによって、この変化に反応しなければなりません。


add-at-index (メソッド)
protected {MenuButton.add-at-index g:#Graphic, where:any}:void

設定されたアイテムを、設定されたインデックスの MenuButton に挿入します。

g:
追加するアイテムです。g がまだ Graphic でない場合、g を強制的に Graphic にして追加します。
gMenuItemMenuSeparator の場合、MenuButton.menu-elements のリストに追加されます。そうでなければ、MenuButton.other-elements のリストに追加されます。
where:
gMenuItemMenuSeparator の場合、whereg が挿入される MenuButton.menu-elements リスト内の場所になります。そうでなければ、whereg が挿入される MenuButton.other-elements リスト内の場所になります。
有効な場所の値は、次の通りです。: "default"、 "last"、 "first"、または g が挿入されるリストのサイズ以下の整数値。 それ以外の場合は、エラーがスローされます。
"default" または "last" の場合は、g はリストの最後に追加されます。"first" の場合、g がリストの最初の位置に挿入されます。

注意事項

gMenuItemMenuSeparator の場合、MenuButton.menu-elements のリストに追加されます。そうでなければ、MenuButton.other-elements のリストに追加されます。
MenuButton.from-proc がこのオブジェクトを作成するのに使用された場合、gMenuItemMenuSeparator であれば、IllegalArgumentException がスローされます。
gMenuButton.menu-elementsMenuButton.other-elements のリストにそれぞれ挿入した後、このメソッドは MenuButton.note-menu-item-addedMenuButton.note-other-item-added を呼び出します。
MenuButtonUI のサブクラスは、ユーザー インターフェイス オブジェクトにこの新しく追加されたアイテムが追加されたことを確認することによって、この変化に反応しなければなりません。
導入: バージョン 6.0


clear (メソッド)
public {MenuButton.clear}:void

MenuButton から全てのアイテムを削除します。

注意事項

MenuButton.menu-elementsMenuButton.other-elements のリストが空でない場合、MenuButton.note-items-cleared を呼び出します。
MenuButton.from-proc がこのオブジェクトを作成するのに使用された場合、MenuButton.other-elements のリストだけをクリアします。
MenuButtonUI のサブクラスは、ユーザー インターフェイス オブジェクトがどんなアイテムも表示していないことを確認することによって、この変化に反応しなければなりません。


create-default-ui-object (メソッド)
protected {MenuButton.create-default-ui-object}:ControlUI

このオブジェクトに適切な UI オブジェクトを作成します。

説明

このメソッドは、現在の LookAndFeel がこのコントロールの UI オブジェクトを指定しない場合にのみ使用されます。


get-menu-element-at-index (メソッド)
public {MenuButton.get-menu-element-at-index index:int}:Graphic

MenuButton.menu-elements リストから設定されたインデックスのGraphic を返します。

index:
MenuButton.menu-elements リストの Graphic のインデックスです。
マイナスの値や、MenuButton.menu-element-count より大きな値を index に渡すのは不正です。
導入: バージョン 6.0


get-other-element-at-index (メソッド)
public {MenuButton.get-other-element-at-index index:int}:Graphic

MenuButton.other-elementsリストから設定されたインデックスのGraphic を返します。

index:
MenuButton.other-elements リストの Graphic のインデックスです。
マイナスの値や、MenuButton.menu-element-count より大きな値を index に渡すのは不正です。
導入: バージョン 6.0


get-test-property (メソッド)
public {MenuButton.get-test-property name:String}:any

このオブジェクトのテスト プロパティ値を返します。

説明

既定の実装では、リフレクションを使用してオブジェクトの実行時プロパティの値を取得します。プロパティを実行時のインターフェイスではなくテスト環境に追加する場合は、サブクラスでこのメソッドをオーバーライドする必要があります。

注意事項

参照:canonical-test-value


note-items-cleared (メソッド)
protected {MenuButton.note-items-cleared}:void

MenuButton からアイテムを削除するために MenuButton.clear が呼び出される時に、MenuButton によって呼び出されるメソッドです。

注意事項

このオブジェクトに関連する MenuButtonUI が存在する場合、MenuButtonUI.note-items-cleared を呼び出します。
導入: バージョン 6.0


note-menu-item-added (メソッド)
protected {MenuButton.note-menu-item-added index:int}:void

MenuItemMenuSeparator が追加される時に、MenuButtonによって呼び出されるメソッドです。

index: MenuItemMenuSeparator が追加されたインデックスです。

注意事項

このオブジェクトに関連する MenuButtonUI が存在する場合、MenuButtonUI.note-menu-item-added を呼び出します。
このオブジェクトを作成するのに MenuButton.from-proc が使用された場合、メニュー アイテムを MenuButton に追加するために MenuButton.addMenuButton.add-at-index メソッドを呼び出すことは不正です。そのために、このメソッドは呼び出されることはありません。
導入: バージョン 6.0


note-menu-item-removed (メソッド)
protected {MenuButton.note-menu-item-removed index:int}:void

MenuItemMenuSeparator が削除される時に、MenuButton によって呼び出されるメソッドです。

index: MenuItemMenuSeparator が削除されたインデックスです。

注意事項

このオブジェクトに関連する MenuButtonUI が存在する場合、MenuButtonUI.note-menu-item-removed を呼び出します。
このオブジェクトを作成するのに MenuButton.from-proc が使用された場合、メニュー アイテムを MenuButton から削除するために MenuButton.remove メソッドを呼び出すことは不正です。そのために、このメソッドは呼び出されることはありません。
導入: バージョン 6.0


note-other-item-added (メソッド)
protected {MenuButton.note-other-item-added index:int}:void

MenuItemMenuSeparator でない Graphic が追加される時に、MenuButton によって呼び出されるメソッドです。

index: Graphic が追加されたインデックスです。

注意事項

このオブジェクトに関連する MenuButtonUI が存在する場合、MenuButtonUI.note-other-item-added を呼び出します。
導入: バージョン 6.0


note-other-item-removed (メソッド)
protected {MenuButton.note-other-item-removed index:int}:void

MenuItemMenuSeparator でない Graphic が削除される時に、MenuButtonによって呼び出されるメソッドです。

index: Graphic が削除されたインデックスです。

注意事項

このオブジェクトに関連する MenuButtonUI が存在する場合、MenuButtonUI.note-other-item-added を呼び出します。
導入: バージョン 6.0


remove (メソッド)
public {MenuButton.remove
g:Graphic,
error-if-missing?:bool = true
}:void

MenuButton から設定されたアイテムを削除します。

g: 削除する Graphic
error-if-missing?: 存在しない要素を削除しようとするときにこのメソッドが KeyNotFoundException をスローするかどうかを示します。既定値は true です。

注意事項

gMenuItemMenuSeparator の場合、MenuButton.menu-elements のリストから削除されます。そうでなければ、MenuButton.other-elements のリストから削除されます。
MenuButton.from-proc がこのオブジェクトを作成するのに使用された場合、gMenuItemMenuSeparator であれば、IllegalArgumentException がスローされます。
gMenuButton.menu-elementsMenuButton.other-elements のリストからそれぞれ削除した後、このメソッドは MenuButton.note-menu-item-removedMenuButton.note-other-item-removed を呼び出します。
MenuButtonUI のサブクラスは、ユーザー インターフェイス オブジェクトにこの新しく追加されたアイテムが削除されたことを確認することによって、この変化に反応しなければなりません。
導入: バージョン 6.0


synchronize-menu-elements (メソッド)
public {MenuButton.synchronize-menu-elements}:void

MenuButton.menu-proc によって返されるリストからメニューの要素の同期をとるよう、ユーザー インターフェイス オブジェクトに通知します。

注意事項

MenuButton.from-proc がこのオブジェクトを作成するのに使用されなかった場合、これを呼び出しても何も起こりません。

説明

MenuButton.menu-procによって返されるアイテムが変更された場合、ユーザーインターフェースオブジェクトとメニューアイテムを同期させるためにこの機能を呼出してください。
導入: バージョン 6.0


test-run (メソッド)
public {MenuButton.test-run action:String, args:FastArray}:any

オブジェクトに対してビジュアル テスト アクションを実行します。

action: 実行するアクションの名前。
args: ビジュアル テスト アクションの引数。ビジュアル テスト インフラストラクチャは、引数の数と型をチェックしますが、値はチェックしません。実装では、すべての有効な値を処理し、不正な値に対しては例外またはエラーをスローするようにしてください。

説明

そのクラスによってサポートされたテスト動作のリストについてクラスのドキュメントを御読み下さい。
既定の実装では、RawClick などの一般的な操作を処理し、action が既知のアクションに一致しない場合にはリフレクションを使用してメソッドを呼び出します。

注意事項

QuickTest Property™ のビジュアル テスト環境では、任意の実行時メソッドを直接呼び出せません。代わりに CallMethod アクションを使用して、最初の引数としてメソッド名を渡してください。ビジュアル テスト インフラストラクチャは、CallMethod アクションを実際のアクションに変換してから test-run を呼び出します。

注意事項

参照:canonical-test-value

オーバーライド

新しいテスト アクションを追加するには、action と新しいアクションの名前を照合します。一致する場合は、引数を処理してアクションを実行し、適切なタイプの値 (戻り値がない場合は null) を返します。action が新しいテスト アクションに一致しない場合は、super.test-run を呼び出します。