ListView.pkg 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. $#include "ListView.h"
  2. enum HighlightMode
  3. {
  4. HM_NEVER,
  5. HM_FOCUS,
  6. HM_ALWAYS
  7. };
  8. class ListView : public ScrollView
  9. {
  10. ListView(Context* context);
  11. virtual ~ListView();
  12. void AddItem(UIElement* item);
  13. void InsertItem(unsigned index, UIElement* item, UIElement* parentItem = 0);
  14. void RemoveItem(UIElement* item, unsigned index = 0);
  15. void RemoveItem(unsigned index);
  16. void RemoveAllItems();
  17. void SetSelection(unsigned index);
  18. void AddSelection(unsigned index);
  19. void RemoveSelection(unsigned index);
  20. void ToggleSelection(unsigned index);
  21. void ChangeSelection(int delta, bool additive = false);
  22. void ClearSelection();
  23. void SetHighlightMode(HighlightMode mode);
  24. void SetMultiselect(bool enable);
  25. void SetHierarchyMode(bool enable);
  26. void SetBaseIndent(int baseIndent);
  27. void SetClearSelectionOnDefocus(bool enable);
  28. void Expand(unsigned index, bool enable, bool recursive = false);
  29. void ToggleExpand(unsigned index, bool recursive = false);
  30. unsigned GetNumItems() const;
  31. UIElement* GetItem(unsigned index) const;
  32. unsigned FindItem(UIElement* item) const;
  33. unsigned GetSelection() const;
  34. UIElement* GetSelectedItem() const;
  35. bool IsSelected(unsigned index) const;
  36. bool IsExpanded(unsigned index) const;
  37. HighlightMode GetHighlightMode() const;
  38. bool GetMultiselect() const;
  39. bool GetClearSelectionOnDefocus() const;
  40. bool GetHierarchyMode() const;
  41. int GetBaseIndent() const;
  42. tolua_readonly tolua_property__get_set unsigned numItems;
  43. tolua_property__get_set unsigned selection;
  44. tolua_readonly tolua_property__get_set UIElement* selectedItem;
  45. tolua_property__get_set HighlightMode highlightMode;
  46. tolua_property__get_set bool multiselect;
  47. tolua_property__get_set bool clearSelectionOnDefocus;
  48. tolua_property__get_set bool hierarchyMode;
  49. tolua_property__get_set int baseIndent;
  50. };