DropDownList.pkg 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. $#include "DropDownList.h"
  2. class DropDownList : public Menu
  3. {
  4. DropDownList(Context* context);
  5. ~DropDownList();
  6. void AddItem(UIElement* item);
  7. void InsertItem(unsigned index, UIElement* item);
  8. void RemoveItem(UIElement* item);
  9. void RemoveItem(unsigned index);
  10. void RemoveAllItems();
  11. void SetSelection(unsigned index);
  12. void SetPlaceholderText(const String text);
  13. void SetResizePopup(bool enable);
  14. unsigned GetNumItems() const;
  15. UIElement* GetItem(unsigned index) const;
  16. // PODVector<UIElement*> GetItems() const;
  17. tolua_outside const PODVector<UIElement*>& DropDownListGetItems @ GetItems() const;
  18. unsigned GetSelection() const;
  19. UIElement* GetSelectedItem() const;
  20. ListView* GetListView() const;
  21. UIElement* GetPlaceholder() const;
  22. const String GetPlaceholderText() const;
  23. bool GetResizePopup() const;
  24. void SetSelectionAttr(unsigned index);
  25. tolua_readonly tolua_property__get_set unsigned numItems;
  26. tolua_property__get_set unsigned selection;
  27. tolua_readonly tolua_property__get_set UIElement* selectedItem;
  28. tolua_readonly tolua_property__get_set ListView* listView;
  29. tolua_readonly tolua_property__get_set UIElement* placeholder;
  30. tolua_property__get_set String& placeholderText;
  31. tolua_property__get_set bool resizePopup;
  32. };
  33. ${
  34. static const PODVector<UIElement*>& DropDownListGetItems(const DropDownList* list)
  35. {
  36. static PODVector<UIElement*> items;
  37. items = list->GetItems();
  38. return items;
  39. }
  40. $}