IntegerInput |
An integer number input field with an optional label and optional auto-repeating stepper buttons. The data entry area is indicated with a stippled line.
IntegerInput | An integer number input field with an optional label and optional auto-repeating stepper buttons. |
public static constants | |
DEFAULT_LABEL_WIDTH | Default width of the optional label in pixels |
DEFAULT_INPUT_WIDTH | Default width of the numeric input field in pixels |
defaultColor | Default color of the text in the field and the label |
defaultFontSize | A medium default size for the font. |
defaultStepperSize | Stepper size, each stepper is square |
Private data members | |
input | Internal text field used to display and edit the data. |
plusButton | Small stepper/spin button for incrementing the value in the field. |
minusButton | Small stepper/spin button for decrementing the value in the field. |
callback | Callback function called when the field has been changed. |
stepColor | Base theme color of the stepper buttons |
Public properties | |
step | Step size used when incrementing/decrementing |
minimum | The smallest value that the field will be decremented to. |
maximum | The largest value that the field will be incremented to. |
Constructor | |
IntegerInput | Creates an integer number input field with an optional label and optional auto-repeating stepper buttons. |
Public properties | |
value | Get the integer value from the field. |
value | Change the field to a new integer value. |
Event handlers | |
increment | Increments the field value when the user clicks or auto-repeats the up stepper button by keeping it pressed. |
decrement | Decrements the field value when the user clicks or auto-repeats the down stepper button by keeping it pressed. |
inputChangeHandler | Triggers a set change callback when 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 |
public function IntegerInput( owner: String, labelText: String = null, inputValue: int = 0, changeHandler: Function = null, useStepper: Boolean = true, stepperColor: uint = Color.Grey, labelWidth: uint = DEFAULT_LABEL_WIDTH, inputWidth: uint = DEFAULT_INPUT_WIDTH, color: uint = defaultColor, fontSize: uint = defaultFontSize )
Creates an integer number input field with an optional label and optional auto-repeating stepper buttons.
owner | name of registered owner; see WidgetSprite.register |
labelText | text to use as a label for the field (default null for no label) |
inputValue | initial integer value (default 0) |
changeHandler | function called when the field value changes (default null) |
useStepper | displays an up/down stepper if true (default true) |
stepperColor | base theme color for the number stepper (default Grey) |
labelWidth | width of the label (default 80 pixels) |
inputWidth | width of the field (default 70 pixels) |
color | base theme color for the field font and label (default MediumGrey) |
fontSize | size of the font used (default 10) |
changeHandler | function onIntegerInputChange(value:int):void |
Default width of the optional label in pixels
public static const DEFAULT_LABEL_WIDTH: uint
Default width of the numeric input 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
Stepper size, each stepper is square
public static const defaultStepperSize: int
Internal text field used to display and edit the data.
private var input: TextField
Small stepper/spin button for incrementing the value in the field.
private var plusButton: ShapeButton
Small stepper/spin button for decrementing the value in the field.
private var minusButton: ShapeButton
Callback function called when the field has been changed.
private var callback: Function
Base theme color of the stepper buttons
private var stepColor: uint
Step size used when incrementing/decrementing
public var step: Number
The smallest value that the field will be decremented to.
public var minimum: Number
The largest value that the field will be incremented to.
public var maximum: Number
Creates an integer number input field with an optional label and optional auto-repeating stepper buttons.
public function IntegerInput( owner: String, labelText: String = null, inputValue: int = 0, changeHandler: Function = null, useStepper: Boolean = true, stepperColor: uint = Color.Grey, labelWidth: uint = DEFAULT_LABEL_WIDTH, inputWidth: uint = DEFAULT_INPUT_WIDTH, color: uint = defaultColor, fontSize: uint = defaultFontSize )
Get the integer value from the field.
public function get value():int
Increments the field value when the user clicks or auto-repeats the up stepper button by keeping it pressed.
private function increment():void
Decrements the field value when the user clicks or auto-repeats the down stepper button by keeping it pressed.
private function decrement():void
Triggers a set change callback when 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