Version: 3.0.3
wxRichTextRange Class Reference

#include <wx/richtext/richtextbuffer.h>

Detailed Description

This stores beginning and end positions for a range of data.

Library:  wxRichText
Category:  Rich Text
See also
wxRichTextBuffer, wxRichTextCtrl

Public Member Functions

 wxRichTextRange ()
 Default constructor. More...
 
 wxRichTextRange (long start, long end)
 Constructor taking start and end positions. More...
 
 wxRichTextRange (const wxRichTextRange &range)
 Copy constructor. More...
 
 ~wxRichTextRange ()
 
void operator= (const wxRichTextRange &range)
 Assigns range to this range. More...
 
bool operator== (const wxRichTextRange &range) const
 Equality operator. More...
 
bool operator!= (const wxRichTextRange &range) const
 Inequality operator. More...
 
wxRichTextRange operator- (const wxRichTextRange &range) const
 Subtracts a range from this range. More...
 
wxRichTextRange operator+ (const wxRichTextRange &range) const
 Adds a range to this range. More...
 
void SetRange (long start, long end)
 Sets the range start and end positions. More...
 
void SetStart (long start)
 Sets the start position. More...
 
long GetStart () const
 Returns the start position. More...
 
void SetEnd (long end)
 Sets the end position. More...
 
long GetEnd () const
 Gets the end position. More...
 
bool IsOutside (const wxRichTextRange &range) const
 Returns true if this range is completely outside range. More...
 
bool IsWithin (const wxRichTextRange &range) const
 Returns true if this range is completely within range. More...
 
bool Contains (long pos) const
 Returns true if pos was within the range. More...
 
bool LimitTo (const wxRichTextRange &range)
 Limit this range to be within range. More...
 
long GetLength () const
 Gets the length of the range. More...
 
void Swap ()
 Swaps the start and end. More...
 
wxRichTextRange ToInternal () const
 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. More...
 
wxRichTextRange FromInternal () const
 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. More...
 

Protected Attributes

long m_start
 
long m_end
 

Constructor & Destructor Documentation

wxRichTextRange::wxRichTextRange ( )
inline

Default constructor.

wxRichTextRange::wxRichTextRange ( long  start,
long  end 
)
inline

Constructor taking start and end positions.

wxRichTextRange::wxRichTextRange ( const wxRichTextRange range)
inline

Copy constructor.

wxRichTextRange::~wxRichTextRange ( )
inline

Member Function Documentation

bool wxRichTextRange::Contains ( long  pos) const
inline

Returns true if pos was within the range.

Does not match if the range is empty.

wxRichTextRange wxRichTextRange::FromInternal ( ) const
inline

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.

long wxRichTextRange::GetEnd ( ) const
inline

Gets the end position.

long wxRichTextRange::GetLength ( ) const
inline

Gets the length of the range.

long wxRichTextRange::GetStart ( ) const
inline

Returns the start position.

bool wxRichTextRange::IsOutside ( const wxRichTextRange range) const
inline

Returns true if this range is completely outside range.

bool wxRichTextRange::IsWithin ( const wxRichTextRange range) const
inline

Returns true if this range is completely within range.

bool wxRichTextRange::LimitTo ( const wxRichTextRange range)

Limit this range to be within range.

bool wxRichTextRange::operator!= ( const wxRichTextRange range) const
inline

Inequality operator.

wxRichTextRange wxRichTextRange::operator+ ( const wxRichTextRange range) const
inline

Adds a range to this range.

wxRichTextRange wxRichTextRange::operator- ( const wxRichTextRange range) const
inline

Subtracts a range from this range.

void wxRichTextRange::operator= ( const wxRichTextRange range)
inline

Assigns range to this range.

bool wxRichTextRange::operator== ( const wxRichTextRange range) const
inline

Equality operator.

Returns true if range is the same as this range.

void wxRichTextRange::SetEnd ( long  end)
inline

Sets the end position.

void wxRichTextRange::SetRange ( long  start,
long  end 
)
inline

Sets the range start and end positions.

void wxRichTextRange::SetStart ( long  start)
inline

Sets the start position.

void wxRichTextRange::Swap ( )
inline

Swaps the start and end.

wxRichTextRange wxRichTextRange::ToInternal ( ) const
inline

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.

Member Data Documentation

long wxRichTextRange::m_end
protected
long wxRichTextRange::m_start
protected