StringInput |
A one line text input field with an optional label. The data entry area is indicated with a stippled line.
| StringInput | A one line text input field with an optional label. |
| public static constants | |
| DEFAULT_LABEL_WIDTH | Default width of the optional label in pixels |
| DEFAULT_INPUT_WIDTH | Default width of the input text field in pixels |
| defaultColor | Default color of the text in the field and the label |
| defaultFontSize | A medium default size for the font. |
| Private data members | |
| input | Internal text field used to display and edit the data. |
| callback | Callback function called when the text in the field has been changed or when the refresh method is called. |
| Constructor | |
| StringInput | Creates a one line input text field with an optional label. |
| Public properties | |
| text | Returns the text string in the field. |
| text | Changes the text displayed in the field. |
| Public methods | |
| refresh | Activates the change callback associated with the field if one has been set. |
| Event handlers | |
| inputChangeHandler | The text in the input field has been changed. |
| WidgetInterface | |
| active | Sets the state of the widget to active or inactive. |
| activate | Activates the widget, adds its event listeners |
| disactivate | Disactivates the widget, removes its event listeners |
| dispose | Dispose of all resources used or referenced in the instance. |
| destructor | Removes used resources, references and graphics |
private var callback: Function
Callback function called when the text in the field has been changed or when the refresh method is called.
public function StringInput( owner: String, labelText: String = null, inputText: String = "", changeHandler: Function = null, labelWidth: uint = DEFAULT_LABEL_WIDTH, inputWidth: uint = DEFAULT_INPUT_WIDTH, color: uint = defaultColor, fontSize: uint = defaultFontSize )
Creates a one line input text field with an optional label.
| owner | name of registered owner; see WidgetSprite.register |
| labelText | text to use as a label for the field (default null for no label) |
| inputText | initial text displayed in the field (default “” for empty) |
| changeHandler | callback to be activated on changes and refresh (default null) |
| labelWidth | width of the label (default 80 pixels) |
| inputWidth | width of the field (default 70 pixels) |
| color | base theme color for the field text and label (default MediumGrey) |
| fontSize | size of the font used (default 10) |
| changeHandler | function onStringInputChange(text:String):void |
Default width of the optional label in pixels
public static const DEFAULT_LABEL_WIDTH: uint
Default width of the input text field in pixels
public static const DEFAULT_INPUT_WIDTH: uint
Default color of the text in the field and the label
public static const defaultColor: int
A medium default size for the font.
public static const defaultFontSize: int
Internal text field used to display and edit the data.
private var input: TextField
Callback function called when the text in the field has been changed or when the refresh method is called.
private var callback: Function
Activates the change callback associated with the field if one has been set.
public function refresh():void
Creates a one line input text field with an optional label.
public function StringInput( owner: String, labelText: String = null, inputText: String = "", changeHandler: Function = null, labelWidth: uint = DEFAULT_LABEL_WIDTH, inputWidth: uint = DEFAULT_INPUT_WIDTH, color: uint = defaultColor, fontSize: uint = defaultFontSize )
Returns the text string in the field.
public function get text():String
The text in the input field has been changed.
private function inputChangeHandler( event: Event ):void
Sets the state of the widget to active or inactive.
public function set active( state: Boolean ):void
Activates the widget, adds its event listeners
private function activate():void
Disactivates the widget, removes its event listeners
private function disactivate():void
Dispose of all resources used or referenced in the instance.
public function dispose():void
Removes used resources, references and graphics
private function destructor():void
Register the owner of a widget.
public function register( owner: String ):void