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
| Parameter | Type |
|---|---|
tw | ITextWhizzHolder |
Returns
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
Implementation of
ICursorHandler.getCurrentPosition
getCurrentWord()
getCurrentWord(): ITextRange;
Returns the text range of the word the cursor is on.
Returns
Remarks
not only the current word is selected, but also the gap to the next word.
Implementation of
getFirstPosition()
getFirstPosition(): IPositionInText;
Returns the first position in the text.
Returns
Implementation of
ICursorHandler.getFirstPosition
getPositionByPoint()
getPositionByPoint(point): IPositionInText;
Returns the position in the text by point.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | IPoint | point coordinates |
Returns
Remarks
the cursor does not move.
Implementation of
ICursorHandler.getPositionByPoint
moveToDirection()
moveToDirection(direction): boolean;
Moves the current cursor position in the specified direction.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | MoveDirectionType | direction of cursor movement. |
Returns
boolean
Implementation of
ICursorHandler.moveToDirection
setToPoint()
setToPoint(point): void;
Sets the cursor to a point in the text.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | IPoint | the expected point. |
Returns
void
Implementation of
setToPosition()
setToPosition(position): void;
Sets the cursor at a position in the text.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | the expected position in the text. |
Returns
void