BaseButtonUI (クラス)
public abstract shared BaseButtonUI {inherits Frame, ControlUI}
インポート元: CURL.GUI.STANDARD. package 内で定義されています CURL.GUI.CONTROL-LOGICAL.
直接継承しているサブクラス: CommandButtonUI, RadioButtonUI, CheckButtonUI

共通する多数のイベント処理を 1 か所に統合するボタン UI クラスのスーパークラス。

説明

このクラスでは、ボタンの動作に関して多くの想定が行なわれています。ポインタ プレス、キー プレス、ポインタ グラブなどに関しては、ボタン UI クラスは同じように動作すると想定しています。新しい LookAndFeel によりこのような想定が無効になった場合、このクラスの変更が必要になります。たとえば、イベント ハンドラを ButtonUI 具象サブクラスに移動する必要が生じる可能性があります。

オーバーライド

具象サブクラスは、以下のメソッドをオーバーライドする必要があります。

具象サブクラスは、こうしたメソッドを必要に応じて特に以下のコンストラクタまたはオプション変更ハンドラから呼び出す必要があります。

コンストラクタ
default:新しい BaseButtonUI を作成します。
コンストラクタ public {BaseButtonUI.default ...}

プロパティ
action-char-key-pressed?:アクション文字 (ニーモニック、スペースバーなど) を表すキーが押されているかどうかを示す状態変数。
フィールド public BaseButtonUI.action-char-key-pressed?:bool =false
action-chars:入力されたときにボタンを "押した" ことにする文字。
フィールド public BaseButtonUI.action-chars:#{Set-of char}
button-pressed?:このボタンが押されているかどうかを示す状態変数。
フィールド public BaseButtonUI.button-pressed?:bool =false
enabled?:Visual が有効であるかどうかを指定します。
非ローカル オプション public BaseButtonUI.enabled?:bool
focus?:オブジェクトにキーボード フォーカスがあるかどうかを示す状態変数。
フィールド public BaseButtonUI.focus?:bool =false
grabbed?:このオブジェクト内でポインタ ボタンを押したままドラッグしたかどうかを示す状態変数。
フィールド public BaseButtonUI.grabbed?:bool =false
has-been-rendered?:画面にコントロールを描画する前に不要な描画を削除するために使用されます。
フィールド protected BaseButtonUI.has-been-rendered?:bool =false
pointer-pressed?:ボタンが押された状態のポインタがこのオブジェクトの上にあるかどうかを示す状態変数。
フィールド public BaseButtonUI.pointer-pressed?:bool =false
rollover?:ポインタがこのオブジェクトの上にあるかどうかを示す状態変数。
フィールド public BaseButtonUI.rollover?:bool =false
プロパティ 継承 Frame: clonable-class?, halign, halign-spec, hstretch?, hstretch?-spec, style-element, valign, valign-spec, vstretch?, vstretch?-spec
プロパティ 継承 ControlUI: color, control, control-appearance-changeable?, control-color, control-content-background, copy-options, focus-skin, font-family, font-style, font-weight, skin, text-breakable?, text-line-through?, text-preserve-whitespace?, text-underline?
プロパティ 継承 BaseFrame: child, completely-clonable-children?, graphical-children, ordered-children, reverse-ordered-children, width-first?
プロパティ 継承 DataBindingTarget: data-binding-context, data-bindings
プロパティ 継承 EventTarget: event-handlers
プロパティ 継承 GetBoundsBox: layout-locally-valid?, layout-valid?
プロパティ 継承 OptionListInterface: option-register-proc, options-present-here, registered-option-keys
プロパティ 継承 Box: clip-child-shadows?
プロパティ 継承 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?, display-context, 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, visible?, visual-parent, vorigin, width
プロパティ 継承 Visual: _style-element, cursor, data-source, dragee, font-size, 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-type-name, test-visible?, tooltip, user-data

メソッド
add-action-char:入力されたときにこのボタンを "押した" ことにする文字を登録します。
protected {BaseButtonUI.add-action-char key:char}:void
do-press-action:ボタンのアクションを実行します。
protected abstract {BaseButtonUI.do-press-action}:void
is-action-char?:この文字が入力されたときに、このボタンを "押したことにする" かどうかを示します。
protected {BaseButtonUI.is-action-char? key:char}:bool
modify-for-focus:ボタンがフォーカスを取得したときあるいは失ったときに視覚的にこれを変更します。
protected abstract {BaseButtonUI.modify-for-focus focus?:bool}:void
on-focus-in:"フォーカス" 状態に変化し、適宜に反応します。
public {BaseButtonUI.on-focus-in e:FocusIn}:void
on-focus-out:"標準" 状態に変化し、適宜に反応します。
public {BaseButtonUI.on-focus-out e:FocusOut}:void
on-grab-release:GrabRelease イベントを操作します。
public {BaseButtonUI.on-grab-release e:GrabRelease}:void
on-key-press:KeyPress イベントを操作します。
public {BaseButtonUI.on-key-press e:KeyPress}:void
on-pointer-enter:"ロールオーバー" 状態に変化し、適宜に反応します。
public {BaseButtonUI.on-pointer-enter e:PointerEnter}:void
on-pointer-leave:"標準" 状態に変化し、適宜に反応します。
public {BaseButtonUI.on-pointer-leave e:PointerLeave}:void
on-pointer-motion:押されたポインタがオブジェクトの外に移動したときを検出します。
public {BaseButtonUI.on-pointer-motion e:PointerMotion}:void
on-pointer-press:PointerPress イベントを操作します。
public {BaseButtonUI.on-pointer-press e:PointerPress}:void
on-pointer-release:PointerRelease イベントを操作します。
public {BaseButtonUI.on-pointer-release e:PointerRelease}:void
on-raw-key-release:キーがスペース バーの場合は、ボタンを標準の "押されてない" 状態に戻すことができます。
public {BaseButtonUI.on-raw-key-release e:RawKeyRelease}:void
remove-action-char:入力されたときにこのボタンを "押したことにする" 文字を登録解除します。
protected {BaseButtonUI.remove-action-char key:char}:void
set-size:このオブジェクトにレイアウト幅と高さを代入します。
public {BaseButtonUI.set-size lc:LayoutContext, bounds:GRect}:void
メソッド 継承 Frame: add, clone-appearance-helper, remove-child
メソッド 継承 ControlUI: fire-event-at-control, react-to-state-change, react-to-visual-change
メソッド 継承 BaseFrame: add-internal, after-reposition, allocate-layout-object, attempt-revalidate-layout, before-reposition, 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
メソッド 継承 GraphicOptions: any-to-Distance, get-display-context
メソッド 継承 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-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-gui-event, on-input-method-event, on-key-event, on-pointer-button, on-pointer-crossing, on-pointer-event, on-pointer-scroll, on-raw-key-event, on-raw-key-press, 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
メソッド 継承 BasicBox: contains-point?, find-graphic-at, handle-crossing, on-pointer-envelope-event, pointer-enter-occurred, pointer-leave-occurred
メソッド 継承 DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, unset-property, update-data-binding, validate-data-binding
メソッド 継承 EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
メソッド 継承 GetBoundsBox: get-bounds, get-elastic-bounds-into, get-nonparent-bounds-into, request-layout, validate-layout
メソッド 継承 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-lookup-here, option-propagate-notify, 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
メソッド 継承 BasicEventTarget: enqueue-event
メソッド 継承 Box: clear, 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
メソッド 継承 InitRestArgParser: process-rest-args
メソッド 継承 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, option-changed, paint-with-decorations, replace-with, request-draw, request-draw-rect, request-pointer-trace, search-next, search-prev, set-layout, start-pagination, xy-offset-to
メソッド 継承 Visual: add-from-init-args, animate, change-cursor, clonable-appearance?, clone-appearance, get-focus-manager, get-layout-context, get-test-parent, get-test-property, get-view, maybe-fire-attach-event, maybe-fire-detach-event, non-keyword-init-arg, note-caret-position, on-drag-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, refresh-style-options, release-key-focus, 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
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize



コンストラクタ詳細
default (コンストラクタ)
public {BaseButtonUI.default ...}

新しい BaseButtonUI を作成します。




プロパティ詳細
action-char-key-pressed? (フィールド)
public BaseButtonUI.action-char-key-pressed?:bool =false

アクション文字 (ニーモニック、スペースバーなど) を表すキーが押されているかどうかを示す状態変数。



action-chars (フィールド)
public BaseButtonUI.action-chars:#{Set-of char}

入力されたときにボタンを "押した" ことにする文字。



button-pressed? (フィールド)
public BaseButtonUI.button-pressed?:bool =false

このボタンが押されているかどうかを示す状態変数。



enabled? (非ローカル オプション)
public BaseButtonUI.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 がコントロールの場合、コントロールのユーザー インターフェイスは無効になります。前述したように、ラベル上の任意のテキストは、無効状態で表示されます。
    さらに、コントロールに ReactiveLabel があれば、ラベルは既定ラベルの代わりに ReactiveLabel.label-disabled のプロパティを表示します。


    {radio-buttons 
        value = "first",
        {RadioButton radio-value = "first"},
        {RadioButton
            radio-value = "second",
            reactive-label = {ReactiveLabel
                                 label-disabled = "(second)"
                             },
            enabled? = false
        },
        {RadioButton radio-value = "third"}
    }
    


focus? (フィールド)
public BaseButtonUI.focus?:bool =false

オブジェクトにキーボード フォーカスがあるかどうかを示す状態変数。

非推奨

代わりに Visual.has-key-focus? を使用します。


grabbed? (フィールド)
public BaseButtonUI.grabbed?:bool =false

このオブジェクト内でポインタ ボタンを押したままドラッグしたかどうかを示す状態変数。



has-been-rendered? (フィールド)
protected BaseButtonUI.has-been-rendered?:bool =false

画面にコントロールを描画する前に不要な描画を削除するために使用されます。



pointer-pressed? (フィールド)
public BaseButtonUI.pointer-pressed?:bool =false

ボタンが押された状態のポインタがこのオブジェクトの上にあるかどうかを示す状態変数。



