ElementFormControl.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #include "precompiled.h"
  2. #include "ElementFormControl.h"
  3. #include <Rocket/Controls/ElementFormControl.h>
  4. #include <Rocket/Core/Element.h>
  5. namespace Rocket {
  6. namespace Core {
  7. namespace Lua {
  8. //getters
  9. int ElementFormControlGetAttrdisabled(lua_State* L)
  10. {
  11. ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
  12. LUACHECKOBJ(efc);
  13. lua_pushboolean(L,efc->IsDisabled());
  14. return 1;
  15. }
  16. int ElementFormControlGetAttrname(lua_State* L)
  17. {
  18. ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
  19. LUACHECKOBJ(efc);
  20. lua_pushstring(L,efc->GetName().CString());
  21. return 1;
  22. }
  23. int ElementFormControlGetAttrvalue(lua_State* L)
  24. {
  25. ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
  26. LUACHECKOBJ(efc);
  27. lua_pushstring(L,efc->GetValue().CString());
  28. return 1;
  29. }
  30. //setters
  31. int ElementFormControlSetAttrdisabled(lua_State* L)
  32. {
  33. ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
  34. LUACHECKOBJ(efc);
  35. efc->SetDisabled(CHECK_BOOL(L,2));
  36. return 0;
  37. }
  38. int ElementFormControlSetAttrname(lua_State* L)
  39. {
  40. ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
  41. LUACHECKOBJ(efc);
  42. const char* name = luaL_checkstring(L,2);
  43. efc->SetName(name);
  44. return 0;
  45. }
  46. int ElementFormControlSetAttrvalue(lua_State* L)
  47. {
  48. ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
  49. LUACHECKOBJ(efc);
  50. const char* value = luaL_checkstring(L,2);
  51. efc->SetValue(value);
  52. return 0;
  53. }
  54. RegType<ElementFormControl> ElementFormControlMethods[] =
  55. {
  56. { NULL, NULL },
  57. };
  58. luaL_reg ElementFormControlGetters[] =
  59. {
  60. LUAGETTER(ElementFormControl,disabled)
  61. LUAGETTER(ElementFormControl,name)
  62. LUAGETTER(ElementFormControl,value)
  63. { NULL, NULL },
  64. };
  65. luaL_reg ElementFormControlSetters[] =
  66. {
  67. LUASETTER(ElementFormControl,disabled)
  68. LUASETTER(ElementFormControl,name)
  69. LUASETTER(ElementFormControl,value)
  70. { NULL, NULL },
  71. };
  72. }
  73. }
  74. }