#include <wx/richtext/richtextbuffer.h>
Stores selection information.
The selection does not have to be contiguous, though currently non-contiguous selections are only supported for a range of table cells (a geometric block of cells can consist of a set of non-contiguous positions).
The selection consists of an array of ranges, and the container that is the context for the selection. It follows that a single selection object can only represent ranges with the same parent container.
Public Member Functions | |
wxRichTextSelection (const wxRichTextSelection &sel) | |
Copy constructor. More... | |
wxRichTextSelection (const wxRichTextRange &range, wxRichTextParagraphLayoutBox *container) | |
Creates a selection from a range and a container. More... | |
wxRichTextSelection () | |
Default constructor. More... | |
void | Reset () |
Resets the selection. More... | |
void | Set (const wxRichTextRange &range, wxRichTextParagraphLayoutBox *container) |
Sets the selection. More... | |
void | Add (const wxRichTextRange &range) |
Adds a range to the selection. More... | |
void | Set (const wxRichTextRangeArray &ranges, wxRichTextParagraphLayoutBox *container) |
Sets the selections from an array of ranges and a container object. More... | |
void | Copy (const wxRichTextSelection &sel) |
Copies from sel. More... | |
void | operator= (const wxRichTextSelection &sel) |
Assignment operator. More... | |
bool | operator== (const wxRichTextSelection &sel) const |
Equality operator. More... | |
wxRichTextRange | operator[] (size_t i) const |
Index operator. More... | |
wxRichTextRangeArray & | GetRanges () |
Returns the selection ranges. More... | |
const wxRichTextRangeArray & | GetRanges () const |
Returns the selection ranges. More... | |
void | SetRanges (const wxRichTextRangeArray &ranges) |
Sets the selection ranges. More... | |
size_t | GetCount () const |
Returns the number of ranges in the selection. More... | |
wxRichTextRange | GetRange (size_t i) const |
Returns the range at the given index. More... | |
wxRichTextRange | GetRange () const |
Returns the first range if there is one, otherwise wxRICHTEXT_NO_SELECTION. More... | |
void | SetRange (const wxRichTextRange &range) |
Sets a single range. More... | |
wxRichTextParagraphLayoutBox * | GetContainer () const |
Returns the container for which the selection is valid. More... | |
void | SetContainer (wxRichTextParagraphLayoutBox *container) |
Sets the container for which the selection is valid. More... | |
bool | IsValid () const |
Returns true if the selection is valid. More... | |
wxRichTextRangeArray | GetSelectionForObject (wxRichTextObject *obj) const |
Returns the selection appropriate to the specified object, if any; returns an empty array if none at the level of the object's container. More... | |
bool | WithinSelection (long pos, wxRichTextObject *obj) const |
Returns true if the given position is within the selection. More... | |
bool | WithinSelection (long pos) const |
Returns true if the given position is within the selection. More... | |
Static Public Member Functions | |
static bool | WithinSelection (long pos, const wxRichTextRangeArray &ranges) |
Returns true if the given position is within the selection range. More... | |
static bool | WithinSelection (const wxRichTextRange &range, const wxRichTextRangeArray &ranges) |
Returns true if the given range is within the selection range. More... | |
Public Attributes | |
wxRichTextRangeArray | m_ranges |
wxRichTextParagraphLayoutBox * | m_container |
|
inline |
Copy constructor.
|
inline |
Creates a selection from a range and a container.
|
inline |
Default constructor.
|
inline |
Adds a range to the selection.
|
inline |
Copies from sel.
|
inline |
Returns the container for which the selection is valid.
|
inline |
Returns the number of ranges in the selection.
|
inline |
Returns the first range if there is one, otherwise wxRICHTEXT_NO_SELECTION.
|
inline |
Returns the range at the given index.
|
inline |
Returns the selection ranges.
|
inline |
Returns the selection ranges.
wxRichTextRangeArray wxRichTextSelection::GetSelectionForObject | ( | wxRichTextObject * | obj | ) | const |
Returns the selection appropriate to the specified object, if any; returns an empty array if none at the level of the object's container.
|
inline |
Returns true if the selection is valid.
|
inline |
Assignment operator.
bool wxRichTextSelection::operator== | ( | const wxRichTextSelection & | sel | ) | const |
Equality operator.
|
inline |
Index operator.
|
inline |
Resets the selection.
|
inline |
Sets the selection.
|
inline |
Sets the selections from an array of ranges and a container object.
|
inline |
Sets the container for which the selection is valid.
|
inline |
Sets a single range.
|
inline |
Sets the selection ranges.
|
static |
Returns true if the given range is within the selection range.
|
inline |
Returns true if the given position is within the selection.
|
static |
Returns true if the given position is within the selection range.
bool wxRichTextSelection::WithinSelection | ( | long | pos, |
wxRichTextObject * | obj | ||
) | const |
Returns true if the given position is within the selection.
wxRichTextParagraphLayoutBox* wxRichTextSelection::m_container |
wxRichTextRangeArray wxRichTextSelection::m_ranges |