rollover? (フィールド)
public BaseButtonUI.rollover?:bool =false

ポインタがこのオブジェクトの上にあるかどうかを示す状態変数。






メソッド詳細
add-action-char (メソッド)
protected {BaseButtonUI.add-action-char key:char}:void

入力されたときにこのボタンを "押した" ことにする文字を登録します。



do-press-action (メソッド)
protected abstract {BaseButtonUI.do-press-action}:void

ボタンのアクションを実行します。

オーバーライド

ボタンによって実行されるアクションの度に実行する必要があるものは、サブクラスでこれをオーバーライドする必要があります。
たとえば、CommandButtonUI はそのコントロールで Action イベントを起動し、CheckButtonUI はコントロールの状態を切り替え、RadioButtonUI はボタンの状態を設定します。


is-action-char? (メソッド)
protected {BaseButtonUI.is-action-char? key:char}:bool

この文字が入力されたときに、このボタンを "押したことにする" かどうかを示します。



modify-for-focus (メソッド)
protected abstract {BaseButtonUI.modify-for-focus focus?:bool}:void

ボタンがフォーカスを取得したときあるいは失ったときに視覚的にこれを変更します。

オーバーライド

サブクラスでは、オブジェクトがフォーカスを取得するたびまたは失うたびに適切な操作が実行されるようにこれをオーバーライドします。


on-focus-in (メソッド)
public {BaseButtonUI.on-focus-in e:FocusIn}:void

"フォーカス" 状態に変化し、適宜に反応します。

説明

状態変数を設定し、イベントを消費して送信します。


on-focus-out (メソッド)
public {BaseButtonUI.on-focus-out e:FocusOut}:void

"標準" 状態に変化し、適宜に反応します。

説明

状態変数を設定し、イベントを消費して送信します。


on-grab-release (メソッド)
public {BaseButtonUI.on-grab-release e:GrabRelease}:void

GrabRelease イベントを操作します。

説明

"標準" 状態に変化し、適宜に反応します。


on-key-press (メソッド)
public {BaseButtonUI.on-key-press e:KeyPress}:void

KeyPress イベントを操作します。

注意事項

キーがアクション用の文字の場合、ボタンを "pressed" 状態にします。
KeyPress.value が登録されているアクション用の文字と一致するかどうか確認するため BaseButtonUI.is-action-char? を呼び出します。ctrl キーが押されていない場合、一致する文字があり alt キーが押されていなければ Action イベントが起動されます。


on-pointer-enter (メソッド)
public {BaseButtonUI.on-pointer-enter e:PointerEnter}:void

"ロールオーバー" 状態に変化し、適宜に反応します。

説明

状態変数を設定し、イベントを消費して送信します。


on-pointer-leave (メソッド)
public {BaseButtonUI.on-pointer-leave e:PointerLeave}:void

"標準" 状態に変化し、適宜に反応します。

説明

状態変数を設定し、イベントを消費して送信します。


on-pointer-motion (メソッド)
public {BaseButtonUI.on-pointer-motion e:PointerMotion}:void

押されたポインタがオブジェクトの外に移動したときを検出します。

説明

状態変数を設定してポインタがオブジェクトの内側か外側かを計算し、イベントを消費して送信します。


on-pointer-press (メソッド)
public {BaseButtonUI.on-pointer-press e:PointerPress}:void

PointerPress イベントを操作します。

説明

イベント e が消費されずに、マウスの左ボタンが押されると、BaseButtonUI.pointer-pressed?BaseButtonUI.rollover?BaseButtonUI.grabbed? フラグを true に設定することでイベントを処理し、ポインタを掴みます。それが有効な場合、BaseButtonUI.button-pressed?true に設定し、関連するコントロールがアクティブになるようリクエストします。
処理されると、PointerPress イベント e は消費されます。


on-pointer-release (メソッド)
public {BaseButtonUI.on-pointer-release e:PointerRelease}:void

PointerRelease イベントを操作します。

説明

イベント e が消費されずに、マウスの左ボタンが押されると、 BaseButtonUI.pointer-pressed? フラグを false に設定することでイベントを処理します。
BaseButtonUI.action-char-key-pressed?BaseButtonUI.enabled? フラグの状態に応じて、 BaseButtonUI.button-pressed? の状態を設定し、 BaseButtonUI.do-press-action を呼び出す必要があります。
処理されると、PointerPress イベント e は消費されます。


on-raw-key-release (メソッド)
public {BaseButtonUI.on-raw-key-release e:RawKeyRelease}:void

キーがスペース バーの場合は、ボタンを標準の "押されてない" 状態に戻すことができます。

説明

ポインタが押されたままの場合、押されていない状態には戻りません。


remove-action-char (メソッド)
protected {BaseButtonUI.remove-action-char key:char}:void

入力されたときにこのボタンを "押したことにする" 文字を登録解除します。



set-size (メソッド)
public {BaseButtonUI.set-size lc:LayoutContext, bounds:GRect}:void

このオブジェクトにレイアウト幅と高さを代入します。

注意事項

BaseButtonUI.has-been-rendered? を設定します。