| Package | qnx.ui.listClasses |
| Class | public class RoundList |
| Inheritance | RoundList List UIComponent flash.display.MovieClip |
| Implements | IDataViewer |
RoundList class allows you to display cells in a scrolling vertical list. The round list has no scroll bar, and continues to
scroll from the beginning once the final cell has been reached.
See also
| Method | Defined By | ||
|---|---|---|---|
Creates a RoundList instance. | RoundList | ||
![]() | addItem(item:Object):void
Appends an item to the end of the list. | List | |
![]() | addItemAt(item:Object, index:int):void
Adds an item to the list at the specified index. | List | |
![]() | addItemsAt(items:Array, index:int):void
Adds an array item at the specified index. | List | |
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | drawNow():void
Calls the draw() method. | UIComponent | |
![]() | getIsCellVisibleAtIndex(index:int):Boolean
Returns a Boolean indicating whether or not a cell at a given index is visible in the virtual area. | List | |
![]() | getItemAt(index:int):Object
Returns the item in the DataProvider at the specified index. | List | |
![]() | invalidate(property:String, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first. | UIComponent | |
![]() | removeAll():void
Removes all the items from the list. | List | |
![]() | removeItem(item:Object):void
Removes a given item from the list. | List | |
![]() | removeItemAt(index:int):void
Removes an item from list at the specified index. | List | |
![]() | replaceItem(item:Object, oldObject:Object):void
Replaces an item, given the new item object and the old item. | List | |
![]() | replaceItemAt(item:Object, index:int):void
Replaces the item in the list at the specified index with a new item. | List | |
![]() | scrollIndexVisible(index:int, seconds:Number = 1):void
Scrolls a given item into view, given an index and an animation duration (in seconds). | List | |
![]() | scrollToIndex(index:int, seconds:Number = 1):void
Animates the cell at the specified index into view. | List | |
![]() | setPosition(x:Number, y:Number):void
Sets the x and y position of the component. | UIComponent | |
![]() | setSize(w:Number, h:Number):void
Sets the width and height of the component. | UIComponent | |
![]() | setSkin(skin:Object):void
Sets the cell renderer to use to populate the list. | List | |
![]() | updateItem(value:Object, oldObject:Object):void
Updates an item in the list, given the new item and the item to update. | List | |
![]() | updateItemAt(item:Object, index:int):void
Updates the item in the list at the specified index, given the new item. | List | |
![]() | updateItemsAt(items:Array, index:int):void
Updates the items starting at the specified index with new items. | List | |
| RoundList | () | Constructor |
public function RoundList()
Creates a RoundList instance.
In the following example, a RoundList class is instantiated and initialized:
package
{
import flash.display.Sprite;
import qnx.ui.data.DataProvider;
import qnx.ui.events.ListEvent;
import qnx.ui.listClasses.RoundList;
import qnx.ui.listClasses.ListSelectionMode;
[SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
public class RoundListSample extends Sprite
{
public function RoundListSample()
{
initializeUI();
}
private function initializeUI():void
{
var arrMonth:Array=[];
// add objects with a label property
arrMonth.push({label: "Bananas"});
arrMonth.push({label: "Apples"});
arrMonth.push({label: "Bacon"});
arrMonth.push({label: "Hot dogs"});
arrMonth.push({label: "Celery"});
var myList:RoundList = new RoundList();
myList.setPosition(100, 100);
myList.width = 200;
myList.height = 200;
myList.topOffSet = 3;
//set the dataProvider
myList.selectionMode = ListSelectionMode.SINGLE;
myList.dataProvider = new DataProvider(arrMonth);
myList.addEventListener(ListEvent.ITEM_CLICKED, onListClick);
this.addChild(myList);
}
private function onListClick(event:ListEvent):void {
trace("Item clicked: " + event.data.label);
trace("Index clicked: " + event.index);
}
}
}