ElementFormControlSelect.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. /*
  3. This defines the ElementFormControlSelect type in the Lua global namespace, for this documentation will be
  4. named EFCSelect
  5. It has one extra method than the Python api, which is GetOption
  6. //methods
  7. int EFCSelect:Add(string rml, string value, [int before]) --where 'before' is optional, and is an index
  8. noreturn EFCSelect:Remove(int index)
  9. {"element"=Element,"value"=string} EFCSelect:GetOption(int index) --this is a more efficient way to get an option if you know the index beforehand
  10. //getters
  11. {[int index]={"element"=Element,"value"=string}} EFCSelect.options --used to access options as a Lua table. Comparatively expensive operation, use GetOption when
  12. --you only need one option and you know the index
  13. int EFCSelect.selection
  14. //setter
  15. EFCSelect.selection = int
  16. */
  17. #include <Rocket/Core/Lua/lua.hpp>
  18. #include <Rocket/Core/Lua/LuaType.h>
  19. #include <Rocket/Controls/ElementFormControlSelect.h>
  20. using Rocket::Controls::ElementFormControlSelect;
  21. namespace Rocket {
  22. namespace Core {
  23. namespace Lua {
  24. //inherits from ElementFormControl which inherits from Element
  25. template<> void LuaType<ElementFormControlSelect>::extra_init(lua_State* L, int metatable_index);
  26. //methods
  27. int ElementFormControlSelectAdd(lua_State* L, ElementFormControlSelect* obj);
  28. int ElementFormControlSelectRemove(lua_State* L, ElementFormControlSelect* obj);
  29. int ElementFormControlSelectGetOption(lua_State* L, ElementFormControlSelect* obj);
  30. //getters
  31. int ElementFormControlSelectGetAttroptions(lua_State* L);
  32. int ElementFormControlSelectGetAttrselection(lua_State* L);
  33. //setter
  34. int ElementFormControlSelectSetAttrselection(lua_State* L);
  35. RegType<ElementFormControlSelect> ElementFormControlSelectMethods[];
  36. luaL_reg ElementFormControlSelectGetters[];
  37. luaL_reg ElementFormControlSelectSetters[];
  38. /*
  39. template<> const char* GetTClassName<ElementFormControlSelect>();
  40. template<> RegType<ElementFormControlSelect>* GetMethodTable<ElementFormControlSelect>();
  41. template<> luaL_reg* GetAttrTable<ElementFormControlSelect>();
  42. template<> luaL_reg* SetAttrTable<ElementFormControlSelect>();
  43. */
  44. }
  45. }
  46. }