Class Hierarchy
Fl_Group
|
+----Fl_Text_Display----Fl_Text_Buffer
|
+----Fl_Text_Editor
Include Files
#include <FL/Fl_Text_Display.H>
Description
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.
Methods
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.
From matt, 08:00 Sep 18, 2005 (score=3)
This was long part of FL_Text_Display, just never documented. It will be in 1.1.7:
void wrap_mode(int mode, int pos);
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.
[ Reply ] From matt, 07:58 Sep 18, 2005 (score=3)
This was long part of FL_Text_Display, just never documented. It will be in 1.1.7:
void wrap_mode(int mode, int pos);
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.
[ Reply ] From Anonymous, 00:19 Oct 28, 2003 (score=1)
How can I get the current scrolling position of a Text_Display?
FL_Scroll has special methods xposition() and yposition() but
FL_Text_Display has not. :-(
[ Reply ] From Beni, 04:09 Jun 28, 2003 (score=1)
I miss a word-wrapping feature, so you can switch word-wrapping off and on like you can do with Fl_Multiline_Output. This is really something which should be added in future releases.
[ Reply ] |