Class Widget.TextField

TextField Widget Module.

a widget used to allow input from a user.

Inherits from:
* Core.Widget

Style Object:
* Style.TextField

Usage:

     dUI = require 'dmc_ui'
     widget = dUI.newTextField()

Properties

.backgroundStyle () get a reference to Background Style object.
.displayStyle () get a reference to the Display Text Style object.
.hintStyle () get a reference to the Hint Text Style object.
.align () set/get align.
.delegate () set/get delegate for item.
.hintText () set/get hintText.
.inputType () get editing state for TextField.
.isEditing () get editing state for TextField.
.isHitActive () set state of touch-activity.
.isSecure () set/get password display.
.marginX () set/get marginX.
.marginY () set/get marginY.
.text () set/get input text for TextWidget.

Methods

:setEditActive (value[, params]) activate editing mode for TextField.
:setKeyboardFocus () set keyboard cursor-focus on this TextField.
:unsetKeyboardFocus () remove keyboard cursor-focus on this TextField.

Constants

Widget.TextField.INPUT_DEFAULT defines default Keyboard input type.
Widget.TextField.INPUT_DECIMAL defines decimal Keyboard input type.


Properties

.backgroundStyle ()
get a reference to Background Style object. use this reference to change properties for the Background substyle

Usage:

     style = widget.backgroundStyle
     style.anchorX = 0.5
.displayStyle ()
get a reference to the Display Text Style object. use this reference to change properties for the Text substyle

Usage:

     style = widget.displayStyle
     style.anchorX = 0.5
.hintStyle ()
get a reference to the Hint Text Style object. use this reference to change properties for the Text substyle

Usage:

     style = widget.hintStyle
     style.anchorX = 0.5
.align ()
set/get align. values are 'left', 'center', 'right'

Usage:

  • widget.align = 'center'
  • print( widget.align )
.delegate ()
set/get delegate for item.

Usage:

  • widget.delegate = <delegate object>
  • print( widget.delegate )
.hintText ()
set/get hintText. set the text when the "hint" is visible.

Usage:

  • widget.hintText = "Enter an email"
  • print( widget.hintText )
.inputType ()
get editing state for TextField. returns true if the TextField is currently displaying the input field.

Returns:

    string

Usage:

  • widget.inputType = o.INPUT_EMAIL
  • print( widget.inputType )
.isEditing ()
get editing state for TextField. returns true if the TextField is currently displaying the input field.

Returns:

    bool

Usage:

    print( widget.isEditing )
.isHitActive ()
set state of touch-activity. set true if the TextField editing is enabled.

Usage:

    widget.isHitActive = true
.isSecure ()
set/get password display. set to true to change TextField to mask the text entered.

Usage:

  • widget.isSecure = true
  • print( widget.isSecure )
.marginX ()
set/get marginX. set the margin inset of the widget. this value is subtracted from the widget width.

Usage:

  • widget.marginX = 18
  • print( widget.marginX )
.marginY ()
set/get marginY. set the margin inset of the widget. this value is subtracted from the widget width.

Usage:

  • widget.marginY = 18
  • print( widget.marginY )
.text ()
set/get input text for TextWidget.

Usage:

  • widget.text = "input field text"
  • print( widget.text )

Methods

:setEditActive (value[, params])
activate editing mode for TextField.

Parameters:

  • value bool true if
  • params table of optional parameters
    • setFocus bool set focus on the text field (default true)

Usage:

    widget:setEditActive( true, { setFocus=true })
:setKeyboardFocus ()
set keyboard cursor-focus on this TextField. this will show the keyboard.

Usage:

    widget:setKeyboardFocus()
:unsetKeyboardFocus ()
remove keyboard cursor-focus on this TextField. this will hide the keyboard.

Constants

Widget.TextField.INPUT_DEFAULT
defines default Keyboard input type. set input type using styles (inline, style, or direct)

Usage:

    widget.style.inputType = widget.INPUT_DEFAULT
Widget.TextField.INPUT_DECIMAL
defines decimal Keyboard input type. set input type using styles (inline, style, or direct)

Usage:

    widget.style.inputType = widget.INPUT_DECIMAL
generated by LDoc 1.4.3 Last updated 2015-05-14 11:55:05