LensStudio:Ui.TextCursor.MoveOperation
EnumEnum of cursor movement operations such as Start, End, NextWord, StartOfLine, and others.
Index
Enumeration Members
Example
// TextCursor.MoveOperation defines the type of cursor movement within a text document.
const root = new Widget(parent);
const layout = new BoxLayout();
layout.setDirection(Direction.TopToBottom);
root.layout = layout;
const edit = new TextEdit(root);
edit.plainText = 'Line one\nLine two\nLine three';
layout.addWidget(edit);
const cursor = edit.textCursor;
// Move to the start of the document
cursor.movePosition(TextCursor.MoveOperation.Start, TextCursor.MoveMode.MoveAnchor);
// Move down one line
cursor.movePosition(TextCursor.MoveOperation.Down, TextCursor.MoveMode.MoveAnchor);
// Move to end of line
cursor.movePosition(TextCursor.MoveOperation.EndOfLine, TextCursor.MoveMode.MoveAnchor);
// Select the current word (move left by word with KeepAnchor)
cursor.movePosition(TextCursor.MoveOperation.WordLeft, TextCursor.MoveMode.KeepAnchor);
Enumeration Members
Down
Down:
number
Moves cursor down one line.
End
End:
number
Moves cursor to the end of the document.
EndOfBlock
EndOfBlock:
number
Moves cursor to the end of the current block.
EndOfLine
EndOfLine:
number
Moves cursor to the end of the current line.
Left
Left:
number
Moves cursor one character to the left.
NextBlock
NextBlock:
number
Moves cursor to the start of the next block.
NextCell
NextCell:
number
Moves cursor to the next table cell.
NextCharacter
NextCharacter:
number
Moves cursor one character forward.
NextRow
NextRow:
number
Moves cursor to the first cell of the next table row.
NextWord
NextWord:
number
Moves cursor to the start of the next word.
NoMove
NoMove:
number
Cursor does not move.
PreviousBlock
PreviousBlock:
number
Moves cursor to the start of the previous block.
PreviousCell
PreviousCell:
number
Moves cursor to the previous table cell.
PreviousCharacter
PreviousCharacter:
number
Moves cursor one character backward.
PreviousRow
PreviousRow:
number
Moves cursor to the first cell of the previous table row.
PreviousWord
PreviousWord:
number
Moves cursor to the start of the previous word.
Right
Right:
number
Moves cursor one character to the right.
Start
Start:
number
Moves cursor to the start of the document.
StartOfBlock
StartOfBlock:
number
Moves cursor to the start of the current block.
StartOfLine
StartOfLine:
number
Moves cursor to the start of the current line.
StartOfWord
StartOfWord:
number
Moves cursor to the start of the current word.
Up
Up:
number
Moves cursor up one line.
WordLeft
WordLeft:
number
Moves cursor one word to the left.
WordRight
WordRight:
number
Moves cursor one word to the right.