Back
CreateTextAreaOutline
Creates an outlined material textarea.
Example - No Label
cfg.Light
cfg.MUI
function OnStart()
{
color = MUI.colors.teal
app.InitializeUIKit(color.teal)
lay = MUI.CreateLayout("Linear", "VCenter,FillXY")
tef = MUI.CreateTextAreaOutline(0.8, 0.2, "Type your name")
lay.AddChild(tef)
app.AddLayout(lay)
}
Example - With Label
cfg.Light
cfg.MUI
function OnStart()
{
color = MUI.colors.teal
app.InitializeUIKit(color.teal)
lay = MUI.CreateLayout("Linear", "VCenter,FillXY")
tef = MUI.CreateTextAreaOutline(0.8, 0.2, "Type your name", true)
lay.AddChild(tef)
app.AddLayout(lay)
}
Example - SetOnEnter Callback
cfg.Dark
cfg.MUI
function OnStart()
{
color = MUI.colors.teal
app.InitializeUIKit(color.teal)
lay = MUI.CreateLayout("Linear", "VCenter,FillXY")
MUI.CreateTextAreaOutline(0.8, 0.2, "Type your name", true)
tef.SetOnEnter(OnEnter)
lay.AddChild(tef)
app.AddLayout(lay)
}
function OnEnter()
{
app.ShowPopup(this.GetText())
}
Methods
The following methods are available on the TextAreaOutline object:
Boolean: Show or hide label
app object
Number
String
Number: fraction (0..1)
Number: integer
String:
hexadecimal: “#rrggbb”, “#aarrggbb”
colourName: “red”, “green”, ...
String: “Hint” or “Label text”
String: “px” or “sp” or “dip” or “mm” or “pt”
String: “px”
function()
tao.ClearFocus
Removes the focus of the control so that the user no longer has immediate access to it.
tao.ClearHistory
Clear input history
tao.Focus
Set the focus to the control so that the user can interact with it immediately.
tao.GetCursorLine
Get cursor line
tao.GetCursorPos
Get cursor position
tao.GetSelectedText
Get selected text
tao.GetSelectionEnd
Get selection end
tao.GetSelectionStart
Get selection start
tao.GetText
Returns the current displayed text of the control.
tao.GetType
Get the type of MUI control.
tao.GetVisibility
Returns the current visibility state of the control. The Values are:
Show: visible
Hide: invisible but still consuming space
Gone: invisible and not consuming space
tao.Gone
Hides the control without consuming any more layout space as if it were never there.
tao.InsertText
Inserts a string at a given position.
tao.IsEnabled
Returns whether the control is currently useable by the user.
tao.IsOverlap
Returns whether the control overlaps with another by a given distance.
tao.IsVisible
Returns whether the control is currently visible to the user, ignoring overlaying controls.
tao.Redo
Redo an undone action.
tao.ReplaceText
Replaces a given range in the text with some string.
tao.SetCursorPos
Change the curernt cursor position.
tao.SetMargins
Define a distance to other controls on each side of the control.
tao.SetOnChange
Called when the containing data has been changed by the user.
tao.SetOnEnter
Define a callback function which is called when the user pressed 'Done' or 'Enter' on the keyboard
tao.SetPosition
Defines the position and size for the control if the parent is an absolute layout.
tao.SetText
Change the currently displayed text in the control.
tao.Undo
Undo an action