Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: FRMTLAY.H

Class TCursorSelection

class TCursorSelection;

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.

Members

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


Construction and destruction


TCursorSelection()

inline TCursorSelection();

Description

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


TCursorSelection()

inline 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]


Member functions


SetSelection()

inline 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.


LowerPos()

inline 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()

inline 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()

inline TInt Length() const;

Description

Returns the number of characters in the selected range.

Return value

TInt

The length of the selection.

[Top]


Member data


iCursorPos

TInt iCursorPos;

Description

The cursor position.


iAnchorPos

TInt iAnchorPos;

Description

The anchor position.