|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
This is an internal class for Fl_Text_Buffer to manage text selections. This class works correctly with utf-8 strings assuming that the parameters for all calls are on character boundaries. More...
#include <Fl_Text_Buffer.H>
Public Member Functions | |
| void | set (int start, int end) |
| Set the selection range. | |
| void | update (int pos, int nDeleted, int nInserted) |
| Updates a selection afer text was modified. Updates an individual selection for changes in the corresponding text. | |
| int | start () const |
| Return the byte offset to the first selected character. | |
| int | end () const |
| Return the byte ofsset to the character after the last selected character. | |
| bool | selected () const |
| Returns true if any text is selected. | |
| void | selected (bool b) |
| Modify the 'selected' flag. | |
| int | includes (int pos) const |
| int | position (int *start, int *end) const |
| Return the positions of this selection. | |
Protected Attributes | |
| int | mStart |
| byte offset to the first selected character | |
| int | mEnd |
| byte offset to the character after the last selected character | |
| bool | mSelected |
| this flag is set if any text is selected | |
Friends | |
| class | Fl_Text_Buffer |
This is an internal class for Fl_Text_Buffer to manage text selections. This class works correctly with utf-8 strings assuming that the parameters for all calls are on character boundaries.
Definition at line 80 of file Fl_Text_Buffer.H.
| int Fl_Text_Selection::end | ( | ) | const [inline] |
Return the byte ofsset to the character after the last selected character.
Definition at line 111 of file Fl_Text_Buffer.H.
Referenced by Fl_Text_Display::extend_range_for_styles(), and includes().
| int Fl_Text_Selection::includes | ( | int | pos | ) | const |
Return true if position pos with indentation dispIndex is in the Fl_Text_Selection.
Definition at line 1245 of file Fl_Text_Buffer.cxx.
References end(), selected(), and start().
Referenced by Fl_Text_Display::in_selection(), and Fl_Text_Display::position_style().
| int Fl_Text_Selection::position | ( | int * | start, |
| int * | end | ||
| ) | const |
Return the positions of this selection.
| start | retrun byte offset to first selected character |
| end | retrun byte offset pointing after last selected character |
Definition at line 1231 of file Fl_Text_Buffer.cxx.
References mEnd, mSelected, and mStart.
Referenced by Fl_Text_Buffer::highlight_position(), Fl_Text_Buffer::remove_selection_(), Fl_Text_Buffer::replace_selection_(), Fl_Text_Buffer::secondary_selection_position(), Fl_Text_Buffer::selection_position(), and Fl_Text_Buffer::selection_text_().
| bool Fl_Text_Selection::selected | ( | ) | const [inline] |
Returns true if any text is selected.
Definition at line 118 of file Fl_Text_Buffer.H.
Referenced by Fl_Text_Display::buffer_modified_cb(), Fl_Text_Display::extend_range_for_styles(), and includes().
| void Fl_Text_Selection::selected | ( | bool | b | ) | [inline] |
Modify the 'selected' flag.
| b | new flag |
Definition at line 124 of file Fl_Text_Buffer.H.
References b.
| void Fl_Text_Selection::set | ( | int | start, |
| int | end | ||
| ) |
Set the selection range.
| start | byte offset to first selected character |
| end | byte offset pointing after last selected character |
Definition at line 1219 of file Fl_Text_Buffer.cxx.
References mEnd, min, mSelected, and mStart.
Referenced by Fl_Text_Buffer::highlight(), Fl_Text_Buffer::secondary_select(), and Fl_Text_Buffer::select().
| int Fl_Text_Selection::start | ( | ) | const [inline] |
Return the byte offset to the first selected character.
Definition at line 105 of file Fl_Text_Buffer.H.
Referenced by Fl_Text_Display::extend_range_for_styles(), and includes().
| void Fl_Text_Selection::update | ( | int | pos, |
| int | nDeleted, | ||
| int | nInserted | ||
| ) |
Updates a selection afer text was modified. Updates an individual selection for changes in the corresponding text.
| pos | byte offset into text buffer at which the change occured |
| nDeleted | number of bytes deleted from the buffer |
| nInserted | number of bytes inserted into the buffer |
Definition at line 1449 of file Fl_Text_Buffer.cxx.
References mEnd, mSelected, and mStart.
Referenced by Fl_Text_Buffer::update_selections().
friend class Fl_Text_Buffer [friend] |
Definition at line 81 of file Fl_Text_Buffer.H.
int Fl_Text_Selection::mEnd [protected] |
byte offset to the character after the last selected character
Definition at line 143 of file Fl_Text_Buffer.H.
Referenced by Fl_Text_Buffer::Fl_Text_Buffer(), position(), Fl_Text_Buffer::redisplay_selection(), set(), and update().
bool Fl_Text_Selection::mSelected [protected] |
this flag is set if any text is selected
Definition at line 144 of file Fl_Text_Buffer.H.
Referenced by Fl_Text_Buffer::Fl_Text_Buffer(), position(), Fl_Text_Buffer::redisplay_selection(), Fl_Text_Buffer::replace_selection_(), Fl_Text_Buffer::secondary_unselect(), set(), Fl_Text_Buffer::unhighlight(), Fl_Text_Buffer::unselect(), and update().
int Fl_Text_Selection::mStart [protected] |
byte offset to the first selected character
Definition at line 142 of file Fl_Text_Buffer.H.
Referenced by Fl_Text_Buffer::Fl_Text_Buffer(), position(), Fl_Text_Buffer::redisplay_selection(), set(), and update().