TCursorSelection Class Reference

class TCursorSelection

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.

Constructor & Destructor Documentation

TCursorSelection()

TCursorSelection ( ) [inline]

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

TCursorSelection(TInt, TInt)

TCursorSelection ( TInt aCursorPos,
TInt aAnchorPos
) [inline]

Constructs the TCursorSelection object with a cursor and anchor position.

Parameters

TInt aCursorPos The cursor position.
TInt aAnchorPos The anchor position.

Member Functions Documentation

HigherPos()

TInt HigherPos ( ) const [inline]

Gets the greater of the cursor and anchor positions.

Length()

TInt Length ( ) const [inline]

Returns the number of characters in the selected range.

LowerPos()

TInt LowerPos ( ) const [inline]

Gets the lesser of the cursor and anchor positions.

SetSelection(TInt, TInt)

void SetSelection ( TInt aCursorPos,
TInt aAnchorPos
) [inline]

Sets the cursor and anchor positions for the selection.

Parameters

TInt aCursorPos The new cursor position.
TInt aAnchorPos The new anchor position.

Member Data Documentation

TInt iAnchorPos

TInt iAnchorPos

The anchor position.

TInt iCursorPos

TInt iCursorPos

The cursor position.