************************* wx.richtext.RichTextRange ************************* Inheritance diagram for `wx.richtext.RichTextRange`: | .. inheritance-diagram:: wx.richtext.RichTextRange | Description =========== This class stores beginning and end positions for a range of data. `wx.richtext.RichTextRange` is a data structure that represents a range of text within a `wx.richtext.RichTextCtrl `_. It simply contains integer `start` and `end` properties and a few operations useful for dealing with ranges. In most places in wxPython where a `wx.richtext.RichTextRange` is expected a 2-tuple containing (`start`, `end`) can be used instead. Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Contains <#Contains>`_ * `FromInternal <#FromInternal>`_ * `Get <#Get>`_ * `GetEnd <#GetEnd>`_ * `GetLength <#GetLength>`_ * `GetStart <#GetStart>`_ * `IsOutside <#IsOutside>`_ * `IsWithin <#IsWithin>`_ * `LimitTo <#LimitTo>`_ * `SetEnd <#SetEnd>`_ * `SetRange <#SetRange>`_ * `SetStart <#SetStart>`_ * `Swap <#Swap>`_ * `ToInternal <#ToInternal>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `End <#End>`_ * `Length <#Length>`_ * `Start <#Start>`_ * `end <#end>`_ * `start <#start>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(start=0, end=0) Creates a new range object. **Parameters:** * `start` (long) * `end` (long) | **Returns:** `wx.richtext.RichTextRange `_ -------- .. method:: Contains(pos) Returns ``True`` if the given position is within this range. Does not match if the range is empty. **Parameters:** * `pos` (long) | **Returns:** `bool` -------- .. method:: FromInternal() 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. | **Returns:** `wx.richtext.RichTextRange `_ -------- .. method:: Get() Returns the start and end properties as a tuple. | **Returns:** `(start, end)` -------- .. method:: GetEnd() Returns the end position. | **Returns:** `long` -------- .. method:: GetLength() Returns the length of the range. | **Returns:** `long` -------- .. method:: GetStart() Returns the start of the range. | **Returns:** `long` -------- .. method:: IsOutside(range) Returns ``True`` if this range is completely outside `range`. **Parameters:** * `range` (`wx.richtext.RichTextRange `_) | **Returns:** `bool` -------- .. method:: IsWithin(range) Returns ``True`` if this range is completely within `range`. **Parameters:** * `range` (`wx.richtext.RichTextRange `_) | **Returns:** `bool` -------- .. method:: LimitTo(range) Limits this range to be within `range`. **Parameters:** * `range` (`wx.richtext.RichTextRange `_) | **Returns:** `bool` -------- .. method:: SetEnd(end) Sets the end of the range. **Parameters:** * `end` (long) -------- .. method:: SetRange(start, end) Sets the range. **Parameters:** * `start` (long) * `end` (long) -------- .. method:: SetStart(start) Sets the start of the range. **Parameters:** * `start` (long) -------- .. method:: Swap() Swaps the start and end. -------- .. method:: ToInternal() 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. | **Returns:** `wx.richtext.RichTextRange `_ -------- Properties ^^^^^^^^^^ .. attribute:: End See `GetEnd <#GetEnd>`_ and `SetEnd <#SetEnd>`_ .. attribute:: Length See `GetLength <#GetLength>`_ .. attribute:: Start See `GetStart <#GetStart>`_ and `SetStart <#SetStart>`_ .. attribute:: end See `GetEnd`_ .. attribute:: start See `GetStart`_