Module flower.widget.ListBox
It is a class that displays multiple items.
You can choose to scroll through the items.
Extends:
Info:
- Release: V3.0.0
- Author: Makoto
Functions
ListBox:_initInternal () | Initialize a variables |
ListBox:_initEventListeners () | Initialize the event listeners. |
ListBox:_createChildren () | Create the children. |
ListBox:_createScrollBar () | Create the scrollBar |
ListBox:_updateRowCount () | Update the rowCount |
ListBox:_updateListItems () | Update the ListItems |
ListBox:_createListItem (index) | Create the ListItem. |
ListBox:_deleteListItem (index) | Delete the ListItem. |
ListBox:_clearListItems () | Clears the ListItems. |
ListBox:_updateScrollBar () | Update the scroll bar. |
ListBox:_updateHeightByRowCount () | Update the height by rowCount. |
ListBox:updateDisplay () | Update the display. |
ListBox:updatePriority (priority) | Update the priority. |
ListBox:setListData (listData) | Sets the list data. |
ListBox:getListData () | Returns the list data. |
ListBox:getListSize () | Returns the list size. |
ListBox:getListItems () | Returns the ListItems. |
ListBox:getListItemAt (index) | Returns the ListItem. |
ListBox:setListItemFactory (factory) | Sets the ListItemFactory. |
ListBox:getListItemFactory () | Returns the ListItemFactory. |
ListBox:setSelectedIndex (index) | Sets the selectedIndex. |
ListBox:getSelectedIndex () | Returns the selectedIndex. |
ListBox:getSelectedRowIndex () | Returns the selected row index. |
ListBox:getSelectedColumnIndex () | Returns the selected row index. |
ListBox:setSelectedItem (item) | Set the selected item. |
ListBox:setScrollBarVisible (visible) | Set the scrollBar visible. |
ListBox:getSelectedItem () | Return the selected item. |
ListBox:setLabelField (labelField) | Set the labelField. |
ListBox:getLabelField () | Return the labelField. |
ListBox:setVerticalScrollPosition (pos) | Set the verticalScrollPosition. |
ListBox:getVerticalScrollPosition () | Return the verticalScrollPosition. |
ListBox:getMaxVerticalScrollPosition () | Return the maxVerticalScrollPosition. |
ListBox:setRowHeight (rowHeight) | Set the height of the row. |
ListBox:getRowHeight () | Return the height of the row. |
ListBox:setRowCount (rowCount) | Set the count of the rows. |
ListBox:getRowCount () | Return the count of the rows. |
ListBox:setColumnCount (columnCount) | Set the count of the columns. |
ListBox:getColumnCount () | Return the count of the columns. |
ListBox:isTouching () | Returns true if the component has been touched. |
ListBox:setScrollBarTexture (texture) | Set the texture path of the scroll bar. |
ListBox:setOnItemChanged (func) | Set the event listener that is called when the user item changed. |
ListBox:setOnItemEnter (func) | Set the event listener that is called when the user item changed. |
ListBox:setOnItemClick (func) | Set the event listener that is called when the user item changed. |
ListBox:findListItemByPos (x, y) | TODO:Doc |
ListBox:onFocusIn (e) | This event handler is called when focus in. |
ListBox:onFocusOut (e) | This event handler is called when focus in. |
ListBox:onTouchDown (e) | This event handler is called when touch. |
ListBox:onTouchUp (e) | This event handler is called when touch. |
ListBox:onTouchMove (e) | This event handler is called when touch. |
ListBox:onTouchCancel (e) | This event handler is called when touch. |
ListBox:onKeyDown (e) | This event handler is called when key down. |
ListBox:onKeyUp (e) | This event handler is called when key up. |
Fields
STYLE_LIST_ITEM_FACTORY | Style: listItemFactory |
STYLE_ROW_HEIGHT | Style: rowHeight |
STYLE_SCROLL_BAR_TEXTURE | Style: scrollBarTexture |
EVENT_ITEM_CHANGED | Event: itemChanged |
EVENT_ITEM_ENTER | Event: itemEnter |
EVENT_ITEM_CLICK | Event: itemClick |
Functions
- ListBox:_initInternal ()
- Initialize a variables
- ListBox:_initEventListeners ()
- Initialize the event listeners.
- ListBox:_createChildren ()
- Create the children.
- ListBox:_createScrollBar ()
- Create the scrollBar
- ListBox:_updateRowCount ()
- Update the rowCount
- ListBox:_updateListItems ()
- Update the ListItems
- ListBox:_createListItem (index)
-
Create the ListItem.
Parameters:
- index index of the listItems
Returns:
-
listItem
- ListBox:_deleteListItem (index)
-
Delete the ListItem.
Parameters:
- index index of the listItems
- ListBox:_clearListItems ()
- Clears the ListItems.
- ListBox:_updateScrollBar ()
- Update the scroll bar.
- ListBox:_updateHeightByRowCount ()
- Update the height by rowCount.
- ListBox:updateDisplay ()
- Update the display.
- ListBox:updatePriority (priority)
-
Update the priority.
Parameters:
- priority priority
Returns:
-
last priority
- ListBox:setListData (listData)
-
Sets the list data.
Parameters:
- listData listData
- ListBox:getListData ()
-
Returns the list data.
Returns:
-
listData
- ListBox:getListSize ()
-
Returns the list size.
Returns:
-
size
- ListBox:getListItems ()
-
Returns the ListItems.
Care must be taken to use the ListItems.
ListItems is used to cache internally rotate.
Therefore, ListItems should not be accessed from outside too.
Returns:
-
listItems
- ListBox:getListItemAt (index)
-
Returns the ListItem.
Parameters:
- index index of the listItems
Returns:
-
listItem
- ListBox:setListItemFactory (factory)
-
Sets the ListItemFactory.
Parameters:
- factory ListItemFactory
- ListBox:getListItemFactory ()
-
Returns the ListItemFactory.
Returns:
-
ListItemFactory
- ListBox:setSelectedIndex (index)
-
Sets the selectedIndex.
Parameters:
- index selectedIndex
- ListBox:getSelectedIndex ()
-
Returns the selectedIndex.
Returns:
-
selectedIndex
- ListBox:getSelectedRowIndex ()
-
Returns the selected row index.
Returns:
-
selected row index
- ListBox:getSelectedColumnIndex ()
-
Returns the selected row index.
Returns:
-
selected row index
- ListBox:setSelectedItem (item)
-
Set the selected item.
Parameters:
- item selected item
- ListBox:setScrollBarVisible (visible)
-
Set the scrollBar visible.
Parameters:
- visible scrollBar visible
- ListBox:getSelectedItem ()
-
Return the selected item.
Returns:
-
selected item
- ListBox:setLabelField (labelField)
-
Set the labelField.
Parameters:
- labelField labelField
- ListBox:getLabelField ()
-
Return the labelField.
Returns:
-
labelField
- ListBox:setVerticalScrollPosition (pos)
-
Set the verticalScrollPosition.
Parameters:
- pos verticalScrollPosition
- ListBox:getVerticalScrollPosition ()
-
Return the verticalScrollPosition.
Returns:
-
verticalScrollPosition
- ListBox:getMaxVerticalScrollPosition ()
-
Return the maxVerticalScrollPosition.
Returns:
-
maxVerticalScrollPosition
- ListBox:setRowHeight (rowHeight)
-
Set the height of the row.
Parameters:
- rowHeight height of the row
- ListBox:getRowHeight ()
-
Return the height of the row.
Returns:
-
rowHeight
- ListBox:setRowCount (rowCount)
-
Set the count of the rows.
Parameters:
- rowCount count of the rows
- ListBox:getRowCount ()
-
Return the count of the rows.
Returns:
-
rowCount
- ListBox:setColumnCount (columnCount)
-
Set the count of the columns.
Parameters:
- columnCount count of the columns
- ListBox:getColumnCount ()
-
Return the count of the columns.
Returns:
-
columnCount
- ListBox:isTouching ()
-
Returns true if the component has been touched.
Returns:
-
touching
- ListBox:setScrollBarTexture (texture)
-
Set the texture path of the scroll bar.
Needs to be NinePatch.
Parameters:
- texture texture path.
- ListBox:setOnItemChanged (func)
-
Set the event listener that is called when the user item changed.
Parameters:
- func event handler
- ListBox:setOnItemEnter (func)
-
Set the event listener that is called when the user item changed.
Parameters:
- func event handler
- ListBox:setOnItemClick (func)
-
Set the event listener that is called when the user item changed.
Parameters:
- func event handler
- ListBox:findListItemByPos (x, y)
-
TODO:Doc
Parameters:
- x
- y
- ListBox:onFocusIn (e)
-
This event handler is called when focus in.
Parameters:
- e event
- ListBox:onFocusOut (e)
-
This event handler is called when focus in.
Parameters:
- e event
- ListBox:onTouchDown (e)
-
This event handler is called when touch.
Parameters:
- e Touch Event
- ListBox:onTouchUp (e)
-
This event handler is called when touch.
Parameters:
- e Touch Event
- ListBox:onTouchMove (e)
-
This event handler is called when touch.
Parameters:
- e Touch Event
- ListBox:onTouchCancel (e)
-
This event handler is called when touch.
Parameters:
- e Touch Event
- ListBox:onKeyDown (e)
-
This event handler is called when key down.
Parameters:
- e event
- ListBox:onKeyUp (e)
-
This event handler is called when key up.
Parameters:
- e event