DropDownList.pkg 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. $#include "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. 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. #define TOLUA_DISABLE_tolua_UILuaAPI_DropDownList_new00
  35. static int tolua_UILuaAPI_DropDownList_new00(lua_State* tolua_S)
  36. {
  37. return ToluaNewObject<DropDownList>(tolua_S);
  38. }
  39. #define TOLUA_DISABLE_tolua_UILuaAPI_DropDownList_new00_local
  40. static int tolua_UILuaAPI_DropDownList_new00_local(lua_State* tolua_S)
  41. {
  42. return ToluaNewObjectGC<DropDownList>(tolua_S);
  43. }
  44. static const PODVector<UIElement*>& DropDownListGetItems(const DropDownList* list)
  45. {
  46. static PODVector<UIElement*> items;
  47. items = list->GetItems();
  48. return items;
  49. }
  50. $}