Skip to main content

CursorHandler

Classes

CursorHandler

Handler for performing simple operations with the cursor.

Remarks

the TextWhizz is used as a text engine.

Implements

Constructors

Constructor
new CursorHandler(tw): CursorHandler;
Parameters
ParameterType
twITextWhizzHolder
Returns

CursorHandler

Accessors

cursorChangeEvent
Get Signature
get cursorChangeEvent(): EventObject<IPositionInText>;

Cursor change event.

Remarks

Reports the current cursor position.

Returns

EventObject<IPositionInText>

Cursor change event.

Remarks

Reports the current cursor position.

Implementation of

ICursorHandler.cursorChangeEvent

Methods

getCurrentParagraphIndex()
getCurrentParagraphIndex(): number;

Returns the current index of the paragraph.

Returns

number

Implementation of

ICursorHandler.getCurrentParagraphIndex

getCurrentPosition()
getCurrentPosition(): IPositionInText;

Returns the current cursor position.

Returns

IPositionInText

Implementation of

ICursorHandler.getCurrentPosition

getCurrentWord()
getCurrentWord(): ITextRange;

Returns the text range of the word the cursor is on.

Returns

ITextRange

Remarks

not only the current word is selected, but also the gap to the next word.

Implementation of

ICursorHandler.getCurrentWord

getFirstPosition()
getFirstPosition(): IPositionInText;

Returns the first position in the text.

Returns

IPositionInText

Implementation of

ICursorHandler.getFirstPosition

getPositionByPoint()
getPositionByPoint(point): IPositionInText;

Returns the position in the text by point.

Parameters
ParameterTypeDescription
pointIPointpoint coordinates
Returns

IPositionInText

Remarks

the cursor does not move.

Implementation of

ICursorHandler.getPositionByPoint

moveToDirection()
moveToDirection(direction): boolean;

Moves the current cursor position in the specified direction.

Parameters
ParameterTypeDescription
directionMoveDirectionTypedirection of cursor movement.
Returns

boolean

Implementation of

ICursorHandler.moveToDirection

setToPoint()
setToPoint(point): void;

Sets the cursor to a point in the text.

Parameters
ParameterTypeDescription
pointIPointthe expected point.
Returns

void

Implementation of

ICursorHandler.setToPoint

setToPosition()
setToPosition(position): void;

Sets the cursor at a position in the text.

Parameters
ParameterTypeDescription
positionIPositionInTextthe expected position in the text.
Returns

void

Implementation of

ICursorHandler.setToPosition

Was this page helpful?