wx.richtext.RichTextRange

Inheritance diagram for 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.

Properties Summary

Class API

Methods

__init__(start=0, end=0)

Creates a new range object.

Parameters:

  • start (long)
  • end (long)

Returns:

wx.richtext.RichTextRange


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


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


Get()

Returns the start and end properties as a tuple.


Returns:

(start, end)


GetEnd()

Returns the end position.


Returns:

long


GetLength()

Returns the length of the range.


Returns:

long


GetStart()

Returns the start of the range.


Returns:

long


IsOutside(range)

Returns True if this range is completely outside range.

Parameters:


Returns:

bool


IsWithin(range)

Returns True if this range is completely within range.

Parameters:


Returns:

bool


LimitTo(range)

Limits this range to be within range.

Parameters:


Returns:

bool


SetEnd(end)

Sets the end of the range.

Parameters:

  • end (long)

SetRange(start, end)

Sets the range.

Parameters:

  • start (long)
  • end (long)

SetStart(start)

Sets the start of the range.

Parameters:

  • start (long)

Swap()
Swaps the start and end.

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

End
See GetEnd and SetEnd
Length
See GetLength
Start
See GetStart and SetStart
end
See GetEnd
start
See GetStart