wx.richtext.RichTextRange¶
This stores beginning and end positions for a range of data.
Class Hierarchy¶
Methods Summary¶
Default constructor. |
|
Returns |
|
Converts the internal range, which uses the first and last character positions of the range, to the API-standard range, whose end is one past the last character in the range. |
|
Return the start and end properties as a tuple. |
|
Gets the end position. |
|
Returns an immutable representation of the |
|
Gets the length of the range. |
|
Returns the start position. |
|
Returns |
|
Returns |
|
Limit this range to be within range. |
|
Sets the end position. |
|
Sets the range start and end positions. |
|
Sets the start position. |
|
Swaps the start and end. |
|
Converts the API-standard range, whose end is one past the last character in the range, to the internal form, which uses the first and last character positions of the range. |
|
Inequality operator. |
|
Adds a range to this range. |
|
Subtracts a range from this range. |
|
Equality operator. |
Properties Summary¶
See |
|
Class API¶
- class wx.richtext.RichTextRange(object)¶
Possible constructors:
RichTextRange() -> None RichTextRange(start, end) -> None RichTextRange(range) -> None
This stores beginning and end positions for a range of data.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor.
- Return type:
None
__init__ (self, start, end)
Constructor taking start and end positions.
- Parameters:
start (long)
end (long)
- Return type:
None
__init__ (self, range)
Copy constructor.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
None
- Contains(self, pos)¶
Returns
True
if pos was within the range.Does not match if the range is empty.
- Parameters:
pos (long)
- Return type:
bool
- FromInternal(self)¶
Converts the internal range, which uses the first and last character positions of the range, to the API-standard range, whose end is one past the last character in the range.
In other words, one is added to the end position. (n, n+1) is the range of a single character.
- Return type:
- Get(self)¶
Return the start and end properties as a tuple.
- Return type:
Any
- GetEnd(self)¶
Gets the end position.
- Return type:
int
- GetIM(self)¶
Returns an immutable representation of the
wx.RichTextRange
object, based onnamedtuple
.This new object is hashable and can be used as a dictionary key, be added to sets, etc. It can be converted back into a real
wx.RichTextRange
with a simple statement like this:obj = wx.RichTextRange(imObj)
.
- GetLength(self)¶
Gets the length of the range.
- Return type:
int
- GetStart(self)¶
Returns the start position.
- Return type:
int
- IsOutside(self, range)¶
Returns
True
if this range is completely outside range.- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
bool
- IsWithin(self, range)¶
Returns
True
if this range is completely within range.- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
bool
- LimitTo(self, range)¶
Limit this range to be within range.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
bool
- SetEnd(self, end)¶
Sets the end position.
- Parameters:
end (long)
- Return type:
None
- SetRange(self, start, end)¶
Sets the range start and end positions.
- Parameters:
start (long)
end (long)
- Return type:
None
- SetStart(self, start)¶
Sets the start position.
- Parameters:
start (long)
- Return type:
None
- Swap(self)¶
Swaps the start and end.
- Return type:
None
- ToInternal(self)¶
Converts the API-standard range, whose end is one past the last character in the range, to the internal form, which uses the first and last character positions of the range.
In other words, one is subtracted from the end position. (n, n) is the range of a single character.
- Return type:
- __bool__(self)¶
- __getitem__(self, idx)¶
- __len__(self)¶
- __nonzero__(self)¶
- __reduce__(self)¶
- __repr__(self)¶
- __setitem__(self, idx, val)¶
- __str__(self)¶
- __ne__(self, range)¶
Inequality operator.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
bool
- __add__(self, range)¶
Adds a range to this range.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
- __sub__(self, range)¶
Subtracts a range from this range.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
- __eq__(self, range)¶
Equality operator.
Returns
True
if range is the same as this range.- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
bool
Properties¶