Version: 3.2.5
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() [1/3]

wxRichTextRange::wxRichTextRange ( )
inline

Default constructor.

◆ wxRichTextRange() [2/3]

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

Constructor taking start and end positions.

◆ wxRichTextRange() [3/3]

wxRichTextRange::wxRichTextRange ( const wxRichTextRange range)
inline

Copy constructor.

◆ ~wxRichTextRange()

wxRichTextRange::~wxRichTextRange ( )
inline

Member Function Documentation

◆ Contains()

bool wxRichTextRange::Contains ( long  pos) const
inline

Returns true if pos was within the range.

Does not match if the range is empty.

◆ FromInternal()

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.

◆ GetEnd()

long wxRichTextRange::GetEnd ( ) const
inline

Gets the end position.

◆ GetLength()

long wxRichTextRange::GetLength ( ) const
inline

Gets the length of the range.

◆ GetStart()

long wxRichTextRange::GetStart ( ) const
inline

Returns the start position.

◆ IsOutside()

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

Returns true if this range is completely outside range.

◆ IsWithin()

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

Returns true if this range is completely within range.

◆ LimitTo()

bool wxRichTextRange::LimitTo ( const wxRichTextRange range)

Limit this range to be within range.

◆ operator!=()

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

Inequality operator.

◆ operator+()

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

Adds a range to this range.

◆ operator-()

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

Subtracts a range from this range.

◆ operator=()

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

Assigns range to this range.

◆ operator==()

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

Equality operator.

Returns true if range is the same as this range.

◆ SetEnd()

void wxRichTextRange::SetEnd ( long  end)
inline

Sets the end position.

◆ SetRange()

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

Sets the range start and end positions.

◆ SetStart()

void wxRichTextRange::SetStart ( long  start)
inline

Sets the start position.

◆ Swap()

void wxRichTextRange::Swap ( )
inline

Swaps the start and end.

◆ ToInternal()

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

◆ m_end

long wxRichTextRange::m_end
protected

◆ m_start

long wxRichTextRange::m_start
protected