SelectOptionsProxy.h 1.3 KB

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