class fwt::RichText

sys::Obj
  fwt::Widget
    fwt::TextWidget
      fwt::RichText

@Js
@Serializable

Source

RichText is used to view and edit text styled with different fonts and colors.

bg

Color? bg

Source

The current background color of text field Defaults to null (system default)

fg

Color? fg

Source

The current foreground color for text. Defaults to null (system default)

hbar

@Transient
ScrollBar hbar := ... { private set }

Source

Horizontal scroll bar.

make

new make(|This|? f := null)

Source

Default constructor.

model

RichTextModel? model

Source

Backing 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)

Source

Convenience for RichTextModel.modify.

offsetAtPos

Int? offsetAtPos(Int x, Int y)

Source

Map a coordinate on the widget to an offset in the text, or return null if no mapping at specified point.

onCaret

EventListeners onCaret()

Source

Callback when the caret position is modified.

Event id fired:

Event fields:

onModify

EventListeners onModify()

Source

Callback when the text is modified. This event occurs after the modification. See onVerify to trap changes before they occur.

Event id fired:

Event fields:

onSelect

EventListeners onSelect()

Source

Callback when the selection is modified.

Event id fired:

Event fields:

onVerify

EventListeners onVerify()

Source

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 onModify to trap changes after they occur.

Event id fired:

Event fields:

  • Event.data: a TextChange instance where newText specifies the proposed text being inserted. The callback can update newText with the actual text to be inserted or set to null to cancel the modification.
onVerifyKey

EventListeners onVerifyKey()

Source

Callback before a key event is processed. This gives listeners a chance to trap the key event and consume it before it is processed by the editor.

Event id fired:

Event fields:

repaintLine

Void repaintLine(Int lineIndex)

Source

Repaint the line specified by the zero based line index.

repaintRange

Void repaintRange(Int offset, Int len)

Source

Repaint the specified text range.

showLine

Void showLine(Int lineIndex)

Source

Ensure the editor is scrolled such that the specified line is visible.

tabSpacing

Int tabSpacing

Source

Tab width measured in space characters. Default is 2.

text

virtual override Str text

Source

Convenience for model.text (model must be installed).

topLine

virtual Int topLine

Source

The zero based line index which is currently at the top of the scrolling viewport.

vbar

@Transient
ScrollBar vbar := ... { private set }

Source

Vertical scroll bar.