WoopsiUI::ListData Class Reference
#include <listdata.h>
List of all members.
Detailed Description
Class representing a data item within a list.
Constructor & Destructor Documentation
ListData::~ListData |
( |
|
) |
[virtual] |
Member Function Documentation
void ListData::addItem |
( |
const char * |
text, |
|
|
const u32 |
value, |
|
|
const u16 |
normalTextColour, |
|
|
const u16 |
normalBackColour, |
|
|
const u16 |
selectedTextColour, |
|
|
const u16 |
selectedBackColour | |
|
) |
| | [virtual] |
Add a new item.
- Parameters:
-
| text | Text to show in the option. |
| value | The value of the option. |
| normalTextColour | Colour to draw the text with when not selected. |
| normalBackColour | Colour to draw the background with when not selected. |
| selectedTextColour | Colour to draw the text with when selected. |
| selectedBackColour | Colour to draw the background with when selected. |
Add an event handler.
- Parameters:
-
| eventHandler | The event handler to add. |
virtual const bool WoopsiUI::ListData::allowsMultipleSelections |
( |
|
) |
const [inline, virtual] |
Returns whether multiple selections are possible or not.
- Returns:
- True if multiple selections are allowed.
void ListData::deselectAllItems |
( |
|
) |
[virtual] |
void ListData::deselectItem |
( |
const s32 |
index |
) |
[virtual] |
Select an item by its index. Does not deselect any other selected items.
- Parameters:
-
| index | The index of the item to select. |
const s32 ListData::getInsertionIndex |
( |
const char * |
text |
) |
const [protected] |
Return the index that an item with the supplied text should be inserted at to maintain a sorted list of data.
- Parameters:
-
| text | The text of the item. |
- Returns:
- The index that the item should be imserted into at.
virtual ListDataItem* WoopsiUI::ListData::getItem |
( |
const s32 |
index |
) |
[inline, virtual] |
Get the specified item.
- Returns:
- The specified item.
virtual const s32 WoopsiUI::ListData::getItemCount |
( |
|
) |
const [inline, virtual] |
Get the total number of items.
- Returns:
- The number of items.
const s32 ListData::getSelectedIndex |
( |
|
) |
const [virtual] |
Get the selected index. Returns -1 if nothing is selected. If more than one item is selected, the index of the first selected item is returned.
- Returns:
- The selected index.
Get the selected item. Returns NULL if nothing is selected.
- Returns:
- The selected option.
void ListData::quickSort |
( |
const s32 |
start, |
|
|
const s32 |
end | |
|
) |
| | [protected, virtual] |
Quick sort the items alphabetically by the text of the items.
- Parameters:
-
| start | The index to start sorting at. |
| end | The index to stop sorting at. |
void ListData::raiseDataChangedEvent |
( |
|
) |
[protected] |
Raise a data changed event.
void ListData::raiseSelectionChangedEvent |
( |
|
) |
[protected] |
Raise a selection changed event.
void ListData::removeAllItems |
( |
|
) |
[virtual] |
void ListData::removeItem |
( |
const s32 |
index |
) |
[virtual] |
Remove an item by its index..
- Parameters:
-
| index | The index of the option to remove. |
Remove an event handler.
- Parameters:
-
| eventHandler | The event handler to remove. |
void ListData::selectAllItems |
( |
|
) |
[virtual] |
Select all items. Does nothing if the list does not allow multiple selections.
void ListData::selectItem |
( |
const s32 |
index |
) |
[virtual] |
Select an item by its index. Does not deselect any other selected items.
- Parameters:
-
| index | The index of the item to select. |
virtual void WoopsiUI::ListData::setAllowMultipleSelections |
( |
const bool |
allowMultipleSelections |
) |
[inline, virtual] |
Sets whether multiple selections are possible or not.
- Parameters:
-
| allowMultipleSelections | True to allow multiple selections. |
void ListData::setItemSelected |
( |
const s32 |
index, |
|
|
const bool |
selected | |
|
) |
| | [virtual] |
Select or deselect an item by its index. Does not deselect any other selected items. Set index to -1 to select nothing.
- Parameters:
-
| index | The index of the item to select. |
| selected | True to select the item, false to deselect it. |
void ListData::setSelectedIndex |
( |
const s32 |
index |
) |
[virtual] |
Sets the selected index. Specify -1 to select nothing. Resets any other selected items to deselected.
- Parameters:
-
| index | The selected index. |
virtual void WoopsiUI::ListData::setSortInsertedItems |
( |
const bool |
sortInsertedItems |
) |
[inline, virtual] |
Sets whether or not items added to the list are automatically sorted on insert or not.
- Parameters:
-
| sortInsertedItems | True to enable sort on insertion. |
void ListData::sort |
( |
|
) |
[virtual] |
Sort the items alphabetically by the text of the items.
void ListData::swapItems |
( |
const s32 |
index1, |
|
|
const s32 |
index2 | |
|
) |
| | [protected, virtual] |
Swap the locations of two items in the array.
- Parameters:
-
| index1 | The index of the first item to swap. |
| index2 | The index of the second item to swap. |
Member Data Documentation
If true, multiple options can be selected.
Collection of list data items.
Collection of event handlers.
Automatically sorts items on insertion if true.
The documentation for this class was generated from the following files:
- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/listdata.h
- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/listdata.cpp