| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- $#include "ListView.h"
- enum HighlightMode
- {
- HM_NEVER,
- HM_FOCUS,
- HM_ALWAYS
- };
- class ListView : public ScrollView
- {
- ListView(Context* context);
- virtual ~ListView();
-
- void AddItem(UIElement* item);
-
- void InsertItem(unsigned index, UIElement* item, UIElement* parentItem = 0);
- void RemoveItem(UIElement* item, unsigned index = 0);
-
- void RemoveItem(unsigned index);
- void RemoveAllItems();
- void SetSelection(unsigned index);
- void AddSelection(unsigned index);
- void RemoveSelection(unsigned index);
- void ToggleSelection(unsigned index);
-
- void ChangeSelection(int delta, bool additive = false);
- void ClearSelection();
- void SetHighlightMode(HighlightMode mode);
- void SetMultiselect(bool enable);
- void SetHierarchyMode(bool enable);
- void SetBaseIndent(int baseIndent);
- void SetClearSelectionOnDefocus(bool enable);
- void Expand(unsigned index, bool enable, bool recursive = false);
- void ToggleExpand(unsigned index, bool recursive = false);
-
- unsigned GetNumItems() const;
- UIElement* GetItem(unsigned index) const;
- unsigned FindItem(UIElement* item) const;
- unsigned GetSelection() const;
- UIElement* GetSelectedItem() const;
- bool IsSelected(unsigned index) const;
- bool IsExpanded(unsigned index) const;
- HighlightMode GetHighlightMode() const;
- bool GetMultiselect() const;
- bool GetClearSelectionOnDefocus() const;
- bool GetHierarchyMode() const;
- int GetBaseIndent() const;
- tolua_readonly tolua_property__get_set unsigned numItems;
- tolua_property__get_set unsigned selection;
- tolua_readonly tolua_property__get_set UIElement* selectedItem;
- tolua_property__get_set HighlightMode highlightMode;
- tolua_property__get_set bool multiselect;
- tolua_property__get_set bool clearSelectionOnDefocus;
- tolua_property__get_set bool hierarchyMode;
- tolua_property__get_set int baseIndent;
- };
|