Class ElemTextField

class ElemTextField
  : Element
  , IEditor
  , ActionOperator

Constructors

NameDescription
this ()

Fields

TypeNameDescription
bool
copyWholeLineWhenNoSelection
Signal!(...)
onCaretPosChange Emits when the editor caret position changes
Signal!(...)
onChange
Signal!(...)
onEnterKeyPress Emits on Enter key press inside the text field
bool
wantTabs When true, Tab / Shift+Tab presses are processed internally in widget (e.g. insert tab character) instead of focus change navigation.

11 inherited fields

Properties

TypeNameDescription
int
caretPos[get] Returns caret position
bool
empty[get] True when there is no text
bool
enableCaretBlinking[get, set] When true, enables caret blinking, otherwise it's always visible
SizeOf!(float)
fullContentSize[get] Get full content size in pixels
bool
hasRedo[get] Returns true if there is at least one operation in redo buffer
bool
hasUndo[get] Returns true if there is at least one operation in undo buffer
bool
isBlank[get] Returns true if the line is empty or consists only of spaces and tabs
int
lineLength[get] Length of the line string
dstring
minSizeTester[get, set]
dchar
passwordChar[get, set]
dstring
placeholder[get, set] Placeholder is a short peace of text that describes the expected input
bool
readOnly[get, set] When true, user cannot change content of the editor
bool
replaceMode[get, set] When true, entered character replaces the character under cursor
selectionRange[get, set] Current selection range
dstring
text[get, set] Text as a string

35 inherited properties

Methods

NameDescription
clearUndo () Clear undo/redo history
copy () Copy currently selected text into clipboard
correctPosition (position) When position is out of content bounds, fix it to nearest valid position
correctRange (range) When range positions is out of content bounds or swapped, fix them to nearest valid position
cut () Cut currently selected text into clipboard
deselect () Clear selection (doesn't change the text, just deselects)
getCursorType (x, y) Returns mouse cursor type for the element
getRangeText (range) Returns text from the specified range
getSelectedText () Returns current selection text
handleCustomPropertiesChange ()
handleKeyEvent (event) Process key event, return true if event is processed.
handleMouseEvent (event) Process mouse event; return true if event is processed by widget.
handleStyleChange (ptype) Handle changes of style properties (e.g. invalidate)
jumpTo (pos, select) Change caret position, fixing it to valid bounds, and ensure it is visible
paste () Replace currently selected text with clipboard content
redo () Redoes last undone change
replaceSelectionText (newText)
selectAll () Select the whole text
undo () Undoes last change
applyPasswordChar (s)
arrangeContent () Called from layout, after box and innerBox were set
bindActions ()
caretRect () Returns cursor rectangle
clientToTextPos (pt)
computeBoundaries () ...
delNextChar ()
delNextWord ()
delPrevChar ()
delPrevWord ()
drawCaret (pr) Draw caret
drawContent (pr)
drawLineBackground (pr, lineBox, visibleBox) Override for custom highlighting of the line background
ensureCaretVisible ()
handleContentChange (posAfter)
handleFocusChange (focused, receivedFocusFromKeyboard) Called to process focus changes before onFocusChange signal, override to do it
moveByWord (p, direction, camelCasePartsAsWords) Change text position p to nearest word bound (direction < 0 - back, > 0 - forward)
performOperation (op) Edit the content
removeRangeText (range)
removeSelectionText ()
replaceRange (before, newContent)
selectLineByMouse (x, y)
selectWordByMouse (x, y)
startCaretBlinking ()
stopCaretBlinking ()
textPosToClient (p)
unbindActions ()
updateActions ()
updateCaretPositionByMouse (x, y, selecting)
updateSelectionAfterCursorMovement (oldCaretPos, selecting)

46 inherited methods