Back

CreateTextEditUnique

Hello World
Content:
- Methods

Creates a unique textedit customization.

teu = MUI.CreateTextEditUnique( width, hint, icon, iconCOlor ) → Object

Example - Unique Text Input

cfg.Light
cfg.MUI

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

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

        tef = MUI.CreateTextEditUnique(0.8, "Left", "Search for something")
        lay.AddChild(tef)

    app.AddLayout(lay)
}
Copy All       Run      

Methods

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