Skip to content
Marcus Mascord edited this page Jul 15, 2014 · 9 revisions

The input widget allows the user to enter text into a text field.

The attributes for the Input widget are:

Attribute Type Description
m Widget The main Widget Class.
text Text Widget This points to the Text widget this is where the font, fontsize etc for this input widget is defined.
multiline Boolean If this is set to true the text is multiline input, otherwise it is single line input. The default is single line input.
numberCharacterLimit Integer If null, no limit exists. Maximum number of characters that are allowed in the input.
action Function Function that is called when the user taps enter. The signature for this function is function(Input Widget, Text Value Entered)
scrollLeftRight Boolean If this is set to true it is possible for the user to scroll the text left and right. The default is false.
scrollUpDown Boolean If this is set to true it is possible for the user to scroll the text up and down. The default is true.
maxWidth Integer If scrollLeftRight equals true, then it is possible to set the maximum width. The default is m.w.
s WidgetStyle The style of the widget.
label Text Widget This is a placeholder label that is shown when the input it is empty. When this set to null, no placeholder label is shown. The default is null.
editable Boolean When this is set to true the input is editable. When it is set to false it is not editable. The default is true.
password Boolean When this is set to true this becomes a password input widget and "*" are shown instead of the characters being entered. The default is false.
passwordText String Stores the actual password text. The text attribute will contain the "*" characters.
kineticScrollingEnabled Boolean Set to true to enable kinetic scrolling. The default is true.
calculateHeightAuto Boolean Set to true to calculate the height of the input text automatically. The default is false.
closeEditOnEnter Boolean If set to true, the edit will be closed on enter otherwise the edit input will remain. The default is true.
editMode Boolean When set to true the input is being edited currently by the user.

XML Input Widget Example

This is an example of the Input Widget written in XML:

<Widget>
    <Id>NameInput</Id>
    <Class>Input</Class>
    <Y>90</Y>
    <H>30</H>
    <W>80%</W>
    <L>100</L>
    <Div>main</Div>
    <AlignHoz>CENTER</AlignHoz>
    <InputText>
        <Widget>
             <Class>Text</Class>
             <Style>
                 <Colour>#000000</Colour>
             </Style>
             <Font>Arial</Font>
             <FontSize>14</FontSize>
             <AlignVert>CENTER</AlignVert>
        </Widget>
   </InputText>
   <Style>
        <Colour>#FFFFFF</Colour>
        <BorderColour>#000000</BorderColour>
        <BorderW>1</BorderW>
   </Style>
</Widget>

The above example on the screen is:

Clone this wiki locally