Used for a scrolling lists of items. Replaces the list control.
Class: ControlList(x, y, width, height[, font, textColor, buttonTexture, buttonFocusTexture,
/// selectedColor, imageWidth, imageHeight, itemTextXOffset, itemTextYOffset,
/// itemHeight, space, alignmentY, shadowColor])
The list container is one of several containers used to display items from file lists in various ways. The list container is very flexible - it's only restriction is that it is a list - i.e. a single column or row of items. The layout of the items is very flexible and is up to the skinner.
x | integer - x coordinate of control. | ||||||||||||||||||||||||
y | integer - y coordinate of control. | ||||||||||||||||||||||||
width | integer - width of control. | ||||||||||||||||||||||||
height | integer - height of control. | ||||||||||||||||||||||||
font | [opt] string - font used for items label. (e.g. 'font13') | ||||||||||||||||||||||||
textColor | [opt] hexstring - color of items label. (e.g. '0xFFFFFFFF') | ||||||||||||||||||||||||
buttonTexture | [opt] string - filename for focus texture. | ||||||||||||||||||||||||
buttonFocusTexture | [opt] string - filename for no focus texture. | ||||||||||||||||||||||||
selectedColor | [opt] integer - x offset of label. | ||||||||||||||||||||||||
imageWidth | [opt] integer - width of items icon or thumbnail. | ||||||||||||||||||||||||
imageHeight | [opt] integer - height of items icon or thumbnail. | ||||||||||||||||||||||||
itemTextXOffset | [opt] integer - x offset of items label. | ||||||||||||||||||||||||
itemTextYOffset | [opt] integer - y offset of items label. | ||||||||||||||||||||||||
itemHeight | [opt] integer - height of items. | ||||||||||||||||||||||||
space | [opt] integer - space between items. | ||||||||||||||||||||||||
alignmentY | [opt] integer - Y-axis alignment of items label
| ||||||||||||||||||||||||
shadowColor | [opt] hexstring - color of items label's shadow. (e.g. '0xFF000000') |
Example:
addItem | ( | ... | ) |
Function: addItem(item)
item | string, unicode or ListItem - item to add. |
Example:
addItems | ( | ... | ) |
Function: addItems(items)
items | List - list of strings, unicode objects or ListItems to add. |
Large lists benefit considerably, than using the standard addItem()
Example:
selectItem | ( | ... | ) |
Function: selectItem(item)
item | integer - index number of the item to select. |
Example:
removeItem | ( | ... | ) |
Function: removeItem(index)
index | integer - index number of the item to remove. |
Example:
reset | ( | ) |
Function: reset()
reset()
will destroy any ListItem
objects in the ControlList
if not hold by any other class. Make sure you you don't call addItems()
with the previous ListItem
references after calling reset()
. If you need to preserve the ListItem
objects after reset()
make sure you store them as members of your WindowXML
class (see examples).Examples:
The below example shows you how you can reset the ControlList
but this time avoiding ListItem
object destruction. The example assumes self
as a WindowXMLDialog
instance containing a ControlList
with id = 800. The class preserves the ListItem
objects in a class member variable.
getSpinControl | ( | ) |
Function: getSpinControl()
Example:
getSelectedPosition | ( | ) |
Function: getSelectedPosition()
Example:
getSelectedItem | ( | ) |
Function: getSelectedItem()
Example:
setImageDimensions | ( | ... | ) |
Function: setImageDimensions(imageWidth, imageHeight)
imageWidth | [opt] integer - width of items icon or thumbnail. |
imageHeight | [opt] integer - height of items icon or thumbnail. |
Example:
setSpace | ( | ... | ) |
Function: setSpace(space)
space | [opt] integer - space between items. |
Example:
setPageControlVisible | ( | ... | ) |
Function: setPageControlVisible(visible)
visible | boolean - True=visible / False=hidden. |
Example:
size | ( | ) |
Function: size()
Example:
getItemHeight | ( | ) |
Function: getItemHeight()
Example:
getSpace | ( | ) |
Function: getSpace()
Example:
getListItem | ( | ... | ) |
Function: getListItem(index)
index | integer - index number of item to return. |
ValueError | if index is out of range. |
Example:
setStaticContent | ( | ... | ) |
Function: setStaticContent(items)
items | List - list of listitems to add. |
Example: