(クラス)
リッチ テキストのフローを配置する Box です。
例
例:
A simple TextFlowBox |
 |
{TextFlowBox
background="pink", width = 3cm,
{paragraph
This is a simple text box containing a short
paragraph.
}
}
| |
プログラミング注意事項
テキストを取得する、または、中に組み込む
Graphic を作成する場合、Curl のグラフィックシステムは自動的に
TextFlowBoxを挿入します。
例
この例では、
CommandButtonのラベルは
TextFlowBoxの中に入ります。そのため、明示的に宣言する必要はありません。
例:
A system-supplied TextFlowBox |
 |
{Frame {text Hello, world!}}
{CommandButton label="This label uses a TextFlowBox"}
| |
注意事項
TextFlowBox.text-selectable?オプションがfalseに設定されない限り、ユーザーは、マウスの左ボタンを押しながらドラッグすることで、TextFlowBox内のテキストを選択することが出来ます。
このオブジェクトは、"TextFlowBox"のスタイル ルールを記述することによりスタイル化することが出来ます。
ファクトリ public | {TextFlowBox.allowing-breaks-in-words ...}:TextFlowBox |
コンストラクタ protected | {TextFlowBox.clone-appearance-from other:TextFlowBox} |
コンストラクタ public | {TextFlowBox.default ...} |
非ローカル オプション public TextFlowBox.font-family:
String
非ローカル オプション public TextFlowBox.font-size:
any
font-style: | オブジェクト内のテキストを斜体や斜投影法などのフォントにするかどうかを指定します。 |
非ローカル オプション public TextFlowBox.font-style:
FontStyle
非ローカル オプション public TextFlowBox.font-weight:
FontWeight
アクセサ public TextFlowBox.graphical-children:{
Iterator-of Graphic}
ローカル オプション public TextFlowBox.paragraph-after-spacing:
any =.6em
ローカル オプション public TextFlowBox.paragraph-before-spacing:
any =.6em
ローカル オプション public TextFlowBox.paragraph-first-line-offset:
any =0pt
ローカル オプション public TextFlowBox.paragraph-justify:
ParagraphJustify =ParagraphJustify.left
ローカル オプション public TextFlowBox.paragraph-left-indent:
any =0pt
ローカル オプション public TextFlowBox.paragraph-line-spacing:
any =0pt
ローカル オプション public TextFlowBox.paragraph-right-indent:
any =0pt
アクセサ public TextFlowBox.style-element:
String
ローカル オプション public TextFlowBox.text-bottom-margin:
any =0pt
非ローカル オプション public TextFlowBox.text-breakable?:
bool
ローカル オプション public TextFlowBox.text-left-margin:
any =0pt
非ローカル オプション public TextFlowBox.text-line-through?:
bool
非ローカル オプション public TextFlowBox.text-preserve-whitespace?:
bool
ローカル オプション public TextFlowBox.text-right-margin:
any =0pt
ローカル オプション public TextFlowBox.text-top-margin:
any =0pt
非ローカル オプション public TextFlowBox.text-underline?:
bool
非ローカル オプション public TextFlowBox.viewport-width:
Distance プロパティ 継承 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, enabled?, 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, clonable-class?, 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-type-name, test-visible?, tooltip, user-data
public abstract | {TextFlowBox.clear}:void |
public | {TextFlowBox.find-graphic-at}:#Graphic |
public | {TextFlowBox.find-test-children}:void |
public | {TextFlowBox.get-gui-path-to-child}:{Array-of int} |
public | {TextFlowBox.get-text}:String |
public | {TextFlowBox.note-attached}:void |
public | {TextFlowBox.note-detaching}:void |
public | {TextFlowBox.notify-option-children}:void |
public | {TextFlowBox.register-options}:void |
メソッド 継承 Graphic:
after-reposition, attempt-revalidate-layout, before-reposition, constrain-height, constrain-width, create-pagination-state, detach, draw, draw-range-as-selected, draw-shadow, end-pagination, find-ancestor, find-graphical-ancestor, fire-inferior-crossing-event, get-graphical-root, get-gui-path, get-height-preference, get-origin-in-graphical-ancestor, get-origin-in-root, get-pagination-state, get-top-left-in-ancestor, get-visible-bounds-into, get-width-preference, on-drag-enter, on-inspection, on-pointer-enter, option-changed, paginate, 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, add-from-init-args, animate, change-cursor, clonable-appearance?, clone-appearance, clone-appearance-helper, 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, on-pointer-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 メソッド 継承 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-in, 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-key-press, on-pointer-button, on-pointer-crossing, on-pointer-event, 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:
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
(ファクトリ)
public | {TextFlowBox.allowing-breaks-in-words ...}:TextFlowBox |
通常は改行することのできない個所で改行してテキストをはめ込むことのできる TextFlowBox を作成します。
(コンストラクタ)
protected | {TextFlowBox.clone-appearance-from other:TextFlowBox} |
(コンストラクタ)
public | {TextFlowBox.default ...} |
TextFlowBox を初期化します。
注意事項
このメソッドでは 3 種類の引数を受け入れます。
- name=value の形式の各キーワード引数は、オプション名が新しく作成されたオブジェクトの値に設定されることを指定します。
- タイプ EventHandler の各ダイナミック イベント ハンドラ指定 (通常はon を使用して作成される) は、新しく作成されたオブジェクトに追加されるダイナミック イベント ハンドラを指定します。
- 他の任意の引数は Visual にキャストされ、テキスト (または適切な場合はインライン Graphic) として追加されます。
(ファクトリ)
TextFlowBox をインスタンス化します。
説明
注意事項
このメソッドでは 3 種類の引数を受け入れます。
- name=value の形式の各キーワード引数は、オプション名が新しく作成されたオブジェクトの値に設定されることを指定します。
- タイプ EventHandler の各ダイナミック イベント ハンドラ指定 (通常はon を使用して作成される) は、新しく作成されたオブジェクトに追加されるダイナミック イベント ハンドラを指定します。
- 他の任意の引数は Visual にキャストされ、テキスト (または適切な場合はインライン Graphic) として追加されます。
(非ローカル オプション)
テキストの文字の色。
説明
color は非ローカル オプションなので、テキストを含むどのグラフィカル オブジェクトにも、直接、あるいは仲介の子コンテナを介して設定できます。このオプションは、任意の
FillPattern に設定できます。均一色を指定するには、次のいずれかを提供します。
- サポート対象の色文字列
- FillPattern.from-rgb プロシージャ コールの戻り値
- "#rrggbb"の形式の文字列
例
例:
Text color |
 |
{paragraph color="gray", This paragraph contains
{text color="red", some reddish text}. The rest of the paragraph
has gray text.}
| |
(非ローカル オプション)
public TextFlowBox.font-family:
String
(非ローカル オプション)
public TextFlowBox.font-size:
any オブジェクト内のテキストの既定サイズを指定します。
説明
(非ローカル オプション)
オブジェクト内のテキストを斜体や斜投影法などのフォントにするかどうかを指定します。
説明
(非ローカル オプション)
オブジェクト内のテキストを、太字として強調表示するかどうかを指定します。
説明
(アクセサ)
アクセサ public TextFlowBox.graphical-children:{
Iterator-of Graphic}
(ローカル オプション)
public TextFlowBox.paragraph-after-spacing:
any =.6em
段落の下の最小間隔を指定します (後続の段落がある場合)。
説明
次の段落の
paragraph-before-spacing オプションが異なる値に設定されている場合、Curl 実行環境は両方の
Distance の最大値を使用します。
paragraph-before-spacing オプションについての説明も参照してください。
例
(ローカル オプション)
public TextFlowBox.paragraph-before-spacing:
any =.6em
段落の上の最小間隔を指定します (その前に段落がある場合)。
説明
前の段落の
paragraph-after-spacing オプションが異なる値に設定されている場合、Curl 実行環境は両方の
Distance の最大値を使用します。
paragraph-after-spacing オプションについての説明も参照してください。
例
(ローカル オプション)
public TextFlowBox.paragraph-first-line-offset:
any =0pt
段落の左端を起点とする、段落の先頭行のオフセット距離。これは、段落の先頭行が残りの行からずれる既定の距離になります。
説明
正の値は、段落の左端から右へのオフセットを指定します。
負の値は、段落の左端から左へのオフセットを指定します。
注意事項
例
(ローカル オプション)
TextFlowBox内の内容 (通常はテキスト) 行の左右の配列 (行揃えとも呼ばれる) を指定します。
説明
paragraph-justify を次の値のいずれかに設定します。
- "left":各行の左端を揃えます。これが既定の設定です。
- "right":各行の右端を揃えます。
- "center":すべての行を中央に揃えます。
例
注意事項
このオプションは、いくつかのグラフィカルコンテナ(
Box サブクラス)に含まれる
halign オプションには関係ありません。
このオプションは
TextFlowBox 内の段落の既定値を制御しますが、
paragraph のテキストフォーマットで印された段落はこの値をオーバーライドします。
(ローカル オプション)
public TextFlowBox.paragraph-left-indent:
any =0pt
段落の左端とコンテナの左端との間の距離を指定します。これは段落内の各行を左側でインデントする既定の距離になります。
注意事項
オプション: Graphic の値から段落の値を継承します。
もし、paragraph-left-indentが段落内で宣言されている場合は、内部と外部で宣言されている値の合計の分だけ左にインデントされます。
例
(ローカル オプション)
public TextFlowBox.paragraph-line-spacing:
any =0pt
段落内の行間距離を指定します。これは段落内の行間に追加される既定の距離になります。
注意事項
この値は、段落の先頭行の前のスペースまたは最終行の後のスペース、つまり段落間のスペースに影響を与えることはありません。
例
(ローカル オプション)
public TextFlowBox.paragraph-right-indent:
any =0pt
段落の右端とコンテナの右端の間の距離を指定します。これは段落内の各行を右側でインデントする既定の距離になります。
注意事項
このオプションは付加的に機能し、この値を Graphic からその中にある段落に継承します。paragraph-right-indent が段落内でも宣言されている場合、その段落のテキストの右側は段落内と外部で宣言されている値の合計分インデントされます。
例
(アクセサ)
アクセサ public TextFlowBox.style-element:
String スタイリングの目的のための、この Visual の "要素" や "型" です。
説明
オーバーライド
Visual のサブクラスのスタイルが他のオブジェクトと異なる場合、このゲッターは適切な文字列を返すようにオーバーライドされる必要があります。 慣例では,この文字列はクラス名または、オブジェクトを生成するマークアップの名前です。
オーバーライドでは、空の文字列でないかぎり、self._style-elementを返さなければなりません。
導入:
バージョン 6.0
(ローカル オプション)
public TextFlowBox.text-bottom-margin:
any =0pt
TextFlowBox の底内部マージンです。
説明
例
ライムボックスには、底内部マージンがあります。
例:
text-bottom-marginの使用 |
 |
{TextFlowBox
background = "pink", width = 5cm, text-bottom-margin = 0cm,
{paragraph Curl is fun!}
}
{TextFlowBox
background = "lime", width = 5cm, text-bottom-margin = 1cm,
{paragraph Curl is fun!}
}
| |
(非ローカル オプション)
public TextFlowBox.text-breakable?:
bool テキストを複数行に分割できるようにするかどうかを指定します。
説明
(ローカル オプション)
public TextFlowBox.text-left-margin:
any =0pt
TextFlowBox の左内部マージンです。
説明
例
例:
text-left-margin の効果 |
 |
{TextFlowBox
background = "pink", width = 5cm, text-left-margin = 0cm,
{paragraph Curl is fun!}
}
{TextFlowBox
background = "lime", width = 5cm, text-left-margin = 1cm,
{paragraph Curl is fun!}
}
| |
(非ローカル オプション)
public TextFlowBox.text-line-through?:
bool オブジェクト内のテキストに、取り消し線を適用するかどうかを指定します。
説明
(非ローカル オプション)
public TextFlowBox.text-preserve-whitespace?:
bool テキスト内の空白文字と改行を保持するか、または削除するかを指定します。
説明
(ローカル オプション)
public TextFlowBox.text-right-margin:
any =0pt
TextFlowBox の右内部マージンです。
説明
例
ライムボックスには、内部右マージンがあります。
例:
The effect of text-right-margin |
 |
{TextFlowBox
background = "pink", width = 5cm, text-right-margin = 0cm,
{paragraph paragraph-justify = "right", Curl is fun!}
}
{TextFlowBox
background = "lime", width = 5cm, text-right-margin = 1cm,
{paragraph paragraph-justify = "right", Curl is fun!}
} | |
(ローカル オプション)
public TextFlowBox.text-top-margin:
any =0pt
TextFlowBox の上内部マージンです。
説明
例
ライムボックスには、上内部マージンがあります。
例:
text-top-marginの使用 |
 |
{TextFlowBox
background = "pink", width = 5cm, text-top-margin = 0cm,
{paragraph Curl is fun!}
}
{TextFlowBox
background = "lime", width = 5cm, text-top-margin = 1cm,
{paragraph Curl is fun!}
} | |
(非ローカル オプション)
public TextFlowBox.text-underline?:
bool このオブジェクト内のテキストに、下線を引かれるかどうかを指定します。
説明
(非ローカル オプション)
public TextFlowBox.viewport-width:
Distance
(メソッド)
public abstract | {TextFlowBox.clear}:void |
(メソッド)
public | {TextFlowBox.find-graphic-at}:#Graphic |
指定ポイントをカバーし、指定テストの条件を満たす Graphic を見つけます。
x, y: self の座標フレームを基準にしたポイントの座標。
test: テスト。
Graphic を引数として与えると
test が true を返す場合、
Graphic はこのテストの条件を満たしているといえます。
戻り値
このオブジェクトが test の条件を満たす場合はこれを返します。その他の場合、このメソッドは最初に点 (x、y) を含むこのオブジェクトの子 (存在する場合)、次にこのオブジェクトの孫の順序で、test の条件を満たすオブジェクトを探します。このようなオブジェクトで最初に見つかったものが返されます。見つからない場合は null が返されます。
プログラミング注意事項
このメソッドは、ポインタ イベントを他のオブジェクトにリダイレクトするグラフィカル オブジェクトで使います。このメソッドによりポインタ イベントの転送先オブジェクトを見つけます。
オーバーライド
通常はオーバーライドされません。
(メソッド)
public | {TextFlowBox.find-test-children}:void |
フィルタに基づいてテストの子を蓄積します。
children: 配列。フィルタを渡すテストの子はこの配列に追加されます。
filter: 引数としてテストの子を受け取り、子が許可されるかどうかを示す論理値を返すプロシージャ。
注意事項
(メソッド)
public | {TextFlowBox.get-gui-path-to-child}:{Array-of int} |
指定されたBoxから、指定されたこのオブジェクトの子に向かうGUIパスを計算します。
child: パスが計算される
Visual。
childは、
selfの直接の子であることが必要です。
root: childへ向かうパスのスタート地点
プログラミング注意事項
注意事項
コンテナオブジェクトは、子オブジェクト左から右に並べる為に、合理的なスキーマを使用するかもしれません。その為GUIパスの数値の詳細は、あるCurlセッションと他のセッションで同じであることは保証されません。
オーバーライド
Boxでのこのメソッドの既定の実装は、
selfの
ordered-children内の
childのインデックスを計算し、
rootから
selfへのパスにインデックスを追加します。これは、多くの種類の
Boxにおいて正しい計算になりますが、例えば、
TextFlowBoxは、より複雑な内部構造を持っており、有益なGUIパスを生成する為にこのメソッドをオーバーライドしています。
導入:
バージョン 7.0
(メソッド)
public | {TextFlowBox.get-text}:String |
TextFlowBox の内容を表す文字列を取得します。
戻り値
テキスト文字列です。
例
ボタンを押してテキストを取得します。
例:
TextFlowBox にアクセスするための get-text の使用 |
 |
{value
let tfb:TextFlowBox =
{TextFlowBox
{paragraph The contents of this TextFlowBox.}
}
{VBox
tfb,
{CommandButton
label="get the text",
{on Action do
{popup-message {tfb.get-text}}
}
}
}
}
| |
(メソッド)
public | {TextFlowBox.note-attached}:void |
(メソッド)
public | {TextFlowBox.note-detaching}:void |
(メソッド)
public | {TextFlowBox.notify-option-children}:void |
このオブジェクトのオプションの子にオプションが変更されたことを通知します。
item: 追加または削除されたバインディング オプション。
removed?: item が削除された場合は true、それ以外の場合は false。
オーバーライド
(メソッド)
指定された (x、y) ポイントをカバーする TextFlowBox の EventForwarder 子孫を返します。
x, y: ポイントの座標です。
戻り値
プログラミング注意事項
注意事項
オーバーライド
サブクラスは、上記の指定に適合する様式で、このメソッドを実装しなければなりません。
(メソッド)
public | {TextFlowBox.register-options}:void |
このオブジェクトがバインドのモニタリングを必要とする非ローカル オプション キーを登録します。
プログラミング注意事項
このメソッドは、オブジェクトがモニタしているオプション キーを確認する必要がある場合に任意のコード内で呼び出されます。このメソッドは、プロシージャ
p をまったく呼び出さないかまたは何回か呼び出し、呼び出すたびに引数として
OptionKey を渡す必要があります。このオブジェクトによりモニタリングされるオプション キーのセットは、
p のすべての呼び出しで指定されたオプション キー セットの連結であると見なされます。
p を複数回呼び出せるという能力を利用して、オプション親はモニタの対象となるオプション キーのリストを指定して
p を一度呼び出し、次に、同じ引数
p を与えてオプションの子それぞれの
register-options メソッドを呼び出し、このメソッドの目的を果たすことができます。この方法はシンプルですが、ほとんどの場合は、オプション親がその子における
register-options 呼び出しの結果をキャッシュして、親の
register-options メソッドが呼び出されたときにそのリストを提供する方がより効率的です。ローカル バインディング オプションへの変更通知は、それらのキーが登録されていない場合でも行われます。
オーバーライド
OptionListInterface.register-options の既定の実装は、このオブジェクトの変更ハンドラを持つ各非ローカル オプションで
p を呼び出します。サブクラスは、
{super.register-options p} を呼び出し、登録される必要がある追加のオプション キー上全てで、
p を呼び出すように、このメソッドをオーバーライドする必要する必要があります。一般的に、これらの追加のオプション キーは、子供または子孫のオブジェクトが監視する必要がある非ローカル オプションに対応します。それは、このオブジェクトの子オブジェクト上で、
register-options を呼び出すことによって決定されます。
注意 一般的に、このメソッドをオーバーライドする必要があるオブジェクトだけが、オプションの子を持つオブジェクトです。