Multiline text widget
Attributes
marginTop: | top margin [Integer]
|
marginBottom: | bottom margin [Integer]
|
marginLeft: | left margin [Integer]
|
marginRight: | right margin [Integer]
|
wrapColumns: | wrap columns [Integer]
|
tabColumns: | tab columns [Integer]
|
barColumns: | number of columns used for line numbers [Integer]
|
modified: | indicates whether text is modified [Boolean]
|
editable: | indicates whether text is editable [Boolean]
|
styled: | indicates whether text is styled [Boolean]
|
delimiters: | word delimiters [String]
|
font: | text font [FXFont]
|
textColor: | text color [FXColor]
|
selBackColor: | selected text background color [FXColor]
|
selTextColor: | selected text color [FXColor]
|
hiliteTextColor: | highlight text color [FXColor]
|
hiliteBackColor: | highlight text background color [FXColor]
|
activeBackColor: | active background color [FXColor]
|
cursorColor: | cursor color [FXColor]
|
numberColor: | line number color [FXColor]
|
barColor: | bar color [FXColor]
|
helpText: | status line help text [String]
|
tipText: | tool tip message [String]
|
text: | the text buffer [String]
|
length: | the length of the text buffer [Integer]
|
anchorPos: | anchor position [Integer]
|
cursorPos: | cursor position [Integer]
|
selStartPos: | selection start position [Integer]
|
selEndPos: | selection end position [Integer]
|
textStyle: | text widget style [Integer]
|
visRows: | number of visible rows [Integer]
|
visCols: | number of visible columns [Integer]
|
hiliteMatchTime: | brace and parenthesis match highlighting time, in milliseconds [Integer]. A
hiliteMatchTime of 0 disables brace matching.
|
hiliteStyles: | array of hilite styles [an Array of FXHiliteStyle instances]
|
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
two-element array indicating the position at which the text was inserted
and the number of characters inserted.
|
SEL_DELETED: | sent before text is removed from the text buffer; the message data is a
two-element array indicating the position at which text will be removed and
the number of characters to be removed.
|
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
|
Selection modes
SELECT_CHARS SELECT_WORDS SELECT_LINES
Text styles
STYLE_UNDERLINE: | underline text
|
STYLE_STRIKEOUT: | strike out 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::
activeBackColor |
[RW] |
|
anchorPos |
[RW] |
|
barColor |
[RW] |
|
barColumns |
[RW] |
|
cursorCol |
[RW] |
|
cursorColor |
[RW] |
|
cursorPos |
[R] |
|
cursorRow |
[RW] |
|
delimiters |
[RW] |
|
editable |
[W] |
|
font |
[RW] |
|
helpText |
[RW] |
|
hiliteBackColor |
[RW] |
|
hiliteMatchTime |
[RW] |
|
hiliteStyles |
[RW] |
|
hiliteTextColor |
[RW] |
|
length |
[R] |
|
marginBottom |
[RW] |
|
marginLeft |
[RW] |
|
marginRight |
[RW] |
|
marginTop |
[RW] |
|
modified |
[W] |
|
numberColor |
[RW] |
|
selBackColor |
[RW] |
|
selEndPos |
[R] |
|
selStartPos |
[R] |
|
selTextColor |
[RW] |
|
styled |
[W] |
|
tabColumns |
[RW] |
|
text |
[RW] |
|
textColor |
[RW] |
|
textStyle |
[RW] |
|
tipText |
[RW] |
|
visCols |
[RW] |
|
visRows |
[RW] |
|
wrapColumns |
[RW] |
|
Construct multiline text widget
Return true if text was modified
Return true if text is editable
Return true if styled text
Get character at position pos in text buffer
Get style at position pos in style buffer
Extract n characters of text from position pos in the
text buffer
Extract n characters of style info from position pos in
the style buffer
Replace the m characters at pos with text. If
notify is true, a SEL_DELETED message is sent to
the text widget's message target before the old text is removed, and a
SEL_INSERTED and SEL_CHANGED message is sent after the
new text is inserted.
Replace the m characters at pos with text. If
notify is true, a SEL_DELETED message is sent to
the text widget's message target before the old text is removed, and a
SEL_INSERTED and SEL_CHANGED message is sent after the
new text is inserted.
Append text to the end of the text buffer. If notify is
true, SEL_INSERTED and SEL_CHANGED messages are
sent to the text widget's message target after the new text is added.
Append text to the end of the text buffer. If notify is
true, SEL_INSERTED and SEL_CHANGED messages are
sent to the text widget's message target after the new text is added.
Insert text at position pos in the text buffer. If
notify is true, SEL_INSERTED and
SEL_CHANGED messages are sent to the text widget's message target
after the new text is inserted.
Insert text at position pos in the text buffer. If
notify is true, SEL_INSERTED and
SEL_CHANGED messages are sent to the text widget's message target
after the new text is inserted.
Remove n characters of text at position pos in the buffer
If notify is true, a SEL_DELETED message is sent
to the text widget's message target before the text is removed and a
SEL_CHANGED message is sent after the change occurs.
Change the style of n characters at position pos in the
text buffer to style. Here, style is either an integer
into the style table, indicating the new style for all the affected
characters; or style is a String...
Change the text If notify is true, SEL_INSERTED
and SEL_CHANGED messages are sent to the text widget's message
target after the new text is set.
Change the text in the buffer to new text If notify is
true, SEL_INSERTED and SEL_CHANGED messages are
sent to the text widget's message target after the new text is set.
Shift block of lines from position startPos up to endPos
by given amount. If notify is true, a
SEL_DELETED message is sent to the text widget's message target
before the old text is removed, and a SEL_INSERTED and
SEL_CHANGED message is sent after the new text is inserted.
Search for string in text buffer, returning the extent of the
string in beg and end. The search starts from the given
start position, scans forward (SEARCH_FORWARD) or
backward (SEARCH_BACKWARD), and wraps around if
SEARCH_WRAP has been specified. The search type is either a plain
search (SEARCH_EXACT), case insensitive search
(SEARCH_IGNORECASE), or regular expression search
(SEARCH_REGEX). For regular expression searches, capturing
parentheses are used if npar is greater than 1; in this case, the
number of entries in the beg and end arrays must be
npar also. If either beg or end or both are nil,
internal arrays are used.
Return true if position pos is selected
Return true if position pos is fully visible
Return text position at given visible (x, y) coordinate
Return position of beginning of line containing position pos
Return position of end of line containing position pos
Return start of next line
Return start of previous line
Return start of previous row
Return end of previous word
Return begin of next word
Return validated position
Make line containing pos the top line
Return position of top line
Make line containing pos the bottom line
Return the position of the bottom line
Make line containing pos the center line
Set cursor row. If notify is true, a SEL_CHANGED
message is sent to the text widget's message target after the change
occurs.
Set cursor column. If notify is true, a
SEL_CHANGED message is sent to the text widget's message target
after the change occurs.
Set cursor position. If notify is true, a
SEL_CHANGED message is sent to the text widget's message target
after the change occurs.
Select all text. If notify is true, a
SEL_DESELECTED message is sent to the text widget's message target
before any previously selected text is deselected, then a
SEL_SELECTED message is sent after the new text is selected.
Select len characters starting at position pos. If
notify is true, a SEL_DESELECTED message is sent
to the text widget's message target before any previously selected text is
deselected, then a SEL_SELECTED message is sent after the new text
is selected.
Extend selection to pos. If notify is true, a
SEL_DESELECTED message is sent to the text widget's message target
before any previously selected text is deselected, then a
SEL_SELECTED message is sent after the new text is selected.
Kill the selection. If notify is true, a
SEL_DESELECTED message is sent to the text widget's message target
before the text is deselected.
Highlight len characters starting at position pos
Scroll text to make the given position visible