class fwt::RichText
sys::Obj fwt::Widget fwt::TextWidget fwt::RichText
RichText is used to view and edit text styled with different fonts and colors.
- hbar
-
@Transient
ScrollBar hbar := ... { private set }Horizontal scroll bar.
- make
-
new make(|This|? f := null)Default constructor.
- model
-
RichTextModel? modelBacking data model of text document. The model cannot be changed once the widget has been been mounted into an open window.
- modify
-
virtual override Void modify(Int start, Int replaceLen, Str newText)Convenience for
RichTextModel.modify. - offsetAtPos
-
Int? offsetAtPos(Int x, Int y)Map a coordinate on the widget to an offset in the text, or return null if no mapping at specified point.
- onCaret
-
EventListeners onCaret()Callback when the caret position is modified.
Event id fired:
Event fields:
Event.offset: the new caret offset
- onModify
-
EventListeners onModify()Callback when the text is modified. This event occurs after the modification. See
onVerifyto trap changes before they occur.Event id fired:
Event fields:
Event.data: theTextChangeinstance.
- onSelect
-
EventListeners onSelect()Callback when the selection is modified.
Event id fired:
Event fields:
Event.offset: the starting offsetEvent.size: the number of chars selected
- onVerify
-
EventListeners onVerify()Callback before the text is modified. This gives listeners a chance to intercept modifications and potentially modify the inserted text. This event occurs before the modification. See
onModifyto trap changes after they occur.Event id fired:
Event fields:
Event.data: aTextChangeinstance wherenewTextspecifies the proposed text being inserted. The callback can updatenewTextwith the actual text to be inserted or set to null to cancel the modification.
- onVerifyKey
-
EventListeners onVerifyKey()Callback before a key event is processed. This gives listeners a chance to trap the key event and
consumeit before it is processed by the editor.Event id fired:
Event fields:
Event.keyChar: unicode character represented by key eventEvent.key: key code including the modifiers
- repaintLine
-
Void repaintLine(Int lineIndex)Repaint the line specified by the zero based line index.
- repaintRange
-
Void repaintRange(Int offset, Int len)Repaint the specified text range.
- showLine
-
Ensure the editor is scrolled such that the specified line is visible.
- tabSpacing
-
Int tabSpacingTab width measured in space characters. Default is 2.
- text
-
virtual override Str textConvenience for
model.text(model must be installed). - topLine
-
virtual Int topLineThe zero based line index which is currently at the top of the scrolling viewport.
- vbar
-
@Transient
ScrollBar vbar := ... { private set }Vertical scroll bar.