TTkTextCursor🌶️

class TTkTextCursor(document: TTkTextDocument = None)[source]🌶️

Bases: object

Methods🌶️

addCursor(line: int, pos: int) None[source]🌶️
anchor() _CP[source]🌶️
applyColor(color: TTkColor) None[source]🌶️
clearColor() None[source]🌶️
clearCursors() None[source]🌶️
clearSelection() None[source]🌶️
copy() Self[source]🌶️
document() TTkTextDocument[source]🌶️
getHighlightedLines(fr: int, to: int, color: TTkColor) list[TTkString][source]🌶️
getLinesUnderCursor() TTkString[source]🌶️
hasSelection() bool[source]🌶️
insertText(text: TTkString, moveCursor: bool = False) None[source]🌶️
movePosition(operation: MoveOperation, moveMode: MoveMode = 0, n=1, textWrap: TTkTextWrap = None) None[source]🌶️
position() _CP[source]🌶️
positionChar(cID: int = -1) str[source]🌶️
positionColor(cID: int = -1) TTkColor[source]🌶️
removeSelectedText() None[source]🌶️
replaceText(text: TTkString, moveCursor: bool = False) None[source]🌶️
restore(cursor: Self) None[source]🌶️
select(selection: SelectionType) None[source]🌶️
selectedText() TTkString[source]🌶️
selectionEnd() _CP[source]🌶️
selectionStart() _CP[source]🌶️
setColor(color: TTkColor) None[source]🌶️
setPosition(line: int, pos: int, moveMode: MoveMode = 0, cID: int = 0) None[source]🌶️

TTkTextCursor Classes🌶️

class MoveMode🌶️

Bases: object

KeepAnchor = 1🌶️

Keeps the anchor where it is.

MoveAnchor = 0🌶️

Moves the anchor to the same position as the cursor itself.

class MoveOperation🌶️

Bases: object

Down = 12🌶️

Move down one line.

End = 11🌶️

Move to the end of the document.

EndOfBlock = 15🌶️

Move to the end of the current block.

EndOfLine = 13🌶️

Move to the end of the current line.

EndOfWord = 14🌶️

Move to the end of the current word.

Left = 9🌶️

Move left one character.

NextBlock = 16🌶️

Move to the beginning of the next block.

NextCell = 21🌶️

Move to the beginning of the next table cell inside the current table. If the current cell is the last cell in the row, the cursor will move to the first cell in the next row.

NextCharacter = 17🌶️

Move to the next character.

NextRow = 23🌶️

Move to the first new cell of the next row in the current table.

NextWord = 18🌶️

Move to the next word.

NoMove = 0🌶️

Keep the cursor where it is

PreviousBlock = 6🌶️

Move to the start of the previous block.

PreviousCell = 22🌶️

Move to the beginning of the previous table cell inside the current table. If the current cell is the first cell in the row, the cursor will move to the last cell in the previous row.

PreviousCharacter = 7🌶️

Move to the previous character.

PreviousRow = 24🌶️

Move to the last cell of the previous row in the current table.

PreviousWord = 8🌶️

Move to the beginning of the previous word.

Right = 19🌶️

Move right one character.

Start = 1🌶️

Move to the start of the document.

StartOfBlock = 4🌶️

Move to the start of the current block.

StartOfLine = 3🌶️

Move to the start of the current line.

StartOfWord = 5🌶️

Move to the start of the current word.

Up = 2🌶️

Move up one line.

WordLeft = 10🌶️

Move left one word.

WordRight = 20🌶️

Move right one word.

class SelectionType🌶️

Bases: object

BlockUnderCursor = 2🌶️

Selects the block of text under the cursor.

Document = 3🌶️

Selects the entire document.

LineUnderCursor = 1🌶️

Selects the line of text under the cursor.

WordUnderCursor = 0🌶️

Selects the word under the cursor. If the cursor is not positioned within a string of selectable characters, no text is selected.

TTkTextCursor Attributes🌶️

BlockUnderCursor

Document

Down

End

EndOfBlock

EndOfLine

EndOfWord

KeepAnchor

Left

LineUnderCursor

MoveAnchor

NextBlock

NextCell

NextCharacter

NextRow

NextWord

NoMove

PreviousBlock

PreviousCell

PreviousCharacter

PreviousRow

PreviousWord

Right

Start

StartOfBlock

StartOfLine

StartOfWord

Up

WordLeft

WordRight

WordUnderCursor