TCursorSelection Class Reference

#include <frmtlay.h>

class TCursorSelection

Detailed Description

The cursor or cursor selection within a document.

If the cursor and anchor position differ, the selection covers the text from the lower to the higher position, not including the character after the higher position. If the selection is changed (by shift plus arrow keys in many UIs) the cursor position changes and the anchor remains the same.

Member Attribute Documentation

iAnchorPos

TInt iAnchorPos

The anchor position.

iCursorPos

TInt iCursorPos

The cursor position.

Constructor & Destructor Documentation

TCursorSelection ( )

TCursorSelection()[inline]

Constructs the TCursorSelection object initialising the cursor and anchor positions to zero.

TCursorSelection ( TInt, TInt )

TCursorSelection(TIntaCursorPos,
TIntaAnchorPos
)[inline]

Constructs the TCursorSelection object with a cursor and anchor position.

Parameters
aCursorPosThe cursor position.
aAnchorPosThe anchor position.

Member Function Documentation

HigherPos ( )

TInt HigherPos()const [inline]

Gets the greater of the cursor and anchor positions.

Return Value
The greater of the cursor and anchor positions.

Length ( )

TInt Length()const [inline]

Returns the number of characters in the selected range.

Return Value
The length of the selection.

LowerPos ( )

TInt LowerPos()const [inline]

Gets the lesser of the cursor and anchor positions.

Return Value
The lesser of the cursor and anchor positions.

SetSelection ( TInt, TInt )

voidSetSelection(TIntaCursorPos,
TIntaAnchorPos
)[inline]

Sets the cursor and anchor positions for the selection.

Parameters
aCursorPosThe new cursor position.
aAnchorPosThe new anchor position.