Fl_Group | +----Fl_Text_Display----Fl_Text_Buffer | +----Fl_Text_Editor
#include <FL/Fl_Text_Display.H>
This is the FLTK text display widget. It allows the user to view multiple lines of text and supports highlighting and scrolling. The buffer that is displayed in the widget is managed by the Fl_Text_Buffer class.
Creates a new text display widget.
Destroys a text display widget.
Sets or gets the current text buffer associated with the text widget. Multiple text widgets can be associated with the same text buffer.
Sets or gets the text cursor color.
Sets the text cursor style to one of the following:
Fl_Text_Display::NORMAL_CURSOR
- Shows an I beam.
Fl_Text_Display::CARET_CURSOR
- Shows a caret under the text.
Fl_Text_Display::DIM_CURSOR
- Shows a dimmed I beam.
Fl_Text_Display::BLOCK_CURSOR
- Shows an unfilled box around the current
character.
Fl_Text_Display::HEAVY_CURSOR
- Shows a thick I beam.
Hides the text cursor.
Sets the text buffer, text styles, and callbacks to use when
displaying text in the widget. Style buffers cannot be shared
between widgets and are often used to do syntax highlighting.
The editor example from Chapter 4
shows how to use the highlight_data()
method.
Returns non-zero if the specified mouse position is inside the current selection.
Inserts text at the current insert position.
Sets or gets the current insert position.
Moves the current insert position down one line.
Moves the current insert position left one character.
Moves the current insert position right one character.
Moves the current insert position up one line.
Moves the current insert position right one word.
Replaces text at the current insert position.
Returns the style associated with the character at position
lineStartPos + lineIndex
.
Moves the current insert position left one word.
Marks text from start
to end
as needing a redraw.
Sets or gets where scrollbars are attached to the widget -
FL_ALIGN_LEFT
and FL_ALIGN_RIGHT
for
the vertical scrollbar and FL_ALIGN_TOP
and
FL_ALIGN_BOTTOM
for the horizontal scrollbar.
Sets or gets the width/height of the scrollbars.
Scrolls the current buffer to start at the specified line and column.
Shows or hides the text cursor.
Scrolls the text buffer to show the current insert position.
Sets or gets the default color of text in the widget.
Sets or gets the default font used when drawing text in the widget.
Sets or gets the default size of text in the widget.
Moves the insert position to the end of the current word.
Moves the insert position to the beginning of the current word.
If mode is not zero, this call enables automatic word wrapping at column pos. Word-wrapping does not change the text buffer itself, only the way that the text is displayed.