This stores beginning and end positions for a range of data.
See also
wx.richtext.RichTextBuffer, wx.richtext.RichTextCtrl
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. |
See |
|
wx.richtext.
RichTextRange
(object)¶Possible constructors:
RichTextRange() -> None
RichTextRange(start : int, end : int) -> None
RichTextRange(range : RichTextRange) -> None
This stores beginning and end positions for a range of data.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
None
__init__ (self, start : int, end : int)
Constructor taking start and end positions.
start (long) –
end (long) –
None
__init__ (self, range : RichTextRange)
Copy constructor.
range (wx.richtext.RichTextRange) –
None
Contains
(self, pos : int)¶Returns True
if pos was within the range.
Does not match if the range is empty.
pos (long) –
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.
Get
(self)¶Return the start and end properties as a tuple.
tuple
( start, end )
GetEnd
(self)¶Gets the end position.
int
GetIM
(self)¶Returns an immutable representation of the wx.RichTextRange
object, based on namedtuple
.
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.
int
GetStart
(self)¶Returns the start position.
int
IsOutside
(self, range : RichTextRange)¶Returns True
if this range is completely outside range.
range (wx.richtext.RichTextRange) –
bool
IsWithin
(self, range : RichTextRange)¶Returns True
if this range is completely within range.
range (wx.richtext.RichTextRange) –
bool
LimitTo
(self, range : RichTextRange)¶Limit this range to be within range.
range (wx.richtext.RichTextRange) –
bool
SetEnd
(self, end : int)¶Sets the end position.
end (long) –
None
SetRange
(self, start : int, end : int)¶Sets the range start and end positions.
start (long) –
end (long) –
None
SetStart
(self, start : int)¶Sets the start position.
start (long) –
None
Swap
(self)¶Swaps the start and end.
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.
__bool__
(self)¶__getitem__
(self, idx)¶__len__
(self)¶__nonzero__
(self)¶__reduce__
(self)¶__repr__
(self)¶__setitem__
(self, idx, val)¶__str__
(self)¶__ne__
(self)¶Inequality operator.
range (wx.richtext.RichTextRange) –
__add__
(self)¶Adds a range to this range.
range (wx.richtext.RichTextRange) –
__sub__
(self)¶Subtracts a range from this range.
range (wx.richtext.RichTextRange) –
__eq__
(self)¶Equality operator.
Returns True
if range is the same as this range.
range (wx.richtext.RichTextRange) –