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()
RichTextRange(start, end)
RichTextRange(range)
This stores beginning and end positions for a range of data.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, start, end)
Constructor taking start and end positions.
start (long) –
end (long) –
__init__ (self, range)
Copy constructor.
range (wx.richtext.RichTextRange) –
Contains
(self, pos)¶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.
long
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.
long
GetStart
(self)¶Returns the start position.
long
IsOutside
(self, range)¶Returns True
if this range is completely outside range.
range (wx.richtext.RichTextRange) –
bool
IsWithin
(self, range)¶Returns True
if this range is completely within range.
range (wx.richtext.RichTextRange) –
bool
LimitTo
(self, range)¶Limit this range to be within range.
range (wx.richtext.RichTextRange) –
bool
SetEnd
(self, end)¶Sets the end position.
end (long) –
SetRange
(self, start, end)¶Sets the range start and end positions.
start (long) –
end (long) –
SetStart
(self, start)¶Sets the start position.
start (long) –
Swap
(self)¶Swaps the start and end.
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) –