TextField (クラス)
public TextField {inherits BaseTextField}
インポート元: CURL.GUI.STANDARD. package 内で定義されています CURL.GUI.CONTROL-LOGICAL.
直接継承しているサブクラス: SRGTextField

単一行のテキスト エントリ ボックスを実装します。

説明

TextField は、ユーザーが任意の文字列を入力できるコントロールです。TextField はユーザーが文字入力を終了したことを 次の 2 つの方法のいずれかで登録します。TextField の値は、TextField 内の文字からなる String です。

予期されたイベント

ValueChanged: キーが入力されたとき、Command の編集 (切り取り、貼り付けなど) が行われたとき、または set-value-with-events が呼び出されたときに発生します。
ValueFinished: フォーカスが失われたとき、ユーザーが Enter キーを押したとき、または set-value-with-events が呼び出されたときに発生します。イベントは、value が最後の ValueFinished から変化した場合に必ず発生しますが、value が変化しなかった場合でも発生することがあります。
Action: ユーザーが Enter キーを押すと発生します。1 つのテキスト フィールドと "キャンセル" ボタンを持つモーダル ダイアログなどで、アプリケーションがフォーカスの消失と Enter キーストロークを区別しなければならない場合に必要です。
Commit: Dialog.commit が呼び出されると、Dialog によって送信されます。
PointerPressPointerRelease および RawKeyPress 用に記述されたイベント ハンドラはトリガされないので、代わりに ValueChangedValueFinished または KeyPress を使用します。

ビジュアル テスト

このクラスは、CurlEdit ビジュアル テスト タイプを実装します。詳細については、BaseTextField を参照してください。

注意事項

このオブジェクトは、"TextField"、"TextField/string-box"のスタイル ルールを記述することによってスタイル化することが出来ます。詳細は スキンが適用されたテキストコントロール をご覧下さい。

コンストラクタ
default:TextField を作成します。
コンストラクタ public {TextField.default
data-model:#StringDataModel = null,
value:#String = null,
prompt:#String = null,
max-chars:int = -1,
ui-object:#TextFieldUI = null,
...
}

プロパティ
halign:コントロールが表示されるエリアに関連して、このオブジェクト内のテキストが水平に並べられる方法を規定します。
ローカル オプション public TextField.halign:any ="origin"
style-element:スタイリングの目的のための、この Visual の "要素" や "型" です。
アクセサ public TextField.style-element:String
プロパティ 継承 BaseTextField: editable?, test-type-name, writable?
プロパティ 継承 BaseTextControl-of: can-redo?, can-undo?, container, data-model, form-value, has-value?, max-chars, pending-value?, prompt, record-for-undo?, selected-range, selection, value
プロパティ 継承 MultiUIControlFrame: _ui-object, _ui-set-locally?, control-appearance-changeable?, display-context, focus-object, look-and-feel, options-present-here, ui-object
プロパティ 継承 ValueControl-of: value-as-any, value-type
プロパティ 継承 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?
プロパティ 継承 SelectionContext: selection-context-active?
プロパティ 継承 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, skin
プロパティ 継承 CommandContext: commands
プロパティ 継承 ActiveTraversor: _active-traversal-container, active-traversal-container, mnemonic, tab-index, takes-focus?, valid?, validation-result
プロパティ 継承 EventTarget: event-handlers
プロパティ 継承 GetBoundsBox: layout-locally-valid?, layout-valid?
プロパティ 継承 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
プロパティ 継承 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?, 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

メソッド
create-default-ui-object:このオブジェクトに適切な UI オブジェクトを作成します。
protected {TextField.create-default-ui-object}:ControlUI
replace-selection-with-string:現在の選択の内容を text で置き換えます。
public {TextField.replace-selection-with-string
text-to-insert:StringInterface
}:void
メソッド 継承 BaseTextField: create-data-model, get-test-property, on-focus-in, on-focus-out, test-run
メソッド 継承 BaseTextControl-of: become-active-from-traversal, clear-undo-stack, delete-selection, end-undo-typing-sequence, handle-observer-message, note-selection-context-activated, note-selection-context-deactivated, record-typing-deletion-for-undo, record-typing-for-undo, redo, request-undo-stack-depth-limit, select-all, select-nothing, set-value-with-events, undo, unset-value
メソッド 継承 MultiUIValueControlFrame-of: unset-property
メソッド 継承 WritableTextSelectionContext: create-command
メソッド 継承 MultiUIControlFrame: generate-ui-object, handle-look-and-feel-change, option-changed, option-lookup-here, option-propagate-notify, react-to-state-change, react-to-visual-change, request-key-focus, set-layout
メソッド 継承 ControlFrame: become-active, clear
メソッド 継承 SelectionContext: on-selection-changed, overdraw-selection, selection-context-request-activate
メソッド 継承 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
メソッド 継承 Control: on-pointer-press
メソッド 継承 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-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-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
メソッド 継承 CommandContext: add-command, command-enabled?, command-supported?, do-command, get-command, request-update-commands
メソッド 継承 BasicBox: contains-point?, find-graphic-at, handle-crossing, on-pointer-envelope-event, pointer-enter-occurred, pointer-leave-occurred
メソッド 継承 StandardActiveTraversor: fire-event-at-container, handle-mnemonic, on-key-press
メソッド 継承 Observer: observe, stop-observing
メソッド 継承 ActiveTraversor: mark-invalid, mark-valid
メソッド 継承 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
メソッド 継承 Visual: add, 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
メソッド 継承 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
メソッド 継承 GraphicOptions: any-to-Distance, get-display-context
メソッド 継承 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
メソッド 継承 DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, 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 {TextField.default
data-model:#StringDataModel = null,
value:#String = null,
prompt:#String = null,
max-chars:int = -1,
ui-object:#TextFieldUI = null,
...
}

TextField を作成します。

data-model: この TextField の初期 data-model。この値が null の場合は、初期データ モデルを作成するために create-data-model メソッドが呼び出されます。
value: TextField の初期の value。値が null で、空でない data-model パラメータが指定されている場合、コントロールの値はその data-model の内容になります。その他の場合、TextField.has-value? は false になり、prompt が代わりに表示されます (存在する場合)。
prompt: TextField.has-value?false の場合に表示される初期 prompt String
max-chars: max-chars の初期値。TextField に入力する最大文字数を指定します。
ui-object: 描画とイベントを処理する UI デリゲート。
...: 追加オプションを指定します。



プロパティ詳細
halign (ローカル オプション)
public TextField.halign:any ="origin"

コントロールが表示されるエリアに関連して、このオブジェクト内のテキストが水平に並べられる方法を規定します。

説明

このオプションで使用可能な値の詳細は Frame.halign を参照してください。


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

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

説明

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

オーバーライド

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





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

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

説明

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


replace-selection-with-string (メソッド)
public {TextField.replace-selection-with-string
text-to-insert:StringInterface
}:void

現在の選択の内容を text で置き換えます。

text: 現在の選択の置き換えに使用されるテキストの StringInterface です。

説明

選択が空でない場合、選択の内容は削除され、その場所に text が挿入されます。選択は空であるが、有効なロケーションにある場合 (例:これが編集可能なテキスト コントロールの点滅キャレットを表す場合)、空の選択のロケーションに text が挿入されます。いずれの場合も、挿入されるテキストは、操作が完了してから選択されます。

選択が、有効なロケーションを持たない場合、エラーが発生します。