Back

CreateTextAreaOutline

Hello World
Content:
- Methods

Creates an outlined material textarea.

tao = MUI.CreateTextAreaOutline( width, height, hint, label, color, backColor ) → Object

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)
}
Copy All       Run      

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)
}
Copy All       Run      

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())
}
Copy All       Run      

Methods

The following methods are available on the TextAreaOutline object:

Focus()
GetCursorLine() → Number
GetText() → String
GetType() → String
GetVisibility() → String: “Show” or “Hide” or “Gone”
Gone()
IsEnabled() → Boolean
IsOverlap( obj, depth ) → Boolean
IsVisible() → Boolean
Redo()
Undo()
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