-
Notifications
You must be signed in to change notification settings - Fork 2
TextInput
The TextInput is a clickable object with word wrapped text (centre aligned by default).
Extends Sheet
-
colour- The background colour. -
colour.focussed- The background colour when focussed. -
colour.highlighted- The background colour of highlighted text. -
textColour- The text colour. -
textColour.focussed- The text colour when focussed. -
textColour.highlighted- The text colour of highlighted text. -
mask- The text masking. -
mask.focussed- The text masking when focussed.
TextInput( number x, number y, number width )Note, this element uses the
onPreDraw(),onMouseEvent(),onTextEvent(), andonKeyboardEvent()callbacks of Sheet.
TextInput:onEnter()Called when enter is pressed while the input is focussed. The input will be moved out of focus when onEnter is called.
TextInput:onTab()Called when tab is pressed while the input is focussed. The input will be moved out of focus when onTab is called.
TextInput:onFocus()Called when the input is focussed on.
TextInput:onUnFocus()Called when the input is unfocussed from.
TextInput.text - string
The text shown by the input.
TextInput.scroll - number
The current horizontal scrolling of the input.
TextInput.focussed - boolean
Whether the input is currently focussed.
TextInput.cursor - number
The cursor position of the input (0 being first character, 1 being the second).
This method is chainable.
TextInput self = TextInput:setText( string text )Sets the text of the input.
This method is chainable.
TextInput self = TextInput:setScroll( number scroll )Sets the horizontal scroll of the input.
This method is chainable.
TextInput self = TextInput:setCursor( number cursor )Sets the cursor position of the input and handles scrolling.
This method is chainable.
TextInput self = TextInput:setSelection( number position )Sets the selection position of the input.
string text or false = TextInput:getSelectedText()Returns the selected text of the input, or false if nothing is selected.
This method is chainable.
TextInput self = TextInput:write( string text )Writes text to the input, replacing selected text if necessary, and updating the cursor position.
This method is chainable.
TextInput self = TextInput:focus()Focusses on the element, invoking callbacks.
This method is chainable.
TextInput self = TextInput:unfocus()Unfocusses from the element, invoking callbacks.
- Exception
- DynamicValueException
- ExpressionException
- IncorrectConstructorException
- IncorrectParameterException
- ParserException
- ResourceLoadException
- ThreadRuntimeException