Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: frmtlay.h

Class TCursorSelection

TCursorSelection

Support

Supported from 5.0

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.

Defined in TCursorSelection:
HigherPos(), Length(), LowerPos(), SetSelection(), TCursorSelection(), iAnchorPos, iCursorPos


Construction


TCursorSelection()

TCursorSelection();

Description

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


TCursorSelection()

TCursorSelection(TInt aCursorPos,TInt aAnchorPos);

Description

Constructs the TCursorSelection object with a cursor and anchor position.

Parameters

TInt aCursorPos

The cursor position.

TInt aAnchorPos

The anchor position.

[Top]


Set selection


SetSelection()

void SetSelection(TInt aCursorPos,TInt aAnchorPos);

Description

Sets the cursor and anchor positions for the selection.

Parameters

TInt aCursorPos

The new cursor position.

TInt aAnchorPos

The new anchor position.

[Top]


Selection enquiry


LowerPos()

TInt LowerPos() const;

Description

Gets the lesser of the cursor and anchor positions.

Return value

TInt

The lesser of the cursor and anchor positions.


HigherPos()

TInt HigherPos() const;

Description

Gets the greater of the cursor and anchor positions.

Return value

TInt

The greater of the cursor and anchor positions.


Length()

TInt Length() const;

Description

Returns the number of characters in the selected range.

Return value

TInt

The length of the selection.

[Top]


Data members


iCursorPos

TInt iCursorPos

Description

The cursor position.


iAnchorPos

TInt iAnchorPos

Description

The anchor position.