ElementDataGridRow.cpp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #include "precompiled.h"
  2. #include "ElementDataGridRow.h"
  3. #include <Rocket/Controls/ElementDataGrid.h>
  4. using Rocket::Controls::ElementDataGrid;
  5. namespace Rocket {
  6. namespace Core {
  7. namespace Lua {
  8. //getters
  9. int ElementDataGridRowGetAttrrow_expanded(lua_State* L)
  10. {
  11. ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
  12. LUACHECKOBJ(obj);
  13. lua_pushboolean(L,obj->IsRowExpanded());
  14. return 1;
  15. }
  16. int ElementDataGridRowGetAttrparent_relative_index(lua_State* L)
  17. {
  18. ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
  19. LUACHECKOBJ(obj);
  20. lua_pushinteger(L,obj->GetParentRelativeIndex());
  21. return 1;
  22. }
  23. int ElementDataGridRowGetAttrtable_relative_index(lua_State* L)
  24. {
  25. ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
  26. LUACHECKOBJ(obj);
  27. lua_pushinteger(L,obj->GetTableRelativeIndex());
  28. return 1;
  29. }
  30. int ElementDataGridRowGetAttrparent_row(lua_State* L)
  31. {
  32. ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
  33. LUACHECKOBJ(obj);
  34. LuaType<ElementDataGridRow>::push(L,obj->GetParentRow(),false);
  35. return 1;
  36. }
  37. int ElementDataGridRowGetAttrparent_grid(lua_State* L)
  38. {
  39. ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
  40. LUACHECKOBJ(obj);
  41. LuaType<ElementDataGrid>::push(L,obj->GetParentGrid(),false);
  42. return 1;
  43. }
  44. //setter
  45. int ElementDataGridRowSetAttrrow_expanded(lua_State* L)
  46. {
  47. ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
  48. LUACHECKOBJ(obj);
  49. bool expanded = CHECK_BOOL(L,2);
  50. if(expanded)
  51. obj->ExpandRow();
  52. else
  53. obj->CollapseRow();
  54. return 0;
  55. }
  56. RegType<ElementDataGridRow> ElementDataGridRowMethods[] =
  57. {
  58. { NULL, NULL },
  59. };
  60. luaL_reg ElementDataGridRowGetters[] =
  61. {
  62. LUAGETTER(ElementDataGridRow,row_expanded)
  63. LUAGETTER(ElementDataGridRow,parent_relative_index)
  64. LUAGETTER(ElementDataGridRow,table_relative_index)
  65. LUAGETTER(ElementDataGridRow,parent_row)
  66. LUAGETTER(ElementDataGridRow,parent_grid)
  67. { NULL, NULL },
  68. };
  69. luaL_reg ElementDataGridRowSetters[] =
  70. {
  71. LUASETTER(ElementDataGridRow,row_expanded)
  72. { NULL, NULL },
  73. };
  74. /*
  75. template<> const char* GetTClassName<ElementDataGridRow>() { return "ElementDataGridRow"; }
  76. template<> RegType<ElementDataGridRow>* GetMethodTable<ElementDataGridRow>() { return ElementDataGridRowMethods; }
  77. template<> luaL_reg* GetAttrTable<ElementDataGridRow>() { return ElementDataGridRowGetters; }
  78. template<> luaL_reg* SetAttrTable<ElementDataGridRow>() { return ElementDataGridRowSetters; }
  79. */
  80. }
  81. }
  82. }