TextBox

Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.

Up and coming

An editable text field with everything a desktop field needs: caret, selection, clipboard, undo, Japanese input and a submit key.

Caret and word moves with Shift and Ctrl, Ctrl+A, C, X and V, Ctrl+Z and Y, a right-click Cut, Copy and Paste, and the Windows input method for Japanese are built in. SubmitKey picks Enter, Ctrl+Enter or none. Markup is off while the box has focus, the focus look fades in, and a box that replaces a label starts out looking just like it.

Made with Instance.new("TextBox") or Clone().

Properties

NameTypeDefaultDescription
PlaceholderTextstring
MultiLineboolean
SubmitKey"Enter" | "CtrlEnter" | "None"With "Enter", Enter submits and Shift+Enter adds a line.
EditablebooleanFalse leaves select and copy only.
MaxLengthnumber?
Focusedbooleanread-only
CursorPositionnumberThe caret, in characters counted from 1; -1 without focus.
SelectionStartnumberWhere the selection starts; -1 without a selection.

Methods

NameArgumentsReturnsDescription
CaptureFocus()()
ReleaseFocus()()
InsertText(text: string)()Inserts at the caret, over any selection, as one undo step.
SelectAll()()

Events

NamePassesDescription
TextChanged(string)
Submitted(string)
FocusGained()
FocusLost(boolean)Passes true when focus was lost by submitting.
From TextLabel 17
From UIObject 19
From ScreenItem 2
From ShotInstance 33