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) -> None
RichTextSelection(range : RichTextRange, container :
RichTextParagraphLayoutBox) -> None
RichTextSelection() -> None
Stores selection information.
__init__(self, *args, **kw)¶__init__ (self, sel : RichTextSelection)
Copy constructor.
sel (wx.richtext.RichTextSelection) –
None
__init__ (self, range : RichTextRange, container : RichTextParagraphLayoutBox)
Creates a selection from a range and a container.
range (wx.richtext.RichTextRange) –
container (wx.richtext.RichTextParagraphLayoutBox) –
None
__init__ (self)
Default constructor.
None
Add(self, range : RichTextRange)¶Adds a range to the selection.
range (wx.richtext.RichTextRange) –
None
Copy(self, sel : RichTextSelection)¶Copies from sel.
sel (wx.richtext.RichTextSelection) –
None
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 : int)
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 : RichTextObject)¶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.
None
Set(self, *args, **kw)¶Set (self, range : RichTextRange, container : RichTextParagraphLayoutBox)
Sets the selection.
range (wx.richtext.RichTextRange) –
container (wx.richtext.RichTextParagraphLayoutBox) –
None
Set (self, ranges : RichTextRangeArray, container : RichTextParagraphLayoutBox)
Sets the selections from an array of ranges and a container object.
ranges (RichTextRangeArray) –
container (wx.richtext.RichTextParagraphLayoutBox) –
None
SetContainer(self, container : RichTextParagraphLayoutBox)¶Sets the container for which the selection is valid.
container (wx.richtext.RichTextParagraphLayoutBox) –
None
SetRange(self, range : RichTextRange)¶Sets a single range.
range (wx.richtext.RichTextRange) –
None
SetRanges(self, ranges : RichTextRangeArray)¶Sets the selection ranges.
ranges (RichTextRangeArray) –
None
WithinSelection(self, *args, **kw)¶WithinSelection (self, pos : int, obj : RichTextObject)
Returns True if the given position is within the selection.
pos (long) –
obj (wx.richtext.RichTextObject) –
bool
WithinSelection (self, pos : int)
Returns True if the given position is within the selection.
pos (long) –
bool
WithinSelection (pos : int, ranges : RichTextRangeArray)
Returns True if the given position is within the selection range.
pos (long) –
ranges (RichTextRangeArray) –
bool
WithinSelection (range : RichTextRange, ranges : RichTextRangeArray)
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.