From: John L. <jr...@us...> - 2006-05-15 22:57:33
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4198/wxLua/modules/wxbind/src Modified Files: dialogs.cpp wx_bind.cpp Log Message: add back wxWizard in dialogs.i Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wx_bind.cpp 13 May 2006 17:20:52 -0000 1.36 --- wx_bind.cpp 15 May 2006 22:57:30 -0000 1.37 *************** *** 388,391 **** --- 388,400 ---- #endif + + #if wxLUA_USE_wxWizard + { &wxEVT_WIZARD_CANCEL, "wxEVT_WIZARD_CANCEL", &s_wxluatag_wxWizardEvent }, + { &wxEVT_WIZARD_FINISHED, "wxEVT_WIZARD_FINISHED", &s_wxluatag_wxWizardEvent }, + { &wxEVT_WIZARD_HELP, "wxEVT_WIZARD_HELP", &s_wxluatag_wxWizardEvent }, + { &wxEVT_WIZARD_PAGE_CHANGED, "wxEVT_WIZARD_PAGE_CHANGED", &s_wxluatag_wxWizardEvent }, + { &wxEVT_WIZARD_PAGE_CHANGING, "wxEVT_WIZARD_PAGE_CHANGING", &s_wxluatag_wxWizardEvent }, + #endif + { 0, 0, 0 }, }; *************** *** 1432,1435 **** --- 1441,1449 ---- #endif + + #if wxLUA_USE_wxWizard + { "wxWIZARD_EX_HELPBUTTON", wxWIZARD_EX_HELPBUTTON }, + #endif + // -------------------------------------------------------------------- // %enum *************** *** 6104,6107 **** --- 6118,6129 ---- + #if wxLUA_USE_wxWizard + { "wxWizard", wxWizard_methods, wxWizard_methodCount, -1, CLASSINFO(wxWizard), &s_wxluatag_wxWizard, "wxDialog" }, + { "wxWizardEvent", wxWizardEvent_methods, wxWizardEvent_methodCount, -1, CLASSINFO(wxWizardEvent), &s_wxluatag_wxWizardEvent, "wxNotifyEvent" }, + { "wxWizardPage", wxWizardPage_methods, wxWizardPage_methodCount, -1, CLASSINFO(wxWizardPage), &s_wxluatag_wxWizardPage, "wxPanel" }, + { "wxWizardPageSimple", wxWizardPageSimple_methods, wxWizardPageSimple_methodCount, -1, CLASSINFO(wxWizardPageSimple), &s_wxluatag_wxWizardPageSimple, "wxWizardPage" }, + #endif + + #if wxLUA_USE_wxXMLResource { "wxXmlDocument", wxXmlDocument_methods, wxXmlDocument_methodCount, -1, NULL, &s_wxluatag_wxXmlDocument, NULL }, Index: dialogs.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/dialogs.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dialogs.cpp 14 May 2006 13:11:49 -0000 1.14 --- dialogs.cpp 15 May 2006 22:57:30 -0000 1.15 *************** *** 2448,2449 **** --- 2448,3015 ---- #endif + + #if wxLUA_USE_wxWizard + // ------------------------------------------------------------------------------------------------- + // Bind class wxWizard + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxWizard = -1; + + + #if ((wxLUA_USE_wxWizard) && (wxLUA_USE_wxBitmap)) && (wxLUA_USE_wxPointSizeRect) + // wxWizard(wxWindow* parent, int id = -1, const wxString& title = "", const wxBitmap& bitmap = wxNullBitmap, const wxPoint& pos = wxDefaultPosition, long style = wxDEFAULT_DIALOG_STYLE) + static int LUACALL wxLua_wxWizard_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWizard *returns; + // get number of arguments + int argCount = lua_gettop(L); + // long style = wxDEFAULT_DIALOG_STYLE + long style = (argCount >= 6 ? (long)wxlState.GetNumberType(6) : wxDEFAULT_DIALOG_STYLE); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 5 ? (const wxPoint *)wxlState.GetUserDataType(5, s_wxluatag_wxPoint) : &wxDefaultPosition); + // const wxBitmap bitmap = wxNullBitmap + const wxBitmap * bitmap = (argCount >= 4 ? (const wxBitmap *)wxlState.GetUserDataType(4, s_wxluatag_wxBitmap) : &wxNullBitmap); + // const wxString title = "" + const wxString title = (argCount >= 3 ? lua2wx(wxlState.GetStringType(3)) : wxString(wxEmptyString)); + // int id = -1 + int id = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : -1); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call constructor + returns = new wxWizard(parent, id, title, *bitmap, *pos, style); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxWizard, returns); + + return 1; + } + + // bool Create(wxWindow* parent, int id = -1, const wxString& title = "", const wxBitmap& bitmap = wxNullBitmap, const wxPoint& pos = wxDefaultPosition, long style = wxDEFAULT_DIALOG_STYLE) + static int LUACALL wxLua_wxWizard_Create(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // long style = wxDEFAULT_DIALOG_STYLE + long style = (argCount >= 7 ? (long)wxlState.GetNumberType(7) : wxDEFAULT_DIALOG_STYLE); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 6 ? (const wxPoint *)wxlState.GetUserDataType(6, s_wxluatag_wxPoint) : &wxDefaultPosition); + // const wxBitmap bitmap = wxNullBitmap + const wxBitmap * bitmap = (argCount >= 5 ? (const wxBitmap *)wxlState.GetUserDataType(5, s_wxluatag_wxBitmap) : &wxNullBitmap); + // const wxString title = "" + const wxString title = (argCount >= 4 ? lua2wx(wxlState.GetStringType(4)) : wxString(wxEmptyString)); + // int id = -1 + int id = (argCount >= 3 ? (int)wxlState.GetNumberType(3) : -1); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call Create + returns = self->Create(parent, id, title, *bitmap, *pos, style); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif + + + #if (wxLUA_USE_wxWizard) && (wxLUA_USE_wxPointSizeRect) + // wxSize GetPageSize() const + static int LUACALL wxLua_wxWizard_GetPageSize(lua_State *L) + { + wxLuaState wxlState(L); + wxSize *returns; + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call GetPageSize + // allocate a new object using the copy constructor + returns = new wxSize(self->GetPageSize()); + // add the new object to the tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxSize *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxSize, returns); + + return 1; + } + + // void SetPageSize(const wxSize& sizePage) + static int LUACALL wxLua_wxWizard_SetPageSize(lua_State *L) + { + wxLuaState wxlState(L); + // const wxSize sizePage + const wxSize * sizePage = (const wxSize *)wxlState.GetUserDataType(2, s_wxluatag_wxSize); + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call SetPageSize + self->SetPageSize(*sizePage); + + return 0; + } + + #endif + + + #if (wxLUA_USE_wxWizard) && (wxLUA_USE_wxSizer) + // virtual wxSizer* GetPageAreaSizer() const + static int LUACALL wxLua_wxWizard_GetPageAreaSizer(lua_State *L) + { + wxLuaState wxlState(L); + wxSizer *returns; + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call GetPageAreaSizer + returns = self->GetPageAreaSizer(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxSizer, returns); + + return 1; + } + + #endif + + // %constructor wxWizardDefault() + static int LUACALL wxLua_wxWizardDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWizard *returns; + // call constructor + returns = new wxWizard(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxWizard, returns); + + return 1; + } + + // wxWizardPage* GetCurrentPage() const + static int LUACALL wxLua_wxWizard_GetCurrentPage(lua_State *L) + { + wxLuaState wxlState(L); + wxWizardPage *returns; + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call GetCurrentPage + returns = self->GetCurrentPage(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWizardPage, returns); + + return 1; + } + + // virtual bool HasNextPage(wxWizardPage *page) + static int LUACALL wxLua_wxWizard_HasNextPage(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // wxWizardPage page + wxWizardPage * page = (wxWizardPage *)wxlState.GetUserDataType(2, s_wxluatag_wxWizardPage); + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call HasNextPage + returns = self->HasNextPage(page); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // virtual bool HasPrevPage(wxWizardPage *page) + static int LUACALL wxLua_wxWizard_HasPrevPage(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // wxWizardPage page + wxWizardPage * page = (wxWizardPage *)wxlState.GetUserDataType(2, s_wxluatag_wxWizardPage); + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call HasPrevPage + returns = self->HasPrevPage(page); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // bool RunWizard(wxWizardPage* firstPage) + static int LUACALL wxLua_wxWizard_RunWizard(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // wxWizardPage firstPage + wxWizardPage * firstPage = (wxWizardPage *)wxlState.GetUserDataType(2, s_wxluatag_wxWizardPage); + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call RunWizard + returns = self->RunWizard(firstPage); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // void SetBorder(int border) + static int LUACALL wxLua_wxWizard_SetBorder(lua_State *L) + { + wxLuaState wxlState(L); + // int border + int border = (int)wxlState.GetNumberType(2); + // get this + wxWizard * self = (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard); + // call SetBorder + self->SetBorder(border); + + return 0; + } + + static int LUACALL wxLua_wxWizard_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxWizard_methods[] = { + + #if ((wxLUA_USE_wxWizard) && (wxLUA_USE_wxBitmap)) && (wxLUA_USE_wxPointSizeRect) + { LuaConstructor, "wxWizard", wxLua_wxWizard_constructor, 6, 1, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxBitmap, &s_wxluatag_wxPoint, &s_wxluaarg_Number, 0 } }, + { LuaMethod, "Create", wxLua_wxWizard_Create, 6, 1, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxBitmap, &s_wxluatag_wxPoint, &s_wxluaarg_Number, 0 } }, + #endif + + + #if (wxLUA_USE_wxWizard) && (wxLUA_USE_wxPointSizeRect) + { LuaMethod, "GetPageSize", wxLua_wxWizard_GetPageSize, 0, 0, { 0 } }, + { LuaMethod, "SetPageSize", wxLua_wxWizard_SetPageSize, 1, 1, { &s_wxluatag_wxSize, 0 } }, + #endif + + + #if (wxLUA_USE_wxWizard) && (wxLUA_USE_wxSizer) + { LuaMethod, "GetPageAreaSizer", wxLua_wxWizard_GetPageAreaSizer, 0, 0, { 0 } }, + #endif + + { LuaConstructor, "wxWizardDefault", wxLua_wxWizardDefault_constructor, 0, 0, { 0 } }, + { LuaMethod, "GetCurrentPage", wxLua_wxWizard_GetCurrentPage, 0, 0, { 0 } }, + { LuaMethod, "HasNextPage", wxLua_wxWizard_HasNextPage, 1, 1, { &s_wxluatag_wxWizardPage, 0 } }, + { LuaMethod, "HasPrevPage", wxLua_wxWizard_HasPrevPage, 1, 1, { &s_wxluatag_wxWizardPage, 0 } }, + { LuaMethod, "RunWizard", wxLua_wxWizard_RunWizard, 1, 1, { &s_wxluatag_wxWizardPage, 0 } }, + { LuaMethod, "SetBorder", wxLua_wxWizard_SetBorder, 1, 1, { &s_wxluaarg_Number, 0 } }, + { LuaDelete, "wxWizard", wxLua_wxWizard_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxWizard_methods = s_wxWizard_methods; + int wxWizard_methodCount = sizeof(s_wxWizard_methods)/sizeof(s_wxWizard_methods[0]); + #endif + + + #if wxLUA_USE_wxWizard + // ------------------------------------------------------------------------------------------------- + // Bind class wxWizardPage + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxWizardPage = -1; + + + #if (wxLUA_USE_wxWizard) && (wxLUA_USE_wxBitmap) + // wxBitmap GetBitmap() const + static int LUACALL wxLua_wxWizardPage_GetBitmap(lua_State *L) + { + wxLuaState wxlState(L); + wxBitmap *returns; + // get this + wxWizardPage * self = (wxWizardPage *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardPage); + // call GetBitmap + // allocate a new object using the copy constructor + returns = new wxBitmap(self->GetBitmap()); + // add the new object to the tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxBitmap *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); + + return 1; + } + + #endif + + static int LUACALL wxLua_wxWizardPage_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxWizardPage_methods[] = { + + #if (wxLUA_USE_wxWizard) && (wxLUA_USE_wxBitmap) + { LuaMethod, "GetBitmap", wxLua_wxWizardPage_GetBitmap, 0, 0, { 0 } }, + #endif + + { LuaDelete, "wxWizardPage", wxLua_wxWizardPage_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxWizardPage_methods = s_wxWizardPage_methods; + int wxWizardPage_methodCount = sizeof(s_wxWizardPage_methods)/sizeof(s_wxWizardPage_methods[0]); + #endif + + + #if wxLUA_USE_wxWizard + // ------------------------------------------------------------------------------------------------- + // Bind class wxWizardPageSimple + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxWizardPageSimple = -1; + + + #if (wxLUA_USE_wxWizard) && (wxLUA_USE_wxBitmap) + // wxWizardPageSimple(wxWizard* parent = NULL, wxWizardPage* prev = NULL, wxWizardPage* next = NULL, const wxBitmap& bitmap = wxNullBitmap) + static int LUACALL wxLua_wxWizardPageSimple_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWizardPageSimple *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxBitmap bitmap = wxNullBitmap + const wxBitmap * bitmap = (argCount >= 4 ? (const wxBitmap *)wxlState.GetUserDataType(4, s_wxluatag_wxBitmap) : &wxNullBitmap); + // wxWizardPage next = NULL + wxWizardPage * next = (argCount >= 3 ? (wxWizardPage *)wxlState.GetUserDataType(3, s_wxluatag_wxWizardPage) : NULL); + // wxWizardPage prev = NULL + wxWizardPage * prev = (argCount >= 2 ? (wxWizardPage *)wxlState.GetUserDataType(2, s_wxluatag_wxWizardPage) : NULL); + // wxWizard parent = NULL + wxWizard * parent = (argCount >= 1 ? (wxWizard *)wxlState.GetUserDataType(1, s_wxluatag_wxWizard) : NULL); + // call constructor + returns = new wxWizardPageSimple(parent, prev, next, *bitmap); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxWizardPageSimple, returns); + + return 1; + } + + #endif + + // virtual wxWizardPage* GetPrev() const + static int LUACALL wxLua_wxWizardPageSimple_GetPrev(lua_State *L) + { + wxLuaState wxlState(L); + wxWizardPage *returns; + // get this + wxWizardPageSimple * self = (wxWizardPageSimple *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardPageSimple); + // call GetPrev + returns = self->GetPrev(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWizardPage, returns); + + return 1; + } + + // virtual wxWizardPage* GetNext() const + static int LUACALL wxLua_wxWizardPageSimple_GetNext(lua_State *L) + { + wxLuaState wxlState(L); + wxWizardPage *returns; + // get this + wxWizardPageSimple * self = (wxWizardPageSimple *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardPageSimple); + // call GetNext + returns = self->GetNext(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWizardPage, returns); + + return 1; + } + + // void SetPrev(wxWizardPage* prev) + static int LUACALL wxLua_wxWizardPageSimple_SetPrev(lua_State *L) + { + wxLuaState wxlState(L); + // wxWizardPage prev + wxWizardPage * prev = (wxWizardPage *)wxlState.GetUserDataType(2, s_wxluatag_wxWizardPage); + // get this + wxWizardPageSimple * self = (wxWizardPageSimple *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardPageSimple); + // call SetPrev + self->SetPrev(prev); + + return 0; + } + + // void SetNext(wxWizardPage* next) + static int LUACALL wxLua_wxWizardPageSimple_SetNext(lua_State *L) + { + wxLuaState wxlState(L); + // wxWizardPage next + wxWizardPage * next = (wxWizardPage *)wxlState.GetUserDataType(2, s_wxluatag_wxWizardPage); + // get this + wxWizardPageSimple * self = (wxWizardPageSimple *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardPageSimple); + // call SetNext + self->SetNext(next); + + return 0; + } + + // static void Chain(wxWizardPageSimple* first, wxWizardPageSimple* second) + static int LUACALL wxLua_wxWizardPageSimple_Chain(lua_State *L) + { + wxLuaState wxlState(L); + // wxWizardPageSimple second + wxWizardPageSimple * second = (wxWizardPageSimple *)wxlState.GetUserDataType(3, s_wxluatag_wxWizardPageSimple); + // wxWizardPageSimple first + wxWizardPageSimple * first = (wxWizardPageSimple *)wxlState.GetUserDataType(2, s_wxluatag_wxWizardPageSimple); + // call Chain + wxWizardPageSimple::Chain(first, second); + + return 0; + } + + static int LUACALL wxLua_wxWizardPageSimple_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxWizardPageSimple_methods[] = { + + #if (wxLUA_USE_wxWizard) && (wxLUA_USE_wxBitmap) + { LuaConstructor, "wxWizardPageSimple", wxLua_wxWizardPageSimple_constructor, 4, 0, { &s_wxluatag_wxWizard, &s_wxluatag_wxWizardPage, &s_wxluatag_wxWizardPage, &s_wxluatag_wxBitmap, 0 } }, + #endif + + { LuaMethod, "GetPrev", wxLua_wxWizardPageSimple_GetPrev, 0, 0, { 0 } }, + { LuaMethod, "GetNext", wxLua_wxWizardPageSimple_GetNext, 0, 0, { 0 } }, + { LuaMethod, "SetPrev", wxLua_wxWizardPageSimple_SetPrev, 1, 1, { &s_wxluatag_wxWizardPage, 0 } }, + { LuaMethod, "SetNext", wxLua_wxWizardPageSimple_SetNext, 1, 1, { &s_wxluatag_wxWizardPage, 0 } }, + { LuaMethod, "Chain", wxLua_wxWizardPageSimple_Chain, 2, 2, { &s_wxluatag_wxWizardPageSimple, &s_wxluatag_wxWizardPageSimple, 0 } }, + { LuaDelete, "wxWizardPageSimple", wxLua_wxWizardPageSimple_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxWizardPageSimple_methods = s_wxWizardPageSimple_methods; + int wxWizardPageSimple_methodCount = sizeof(s_wxWizardPageSimple_methods)/sizeof(s_wxWizardPageSimple_methods[0]); + #endif + + + #if wxLUA_USE_wxWizard + // ------------------------------------------------------------------------------------------------- + // Bind class wxWizardEvent + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxWizardEvent = -1; + + // wxWizardEvent(wxEventType type = wxEVT_NULL, int id = -1, bool direction = true) + static int LUACALL wxLua_wxWizardEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWizardEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // bool direction = true + bool direction = (argCount >= 3 ? wxlState.GetBooleanType(3) : true); + // int id = -1 + int id = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : -1); + // wxEventType type = wxEVT_NULL + wxEventType type = (argCount >= 1 ? (wxEventType)wxlState.GetNumberType(1) : wxEVT_NULL); + // call constructor + returns = new wxWizardEvent(type, id, direction); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxWizardEvent *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxWizardEvent, returns); + + return 1; + } + + // bool GetDirection() const + static int LUACALL wxLua_wxWizardEvent_GetDirection(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxWizardEvent * self = (wxWizardEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardEvent); + // call GetDirection + returns = self->GetDirection(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // wxWizardPage* GetPage() const + static int LUACALL wxLua_wxWizardEvent_GetPage(lua_State *L) + { + wxLuaState wxlState(L); + wxWizardPage *returns; + // get this + wxWizardEvent * self = (wxWizardEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardEvent); + // call GetPage + returns = self->GetPage(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWizardPage, returns); + + return 1; + } + + static int LUACALL wxLua_wxWizardEvent_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWizardEvent * self = (wxWizardEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardEvent); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxWizardEvent_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxWizardEvent * self = (wxWizardEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxWizardEvent); + // remove from tracked memory list + if (self != 0) + if (wxlState.RemoveTrackedMemory(self)) + { // if removed, reset the tag so that gc() is not called on this object. + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxWizardEvent_methods[] = { + { LuaConstructor, "wxWizardEvent", wxLua_wxWizardEvent_constructor, 3, 0, { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Boolean, 0 } }, + { LuaMethod, "GetDirection", wxLua_wxWizardEvent_GetDirection, 0, 0, { 0 } }, + { LuaMethod, "GetPage", wxLua_wxWizardEvent_GetPage, 0, 0, { 0 } }, + { LuaGetProp, "Direction", wxLua_wxWizardEvent_GetDirection, 0, 0, {0} }, + { LuaDelete, "wxWizardEvent", wxLua_wxWizardEvent_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxWizardEvent_Delete, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxWizardEvent_methods = s_wxWizardEvent_methods; + int wxWizardEvent_methodCount = sizeof(s_wxWizardEvent_methods)/sizeof(s_wxWizardEvent_methods[0]); + #endif + |