wx.richtext.RichTextSelection¶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.
See also
wx.richtext.RichTextBuffer, wx.richtext.RichTextCtrl
Class Hierarchy¶
Inheritance diagram for class RichTextSelection:

Methods Summary¶Copy constructor. |
|
Adds a range to the selection. |
|
Copies from sel. |
|
Returns the container for which the selection is valid. |
|
Returns the number of ranges in the selection. |
|
Returns the range at the given index. |
|
Returns the selection ranges. |
|
Returns the selection appropriate to the specified object, if any; returns an empty array if none at the level of the object’s container. |
|
Returns |
|
Resets the selection. |
|
Sets the selection. |
|
Sets the container for which the selection is valid. |
|
Sets a single range. |
|
Sets the selection ranges. |
|
Returns |
|
Equality operator. |
Properties Summary¶See |
|
See |
|
A public C++ attribute of type |
|
A public C++ attribute of type |
Class API¶wx.richtext.RichTextSelection(object)¶Possible constructors:
RichTextSelection(sel)
RichTextSelection(range, container)
RichTextSelection()
Stores selection information.
__init__(self, *args, **kw)¶__init__ (self, sel)
Copy constructor.
sel (wx.richtext.RichTextSelection) –
__init__ (self, range, container)
Creates a selection from a range and a container.
range (wx.richtext.RichTextRange) –
container (wx.richtext.RichTextParagraphLayoutBox) –
__init__ (self)
Default constructor.
Add(self, range)¶Adds a range to the selection.
range (wx.richtext.RichTextRange) –
Copy(self, sel)¶Copies from sel.
sel (wx.richtext.RichTextSelection) –
GetContainer(self)¶Returns the container for which the selection is valid.
GetCount(self)¶Returns the number of ranges in the selection.
int
GetRange(self, *args, **kw)¶GetRange (self, i)
Returns the range at the given index.
i (int) –
GetRange (self)
Returns the first range if there is one, otherwise wx.richtext.RICHTEXT_NO_SELECTION.
GetRanges(self)¶Returns the selection ranges.
RichTextRangeArray
GetSelectionForObject(self, obj)¶Returns the selection appropriate to the specified object, if any; returns an empty array if none at the level of the object’s container.
obj (wx.richtext.RichTextObject) –
RichTextRangeArray
IsValid(self)¶Returns True if the selection is valid.
bool
Reset(self)¶Resets the selection.
Set(self, *args, **kw)¶Set (self, range, container)
Sets the selection.
range (wx.richtext.RichTextRange) –
container (wx.richtext.RichTextParagraphLayoutBox) –
Set (self, ranges, container)
Sets the selections from an array of ranges and a container object.
ranges (RichTextRangeArray) –
container (wx.richtext.RichTextParagraphLayoutBox) –
SetContainer(self, container)¶Sets the container for which the selection is valid.
container (wx.richtext.RichTextParagraphLayoutBox) –
SetRange(self, range)¶Sets a single range.
range (wx.richtext.RichTextRange) –
SetRanges(self, ranges)¶Sets the selection ranges.
ranges (RichTextRangeArray) –
WithinSelection(self, *args, **kw)¶WithinSelection (self, pos, obj)
Returns True if the given position is within the selection.
pos (long) –
obj (wx.richtext.RichTextObject) –
bool
WithinSelection (self, pos)
Returns True if the given position is within the selection.
pos (long) –
bool
WithinSelection (pos, ranges)
Returns True if the given position is within the selection range.
pos (long) –
ranges (RichTextRangeArray) –
bool
WithinSelection (range, ranges)
Returns True if the given range is within the selection range.
range (wx.richtext.RichTextRange) –
ranges (RichTextRangeArray) –
bool
__bool__(self)¶int
__nonzero__(self)¶int
__eq__(self)¶Equality operator.
sel (wx.richtext.RichTextSelection) –
Container¶See GetContainer and SetContainer
m_container¶A public C++ attribute of type RichTextParagraphLayoutBox .
m_ranges¶A public C++ attribute of type RichTextRangeArray.