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.
RichTextRange FromInternal(self)
Convert from internal to public API form: (n, n+1) is the range of a single character.
(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
RichTextRange ToInternal(self)
Convert to internal form: (n, n) is the range of a single character.

Property Summary
  End: See GetEnd and SetEnd
  end: GetEnd(self) -> long
  Length: See GetLength
  Start: See GetStart and SetStart
  start: GetStart(self) -> long
  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

FromInternal(self)

Convert from internal to public API form: (n, n+1) is the range of a single character.

Returns:
RichTextRange

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

ToInternal(self)

Convert to internal form: (n, n) is the range of a single character.

Returns:
RichTextRange

Property Details

End

See GetEnd and SetEnd

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

end

GetEnd(self) -> long

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

GetStart(self) -> long

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

thisown

The membership flag

Get Method:
unknown-44814040(...)
Set Method:
unknown-44814160(...)

Class Variable Details

__safe_for_unpickling__

Type:
bool
Value:
True                                                                   

Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:51:43 2009 http://epydoc.sf.net