DropDownList.pkg 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. $#include "UI/DropDownList.h"
  2. class DropDownList : public Menu
  3. {
  4. DropDownList();
  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. tolua_readonly tolua_property__get_set unsigned numItems;
  25. tolua_property__get_set unsigned selection;
  26. tolua_readonly tolua_property__get_set UIElement* selectedItem;
  27. tolua_readonly tolua_property__get_set ListView* listView;
  28. tolua_readonly tolua_property__get_set UIElement* placeholder;
  29. tolua_property__get_set String placeholderText;
  30. tolua_property__get_set bool resizePopup;
  31. };
  32. ${
  33. #define TOLUA_DISABLE_tolua_UILuaAPI_DropDownList_new00
  34. static int tolua_UILuaAPI_DropDownList_new00(lua_State* tolua_S)
  35. {
  36. return ToluaNewObject<DropDownList>(tolua_S);
  37. }
  38. #define TOLUA_DISABLE_tolua_UILuaAPI_DropDownList_new00_local
  39. static int tolua_UILuaAPI_DropDownList_new00_local(lua_State* tolua_S)
  40. {
  41. return ToluaNewObjectGC<DropDownList>(tolua_S);
  42. }
  43. static const PODVector<UIElement*>& DropDownListGetItems(const DropDownList* list)
  44. {
  45. static PODVector<UIElement*> items;
  46. items = list->GetItems();
  47. return items;
  48. }
  49. $}