Back

CreateTESearchUnique

Hello World
Content:
- Methods

Creates a unique text input.

tes = MUI.CreateTESearchUnique( width, hint, icon, iconColor ) → Object

Example - Search

cfg.Light
cfg.MUI

function OnStart()
{
    color = MUI.colors.teal
    app.InitializeUIKit(color.teal)

    lay = MUI.CreateLayout("Linear", "VCenter,FillXY")

        tef = MUI.CreateTESearchUnique(0.8, "Search for music", "search")
        lay.AddChild(tef)

    app.AddLayout(lay)
}
Copy All       Run      

Example - Dark

cfg.Dark
cfg.MUI

function OnStart()
{
    color = MUI.colors.teal
    app.InitializeUIKit(color.teal)

    lay = MUI.CreateLayout("Linear", "VCenter,FillXY")

        tef = MUI.CreateTESearchUnique(0.8, "Search for music", "search")
        lay.AddChild(tef)

    app.AddLayout(lay)
}
Copy All       Run      

Methods

The following methods are available on the TESearchUnique 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()
app object
Number
String
Number: fraction (0..1)
Number: integer
String:
  hexadecimal: “#rrggbb”, “#aarrggbb”
  colourName: “red”, “green”, ...
String: “Hint text”
String: “Material icon font”
String: “px” or “sp” or “dip” or “mm” or “pt”
String: “px”
function()
tes.ClearFocus
Removes the focus of the control so that the user no longer has immediate access to it.
tes.ClearHistory
Clear input history
tes.Focus
Set the focus to the control so that the user can interact with it immediately.
tes.GetCursorLine
Get cursor line
tes.GetCursorPos
Get cursor position
tes.GetSelectedText
Get selected text
tes.GetSelectionEnd
Get selection end
tes.GetSelectionStart
Get selection start
tes.GetText
Returns the current displayed text of the control.
tes.GetType
Get the type of MUI control.
tes.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
tes.Gone
Hides the control without consuming any more layout space as if it were never there.
tes.InsertText
Inserts a string at a given position.
tes.IsEnabled
Returns whether the control is currently useable by the user.
tes.IsOverlap
Returns whether the control overlaps with another by a given distance.
tes.IsVisible
Returns whether the control is currently visible to the user, ignoring overlaying controls.
tes.Redo
Redo an undone action.
tes.ReplaceText
Replaces a given range in the text with some string.
tes.SetCursorPos
Change the curernt cursor position.
tes.SetMargins
Define a distance to other controls on each side of the control.
tes.SetOnChange
Called when the containing data has been changed by the user.
tes.SetOnEnter
Define a callback function which is called when the user pressed 'Done' or 'Enter' on the keyboard
tes.SetOnIconTouch
Calls a function when icon is touch
tes.SetPosition
Defines the position and size for the control if the parent is an absolute layout.
tes.SetText
Change the currently displayed text in the control.
tes.Undo
Undo an action