TextEdit

Plain text input view.

Modulerequire("gui")
TypeClass
InheritsView

Class methods

create()

Create a new TextEdit.

Return

TextEdit

Methods

setText(text)

Change the text in the view.

Parameters

getText()

Return currently displayed text.

Return

String

undo()

Undo the last edit operation in the undo queue.

canUndo()

Return whether there are any actions in undo queue.

redo()

Redo the next action in the redo queue

canRedo()

Return whether there are any actions in redo queue.

cut()

Delete (cut) the current selection, if any, copy the deleted text to the clipboard.

copy()

Copy current selection to clipboard.

paste()

Copy the current content of the clipboard to current caret position.

selectAll()

Select all text.

getSelectionRange()

Return the start position and end position of current selection.

If nothing is selected, (-1, -1) would be returned.

Return

[Integer, Integer]

selectRange(start, end)

Select text between start and end positions.

Parameters

getTextInRange(start, end)

Return the text between start and end positions.

Parameters

Return

String

insertText(text)

Insert text at current caret position.

Parameters

insertTextAt(text, position)

Insert text at the position.

Parameters

delete()

Delete text of current selection.

deleteRange(start, end)

Delete text between start and end positions.

Parameters

Events

onTextChange(self)

Emitted when user has changed text.

Parameters

Preventable

No.