A scrolling list of selectable items.

Constructor

new (?parent:DisplayObjectContainer, ?xpos:Float, ?ypos:Float, ?items:Array<Dynamic>)

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.

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.

items:Array<Dynamic>

Sets / gets the list of items to be shown.

listItemClass:Class<ListItem>

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

listItemHeight:Float

Sets the height of each list item.

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.

TODO: Rework selected item

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.

draw ():Void

Draws the visual ui of the component.

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_items (value:Array<Dynamic>):Array<Dynamic>

set_listItemClass (value:Class<ListItem>):Class<ListItem>

set_listItemHeight (value:Float):Float

set_rolloverColor (value:UInt):UInt

set_selectedColor (value:UInt):UInt

set_selectedIndex (value:Int):Int

set_selectedItem (item:Dynamic):Dynamic

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.