|
NXWidgets
1.19
|
#include <clistdata.hxx>
Public Member Functions | |
| CListData (void) | |
| virtual | ~CListData (void) |
| virtual void | addItem (const CNxString &text, const uint32_t value) |
| virtual void | addItem (CListDataItem *item) |
| virtual void | removeItem (const int index) |
| virtual void | selectItem (const int index) |
| virtual void | deselectItem (const int index) |
| virtual void | removeAllItems (void) |
| virtual const int | getSelectedIndex (void) const |
| virtual void | setSelectedIndex (const int index) |
| virtual const CListDataItem * | getSelectedItem (void) const |
| virtual void | setAllowMultipleSelections (const bool allowMultipleSelections) |
| virtual const CListDataItem * | getItem (const int index) const |
| virtual void | sort (void) |
| virtual const int | getItemCount (void) const |
| virtual void | selectAllItems (void) |
| virtual void | deselectAllItems (void) |
| virtual void | setItemSelected (const int index, const bool selected) |
| virtual const bool | allowsMultipleSelections (void) const |
| virtual void | setSortInsertedItems (const bool sortInsertedItems) |
| void | addListDataEventHandler (IListDataEventHandler *eventHandler) |
| void | removeListDataEventHandler (IListDataEventHandler *eventHandler) |
Protected Member Functions | |
| virtual void | quickSort (const int start, const int end) |
| virtual void | swapItems (const int index1, const int index2) |
| const int | getSortedInsertionIndex (const CListDataItem *item) const |
| void | raiseDataChangedEvent (void) |
| void | raiseSelectionChangedEvent (void) |
Protected Attributes | |
| TNxArray< CListDataItem * > | m_items |
| TNxArray< IListDataEventHandler * > | m_listDataEventhandlers |
| bool | m_allowMultipleSelections |
| bool | m_sortInsertedItems |
Class representing a list of items. Designed to be used by the CListBox class, etc, to store its data. Fires events to notify listeners when the list changes or a new selection is made.
Definition at line 107 of file clistdata.hxx.
| CListData::CListData | ( | void | ) |
Constructor.
Definition at line 97 of file clistdata.cxx.
|
virtual |
Destructor.
Definition at line 107 of file clistdata.cxx.
|
virtual |
Add a new item.
| text | Text to show in the option. |
| value | The value of the option. |
Definition at line 119 of file clistdata.cxx.
|
virtual |
Add an existing item. CListData becomes the owner of the option and will delete it when the list is deleted.
| item | The item to add. |
Definition at line 133 of file clistdata.cxx.
|
inline |
Add an event handler.
| eventHandler | The event handler to add. |
Definition at line 341 of file clistdata.hxx.
|
inlinevirtual |
Returns whether multiple selections are possible or not.
Definition at line 318 of file clistdata.hxx.
|
virtual |
Deselect all items.
Definition at line 299 of file clistdata.cxx.
|
virtual |
Deselect an item by its index.
| index | The index of the item to select. |
Definition at line 193 of file clistdata.cxx.
|
inlinevirtual |
|
inlinevirtual |
Get the total number of items.
Definition at line 284 of file clistdata.hxx.
|
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.
Definition at line 222 of file clistdata.cxx.
|
virtual |
Get the selected item. Returns NULL if nothing is selected.
Definition at line 255 of file clistdata.cxx.
|
protected |
Return the index that an item should be inserted at to maintain a sorted list of data.
| item | The item to insert. |
Definition at line 423 of file clistdata.cxx.
|
protectedvirtual |
Quick sort the items using their compareTo() methods.
| start | The index to start sorting at. |
| end | The index to stop sorting at. |
Definition at line 365 of file clistdata.cxx.
|
protected |
Raise a data changed event.
Definition at line 440 of file clistdata.cxx.
|
protected |
Raise a selection changed event.
Definition at line 454 of file clistdata.cxx.
|
virtual |
Remove all items.
Definition at line 202 of file clistdata.cxx.
|
virtual |
Remove an item by its index.
| index | The index of the option to remove. |
Definition at line 159 of file clistdata.cxx.
| void CListData::removeListDataEventHandler | ( | IListDataEventHandler * | eventHandler | ) |
Remove an event handler.
| eventHandler | The event handler to remove. |
Definition at line 346 of file clistdata.cxx.
|
virtual |
Select all items. Does nothing if the list does not allow multiple selections.
Definition at line 282 of file clistdata.cxx.
|
virtual |
Select an item by its index.
| index | The index of the item to select. |
Definition at line 182 of file clistdata.cxx.
|
inlinevirtual |
Sets whether multiple selections are possible or not.
| allowMultipleSelections | True to allow multiple selections. |
Definition at line 249 of file clistdata.hxx.
|
virtual |
Select or deselect an item by its index. Does not deselect any other selected items. Set index to -1 to select nothing.
| index | The index of the item to select. |
| selected | True to select the item, false to deselect it. |
Definition at line 317 of file clistdata.cxx.
|
virtual |
Sets the selected index. Specify -1 to select nothing. Resets any other selected items to deselected.
| index | The selected index. |
Definition at line 244 of file clistdata.cxx.
|
inlinevirtual |
Sets whether or not items added to the list are automatically sorted on insert or not.
| sortInsertedItems | True to enable sort on insertion. |
Definition at line 330 of file clistdata.hxx.
|
virtual |
Sort the items using their compareTo() methods.
Definition at line 271 of file clistdata.cxx.
|
protectedvirtual |
Swap the locations of two items in the array.
| index1 | The index of the first item to swap. |
| index2 | The index of the second item to swap. |
Definition at line 409 of file clistdata.cxx.
|
protected |
If true, multiple options can be selected.
Definition at line 112 of file clistdata.hxx.
|
protected |
Collection of list data items.
Definition at line 110 of file clistdata.hxx.
|
protected |
Collection of event handlers.
Definition at line 111 of file clistdata.hxx.
|
protected |
Automatically sorts items on insertion if true.
Definition at line 114 of file clistdata.hxx.
1.8.13