Access keys

ComboBox

Kind of class: class
Inherits from: EventMovieClip < MovieClip
Implements:
Author: Martijn de Visser
Classpath: org.asapframework.ui.combobox.ComboBox
File last modified: Tuesday, 03 October 2006, 09:43:53
ComboBox class to create ComboBox UI elements with.
To do:
Implement removal of items

Constructor

ComboBox

function ComboBox (
)
DropDown class

Instance properties

direction

direction
(read,write)
Sets / gets the drop direction. Values are: "up", "down" or "auto"

duration

duration
(write)
Setsthe duration of the dropdown animation (default 10)

itemClass

itemClass
(read,write)
Sets / gets the LinkageID to use for dropdown items. Default is "DropDownItem".

itemHeight

itemHeight
(read,write)
Sets / gets the item height (default 18)

label

label
(write)
Sets the inital label, shown if no items are selected

length

length:Number
(read)
Gets the length of the drop-down list.

open

open:Boolean
(read)

rowCount

rowCount
(read,write)
Sets / gets the the number of items to display in list

selectedIndex

selectedIndex
(read,write)
GETTER / SETTER *

selectedItem

selectedItem:Object
(read)
Gets the selected item, returns an object { label, data }

textFormat

textFormat
(write)
Sets the TextFormat of the label

value

value:Object
(read)
Gets the value of currently selected item (data field by default, or label if no data is available).

Instance methods

addItem

function addItem (
inItem:Object) : Void
PUBLIC

addItemAt

function addItemAt (
inItem:Object, inPosition:Number) : Void
adds an item to the dropdown list at a specific position. See addItem for details.

clear

function clear (
) : Void
Clears contents of the ComboBox

getEnabled

function getEnabled (
) : Boolean
Gets the enabled state of the DropDown

getItemAt

function getItemAt (
inIndex:Number) : Object
Retrieves the item at a specified index.
Parameters:
index:
The index of the item to retrieve. The index must be a number greater than or equal to 0, and less than the value of ComboBox.length.
Returns:
The indexed item object as { data, label }.

getScrollPosition

function getScrollPosition (
) : Number
ISCROLLABLE IMPLEMENTATION *

getTotalHeight

function getTotalHeight (
) : Number
IScrollable implementation: Returns the height of all content

getValue

function getValue (
) : Object
Gets the value of currently selected item (data field by default, or label if no data is available).

getVisibleHeight

function getVisibleHeight (
) : Number
IScrollable implementation: Returns the height of the visible content

hide

function hide (
inAnim:Boolean) : Void
Closes the dropdown
Parameters:
inAnim:
, boolean, set to false to *skip* dropdown animation

scrollTo

function scrollTo (
inPos:Number) : Void
IScrollable implementation: Scrolls the content list up or down

setEnabled

function setEnabled (
inValue:Boolean) : Void
Sets the enabled state of the DropDown

show

function show (
inAnim:Boolean) : Void
Opens the dropdown
Parameters:
inAnim:
, boolean, set to false to *skip* dropdown animaition

toString

function toString (
) : String

Event handlers

onButtonClicked

function onButtonClicked (
Fired by arrow

onItemClicked

function onItemClicked (
EVENTS *

onMouseDown

function onMouseDown (
) : Void
Catch global onMouseDown event to close when clicking elsewhere

onMouseUp

function onMouseUp (
) : Void
Catch global onMouseUp event to close when clicking elsewhere, after dragging off the dropdown

onMouseWheel

function onMouseWheel (
inDelta:Number) : Void
Catches onMouseWheel event and passes it to the ScrollBar

onScrollContent

function onScrollContent (
e:ScrollEvent) : Void
IScrollable implementation: Scrolls the content list up or down