class Fox::FXText

The text widget supports editing of multiple lines of text. An optional style table can provide text coloring based on the contents of an optional parallel style buffer, which is maintained as text is edited. In a typical scenario, the contents of the style buffer is either directly written when the text is added to the widget, or is continually modified by editing the text via syntax-based highlighting engine which colors the text based on syntactical patterns.

Events

The following messages are sent by FXText to its target:

SEL_KEYPRESS

sent when a key is pressed; the message data is an FXEvent instance.

SEL_KEYRELEASE

sent when a key is released; the message data is an FXEvent instance.

SEL_LEFTBUTTONPRESS

sent when the left mouse button goes down; the message data is an FXEvent instance.

SEL_LEFTBUTTONRELEASE

sent when the left mouse button goes up; the message data is an FXEvent instance.

SEL_MIDDLEBUTTONPRESS

sent when the middle mouse button goes down; the message data is an FXEvent instance.

SEL_MIDDLEBUTTONRELEASE

sent when the middle mouse button goes up; the message data is an FXEvent instance.

SEL_RIGHTBUTTONPRESS

sent when the right mouse button goes down; the message data is an FXEvent instance.

SEL_RIGHTBUTTONRELEASE

sent when the right mouse button goes up; the message data is an FXEvent instance.

SEL_INSERTED

sent after text is inserted into the text buffer; the message data is a reference to an FXTextChange instance.

SEL_DELETED

sent after text is removed from the text buffer; the message data is a reference to an FXTextChange instance.

SEL_REPLACED

sent after some text is replaced in the text buffer; the message data is a reference to an FXTextChange instance.

SEL_CHANGED

sent when the contents of the text buffer change in any way; the message data is an integer indicating the cursor position.

SEL_SELECTED

sent after text is selected; the message data is a two-element array indicating the starting position of the selected text and the number of characters selected.

SEL_DESELECTED

sent before text is deselected; the message data is a two-element array indicating the starting position of the deselected text and the number of characters deselected.

Text widget options

TEXT_READONLY

Text is not editable

TEXT_WORDWRAP

Wrap at word breaks

TEXT_OVERSTRIKE

Overstrike mode

TEXT_FIXEDWRAP

Fixed wrap columns

TEXT_NO_TABS

Insert spaces for tabs

TEXT_AUTOINDENT

Autoindent

TEXT_SHOWACTIVE

Show active line

TEXT_AUTOSCROLL

Logging mode, keeping last line visible

Selection modes

SELECT_CHARS SELECT_WORDS SELECT_LINES

Text styles

STYLE_UNDERLINE

underline text

STYLE_STRIKEOUT

strike out text

STYLE_BOLD_

bold text

Message identifiers

ID_CURSOR_TOP
ID_CURSOR_BOTTOM
ID_CURSOR_HOME
ID_CURSOR_END
ID_CURSOR_RIGHT
ID_CURSOR_LEFT
ID_CURSOR_UP
ID_CURSOR_DOWN
ID_CURSOR_WORD_LEFT
ID_CURSOR_WORD_RIGHT
ID_CURSOR_PAGEDOWN
ID_CURSOR_PAGEUP
ID_CURSOR_SCRNTOP
ID_CURSOR_SCRNBTM
ID_CURSOR_SCRNCTR
ID_CURSOR_PAR_HOME
ID_CURSOR_PAR_END
ID_SCROLL_UP
ID_SCROLL_DOWN
ID_MARK
ID_EXTEND
ID_OVERST_STRING
ID_INSERT_STRING
ID_INSERT_NEWLINE
ID_INSERT_TAB
ID_CUT_SEL
ID_COPY_SEL
ID_PASTE_SEL
ID_DELETE_SEL
ID_SELECT_CHAR
ID_SELECT_WORD
ID_SELECT_LINE
ID_SELECT_ALL
ID_SELECT_MATCHING
ID_SELECT_BRACE
ID_SELECT_BRACK
ID_SELECT_PAREN
ID_SELECT_ANG
ID_DESELECT_ALL
ID_BACKSPACE
ID_BACKSPACE_WORD
ID_BACKSPACE_BOL
ID_DELETE
ID_DELETE_WORD
ID_DELETE_EOL
ID_DELETE_LINE
ID_TOGGLE_EDITABLE
ID_TOGGLE_OVERSTRIKE
ID_CURSOR_ROW
ID_CURSOR_COLUMN
ID_CLEAN_INDENT
ID_SHIFT_LEFT
ID_SHIFT_RIGHT
ID_SHIFT_TABLEFT
ID_SHIFT_TABRIGHT
ID_UPPER_CASE
ID_LOWER_CASE
ID_GOTO_MATCHING
ID_GOTO_SELECTED
ID_GOTO_LINE
ID_SEARCH_FORW_SEL
ID_SEARCH_BACK_SEL
ID_SEARCH
ID_REPLACE
ID_LEFT_BRACE
ID_LEFT_BRACK
ID_LEFT_PAREN
ID_LEFT_ANG
ID_RIGHT_BRACE
ID_RIGHT_BRACK
ID_RIGHT_PAREN
ID_RIGHT_ANG
ID_BLINK
ID_FLASH