Package wx :: Module richtext :: Class RichTextRange
[frames | no frames]

Type RichTextRange

object --+
         |
        RichTextRange


RichTextRange is a data structure that represents a range of text within a 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 RichTextRange is expected a 2-tuple containing (start, end) can be used instead.


Method Summary
RichTextRange __init__(self, start, end)
Creates a new range object.
RichTextRange __add__(self, range)
  __del__(self)
bool __eq__(self, other)
Test for equality of RichTextRange objects.
  __getitem__(self, index)
  __len__(self)
  __nonzero__(self)
  __reduce__(self)
  __repr__(self)
  __setitem__(self, index, val)
  __str__(self)
RichTextRange __sub__(self, range)
bool Contains(self, pos)
Returns true if the given position is within this range.
(start,end) Get()
Returns the start and end properties as a tuple.
long GetEnd(self)
long GetLength(self)
Gets the length of the range
long GetStart(self)
bool IsOutside(self, range)
Returns true if this range is completely outside 'range'
bool IsWithin(self, range)
Returns true if this range is completely within 'range'
bool LimitTo(self, range)
Limit this range to be within 'range'
  SetEnd(self, end)
  SetRange(self, start, end)
  SetStart(self, start)
  Swap(self)
Swaps the start and end

Property Summary
  End: See GetEnd and SetEnd
  end
  Length: See GetLength
  Start: See GetStart and SetStart
  start
  thisown: The membership flag

Class Variable Summary
bool __safe_for_unpickling__ = True

Method Details

__init__(self, start=0, end=0)
(Constructor)

Creates a new range object.

Parameters:
start
           (type=long)

end
           (type=long)

Returns:
RichTextRange
Overrides:
__builtin__.object.__init__

__eq__(self, other)
(Equality operator)

Test for equality of RichTextRange objects.

Parameters:
other
           (type=PyObject)

Returns:
bool

Contains(self, pos)

Returns true if the given position is within this range. Allow for the possibility of an empty range - assume the position is within this empty range.

Parameters:
pos
           (type=long)

Returns:
bool

Get()

Returns the start and end properties as a tuple.

Returns:
(start,end)

GetLength(self)

Gets the length of the range

Returns:
long

IsOutside(self, range)

Returns true if this range is completely outside 'range'

Parameters:
range
           (type=RichTextRange)

Returns:
bool

IsWithin(self, range)

Returns true if this range is completely within 'range'

Parameters:
range
           (type=RichTextRange)

Returns:
bool

LimitTo(self, range)

Limit this range to be within 'range'

Parameters:
range
           (type=RichTextRange)

Returns:
bool

Swap(self)

Swaps the start and end


Property Details

End

See GetEnd and SetEnd

Get Method:
GetEnd(self)
Set Method:
SetEnd(self, end)

end

Get Method:
GetEnd(self)
Set Method:
SetEnd(self, end)

Length

See GetLength

Get Method:
GetLength(self)

Start

See GetStart and SetStart

Get Method:
GetStart(self)
Set Method:
SetStart(self, start)

start

Get Method:
GetStart(self)
Set Method:
SetStart(self, start)

thisown

The membership flag

Get Method:
unknown--1274397252(...)
Set Method:
unknown--1274397196(...)

Class Variable Details

__safe_for_unpickling__

Type:
bool
Value:
True                                                                   

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:10:39 2007 http://epydoc.sf.net