SelectOptionsProxy.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. /*
  3. Proxy table for ElementFormControlSelect.options
  4. read-only, key must be a number
  5. Each object in this proxy is a table with two items:
  6. Element element and String value
  7. Usage:
  8. ElementFormControlSelect.options[2].element or ElementFormControlSelect.options[2].value
  9. OR, as usual you can store the object in a variable like
  10. local opt = ElementFormControlSelect.options
  11. opt[2].element or opt[2].value
  12. and you can store the returned table as a variable, of course
  13. local item = opt[2]
  14. item.element or item.value
  15. */
  16. #include <Rocket/Core/Lua/lua.hpp>
  17. #include <Rocket/Core/Lua/LuaType.h>
  18. #include <Rocket/Controls/ElementFormControlSelect.h>
  19. namespace Rocket {
  20. namespace Core {
  21. namespace Lua {
  22. //where owner is the ElementFormControlSelect that we should look up information from
  23. struct SelectOptionsProxy { Rocket::Controls::ElementFormControlSelect* owner; };
  24. template<> void LuaType<SelectOptionsProxy>::extra_init(lua_State* L, int metatable_index);
  25. int SelectOptionsProxy__index(lua_State* L);
  26. //method
  27. int SelectOptionsProxyGetTable(lua_State* L, SelectOptionsProxy* obj);
  28. RegType<SelectOptionsProxy> SelectOptionsProxyMethods[];
  29. luaL_reg SelectOptionsProxyGetters[];
  30. luaL_reg SelectOptionsProxySetters[];
  31. }
  32. }
  33. }