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.
Class Hierarchy¶
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¶
- class wx.richtext.RichTextSelection(object)¶
Possible constructors:
RichTextSelection(sel) -> None RichTextSelection(range, container) -> None RichTextSelection() -> None
Stores selection information.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, sel)
Copy constructor.
- Parameters:
- Return type:
None
__init__ (self, range, container)
Creates a selection from a range and a container.
- Parameters:
range (wx.richtext.RichTextRange)
container (wx.richtext.RichTextParagraphLayoutBox)
- Return type:
None
__init__ (self)
Default constructor.
- Return type:
None
- Add(self, range)¶
Adds a range to the selection.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
None
- Copy(self, sel)¶
Copies from sel.
- Parameters:
- Return type:
None
- GetContainer(self)¶
Returns the container for which the selection is valid.
- Return type:
- GetCount(self)¶
Returns the number of ranges in the selection.
- Return type:
int
- GetRange(self, *args, **kw)¶
-
GetRange (self, i)
Returns the range at the given index.
- Parameters:
i (int)
- Return type:
GetRange (self)
Returns the first range if there is one, otherwise
wx.richtext.RICHTEXT_NO_SELECTION
.- Return type:
- GetRanges(self)¶
Returns the selection ranges.
- Return type:
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.
- Parameters:
- Return type:
RichTextRangeArray
- IsValid(self)¶
Returns
True
if the selection is valid.- Return type:
bool
- Reset(self)¶
Resets the selection.
- Return type:
None
- Set(self, *args, **kw)¶
-
Set (self, range, container)
Sets the selection.
- Parameters:
range (wx.richtext.RichTextRange)
container (wx.richtext.RichTextParagraphLayoutBox)
- Return type:
None
Set (self, ranges, container)
Sets the selections from an array of ranges and a container object.
- Parameters:
ranges (RichTextRangeArray)
container (wx.richtext.RichTextParagraphLayoutBox)
- Return type:
None
- SetContainer(self, container)¶
Sets the container for which the selection is valid.
- Parameters:
container (wx.richtext.RichTextParagraphLayoutBox)
- Return type:
None
- SetRange(self, range)¶
Sets a single range.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
None
- SetRanges(self, ranges)¶
Sets the selection ranges.
- Parameters:
ranges (RichTextRangeArray)
- Return type:
None
- WithinSelection(self, *args, **kw)¶
-
WithinSelection (self, pos, obj)
Returns
True
if the given position is within the selection.- Parameters:
pos (long)
- Return type:
bool
WithinSelection (self, pos)
Returns
True
if the given position is within the selection.- Parameters:
pos (long)
- Return type:
bool
WithinSelection (pos, ranges)
Returns
True
if the given position is within the selection range.- Parameters:
pos (long)
ranges (RichTextRangeArray)
- Return type:
bool
WithinSelection (range, ranges)
Returns
True
if the given range is within the selection range.- Parameters:
range (wx.richtext.RichTextRange)
ranges (RichTextRangeArray)
- Return type:
bool
- __bool__(self)¶
- Return type:
bool
- __nonzero__(self)¶
- Return type:
bool
- __eq__(self, sel)¶
Equality operator.
- Parameters:
- Return type:
bool
Properties¶
- Container¶
See
GetContainer
andSetContainer
- m_container¶
A public C++ attribute of type
RichTextParagraphLayoutBox
.
- m_ranges¶
A public C++ attribute of type
RichTextRangeArray
.