Back

CreateTextEditOutline

Hello World
Content:
- Methods

Creates an outlined material text input.

teo = MUI.CreateTextEditOutline( width, options, 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.CreateTextEditOutline(0.8, "Left", "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.CreateTextEditOutline(0.8, "Left", "Username", 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")

        tef = MUI.CreateTextEditOutline(0.8, "Left", "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 TextEditOutline 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: “Comma separated DS TextEdit options with additional 'Round' option.”
String: “Hint” or “Label text”
String: “px” or “sp” or “dip” or “mm” or “pt”
String: “px”
function()
teo.ClearFocus
Removes the focus of the control so that the user no longer has immediate access to it.
teo.ClearHistory
Clear input history
teo.Focus
Set the focus to the control so that the user can interact with it immediately.
teo.GetCursorLine
Get cursor line
teo.GetCursorPos
Get cursor position
teo.GetSelectedText
Get selected text
teo.GetSelectionEnd
Get selection end
teo.GetSelectionStart
Get selection start
teo.GetText
Returns the current displayed text of the control.
teo.GetType
Get the type of MUI control.
teo.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
teo.Gone
Hides the control without consuming any more layout space as if it were never there.
teo.InsertText
Inserts a string at a given position.
teo.IsEnabled
Returns whether the control is currently useable by the user.
teo.IsOverlap
Returns whether the control overlaps with another by a given distance.
teo.IsVisible
Returns whether the control is currently visible to the user, ignoring overlaying controls.
teo.Redo
Redo an undone action.
teo.ReplaceText
Replaces a given range in the text with some string.
teo.SetCursorPos
Change the curernt cursor position.
teo.SetMargins
Define a distance to other controls on each side of the control.
teo.SetOnChange
Called when the containing data has been changed by the user.
teo.SetOnEnter
Define a callback function which is called when the user pressed 'Done' or 'Enter' on the keyboard
teo.SetOnTouch
Define a callback function that is called when the user touches the control.
teo.SetPosition
Defines the position and size for the control if the parent is an absolute layout.
teo.SetText
Change the currently displayed text in the control.
teo.Undo
Undo an action