A button that exposes a list of choices and displays the chosen item.

Constructor

new (?parent:DisplayObjectContainer, ?xpos:Float, ?ypos:Float, ?defaultLabel:String, ?items:Array<ListItem>)

Constructor

Parameters:

parent

The parent DisplayObjectContainer on which to add this List.

xpos

The x position to place this component.

ypos

The y position to place this component.

defaultLabel

The label to show when no item is selected.

items

An array of items to display in the list. Either strings or objects with label property.

Variables

alternateColor:UInt

Sets / gets the color for alternate rows if alternateRows is set_to true.

alternateRows:Bool

Sets / gets whether or not every other row will be colored with the alternate color.

autoHideScrollBar:Bool

Sets / gets whether the scrollbar will auto hide when there is nothing to scroll.

defaultColor:UInt

Sets/gets the default background color of list items.

defaultLabel:String

Sets / gets the label that will be shown if no item is selected.

read onlyisOpen:Bool

Gets whether or not the combo box is currently open.

items:Array<Dynamic>

Sets / gets the list of items to be shown.

listItemHeight:Float

Sets the height of each list item.

numVisibleItems:Int

Sets / gets the number of visible items in the drop down list. i.e. the height of the list.

openPosition:String

Sets / gets the position the list will open on: top or bottom.

rolloverColor:UInt

Sets/gets the rollover background color of list items.

selectedColor:UInt

Sets/gets the selected background color of list items.

selectedIndex:Int

Sets / gets the index of the selected list item.

selectedItem:Dynamic

Sets / gets the item in the list, if it exists.

Methods

addItem (item:Dynamic):Void

Adds an item to the list.

Parameters:

item

The item to add. Can be a string or an object containing a string property named label.

addItemAt (item:Dynamic, index:Int):Void

Adds an item to the list at the specified index.

Parameters:

item

The item to add. Can be a string or an object containing a string property named label.

index

The index at which to add the item.

get_isOpen ():Bool

get_items ():Array<Dynamic>

get_selectedItem ():Dynamic

removeAll ():Void

Removes all items from the list.

removeItem (item:Dynamic):Void

Removes the referenced item from the list.

Parameters:

item

The item to remove. If a string, must match the item containing that string. If an object, must be a reference to the exact same object.

removeItemAt (index:Int):Void

Removes the item from the list at the specified index

Parameters:

index

The index of the item to remove.

set_alternateColor (value:UInt):UInt

set_alternateRows (value:Bool):Bool

set_autoHideScrollBar (value:Bool):Bool

set_defaultColor (value:UInt):UInt

set_defaultLabel (value:String):String

set_items (value:Array<Dynamic>):Array<Dynamic>

set_listItemClass (value:Class<ListItem>):Void

Sets / gets the class used to render list items. Must extend ListItem.

set_listItemHeight (value:Float):Float

set_numVisibleItems (value:Int):Int

set_openPosition (value:String):String

set_rolloverColor (value:UInt):UInt

set_selectedColor (value:UInt):UInt

set_selectedIndex (value:Int):Int

set_selectedItem (item:Dynamic):Dynamic

Static variables

staticinline read onlyBOTTOM:String

staticinline read onlyTOP:String

Inherited Variables

Defined by Component

enabled:Bool

Sets/gets whether this component is enabled or not.

tag:Int

Sets/gets in integer that can identify the component.

Inherited Methods

Defined by Component

get_enabled ():Bool

get_height ():Float

get_tag ():Int

get_width ():Float

move (xpos:Float, ypos:Float):Void

Moves the component to the specified position.

Parameters:

xpos

the x position to move the component

ypos

the y position to move the component

setSize (w:Float, h:Float):Void

Sets the size of the component.

Parameters:

w

The width of the component.

h

The height of the component.

set_enabled (value:Bool):Bool

set_height (value:Float):Void

Sets/gets the height of the component.

set_tag (value:Int):Int

set_width (value:Float):Void

Sets/gets the width of the component.

set_x (value:Float):Void

Overrides the setter for x to always place the component on a whole pixel.

set_y (value:Float):Void

Overrides the setter for y to always place the component on a whole pixel.