From: John L. <jr...@us...> - 2006-05-16 04:55:36
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26082/wxLua/modules/wxbind/src Modified Files: controls.cpp datetime.cpp defsutil.cpp event.cpp gdi.cpp windows.cpp wx_bind.cpp Log Message: add more classes from 2.6.3 Index: controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/controls.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** controls.cpp 7 May 2006 14:27:40 -0000 1.23 --- controls.cpp 16 May 2006 04:55:33 -0000 1.24 *************** *** 129,147 **** #endif - // wxString GetLabel() const - static int LUACALL wxLua_wxButton_GetLabel(lua_State *L) - { - wxLuaState wxlState(L); - wxString returns; - // get this - wxButton * self = (wxButton *)wxlState.GetUserDataType(1, s_wxluatag_wxButton); - // call GetLabel - returns = self->GetLabel(); - // push the result string - lua_pushstring(L, wx2lua(returns) ); - - return 1; - } - // void SetDefault() static int LUACALL wxLua_wxButton_SetDefault(lua_State *L) --- 129,132 ---- *************** *** 156,173 **** } - // void SetLabel(const wxString& label) - static int LUACALL wxLua_wxButton_SetLabel(lua_State *L) - { - wxLuaState wxlState(L); - // const wxString label - const wxString label = lua2wx(wxlState.GetStringType(2)); - // get this - wxButton * self = (wxButton *)wxlState.GetUserDataType(1, s_wxluatag_wxButton); - // call SetLabel - self->SetLabel(label); - - return 0; - } - static int LUACALL wxLua_wxButton_destructor(lua_State *) { --- 141,144 ---- *************** *** 193,201 **** #endif - { LuaMethod, "GetLabel", wxLua_wxButton_GetLabel, 0, 0, { 0 } }, { LuaMethod, "SetDefault", wxLua_wxButton_SetDefault, 0, 0, { 0 } }, - { LuaMethod, "SetLabel", wxLua_wxButton_SetLabel, 1, 1, { &s_wxluaarg_String, 0 } }, - { LuaGetProp, "Label", wxLua_wxButton_GetLabel, 0, 0, {0} }, - { LuaSetProp, "Label", wxLua_wxButton_SetLabel, 1, 1, {0} }, { LuaDelete, "wxButton", wxLua_wxButton_destructor, 0, 0, {0} }, }; --- 164,168 ---- *************** *** 452,455 **** --- 419,558 ---- + #if wxLUA_USE_wxButton + // ------------------------------------------------------------------------------------------------- + // Bind class wxToggleButton + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxToggleButton = -1; + + + #if ((wxLUA_USE_wxButton) && (wxLUA_USE_wxValidator)) && (wxLUA_USE_wxPointSizeRect) + // wxToggleButton(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxToggleButton") + static int LUACALL wxLua_wxToggleButton_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxToggleButton *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxString name = "wxToggleButton" + const wxString name = (argCount >= 8 ? lua2wx(wxlState.GetStringType(8)) : wxString(wxT("wxToggleButton"))); + // const wxValidator validator = wxDefaultValidator + const wxValidator * validator = (argCount >= 7 ? (const wxValidator *)wxlState.GetUserDataType(7, s_wxluatag_wxValidator) : &wxDefaultValidator); + // long style = 0 + long style = (argCount >= 6 ? (long)wxlState.GetNumberType(6) : 0); + // const wxSize size = wxDefaultSize + const wxSize * size = (argCount >= 5 ? (const wxSize *)wxlState.GetUserDataType(5, s_wxluatag_wxSize) : &wxDefaultSize); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 4 ? (const wxPoint *)wxlState.GetUserDataType(4, s_wxluatag_wxPoint) : &wxDefaultPosition); + // const wxString label + const wxString label = lua2wx(wxlState.GetStringType(3)); + // wxWindowID id + wxWindowID id = (wxWindowID)wxlState.GetNumberType(2); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call constructor + returns = new wxToggleButton(parent, id, label, *pos, *size, style, *validator, name); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxToggleButton, returns); + + return 1; + } + + // bool Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxToggleButton") + static int LUACALL wxLua_wxToggleButton_Create(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxString name = "wxToggleButton" + const wxString name = (argCount >= 9 ? lua2wx(wxlState.GetStringType(9)) : wxString(wxT("wxToggleButton"))); + // const wxValidator validator = wxDefaultValidator + const wxValidator * validator = (argCount >= 8 ? (const wxValidator *)wxlState.GetUserDataType(8, s_wxluatag_wxValidator) : &wxDefaultValidator); + // long style = 0 + long style = (argCount >= 7 ? (long)wxlState.GetNumberType(7) : 0); + // const wxSize size = wxDefaultSize + const wxSize * size = (argCount >= 6 ? (const wxSize *)wxlState.GetUserDataType(6, s_wxluatag_wxSize) : &wxDefaultSize); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 5 ? (const wxPoint *)wxlState.GetUserDataType(5, s_wxluatag_wxPoint) : &wxDefaultPosition); + // const wxString label + const wxString label = lua2wx(wxlState.GetStringType(4)); + // wxWindowID id + wxWindowID id = (wxWindowID)wxlState.GetNumberType(3); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); + // get this + wxToggleButton * self = (wxToggleButton *)wxlState.GetUserDataType(1, s_wxluatag_wxToggleButton); + // call Create + returns = self->Create(parent, id, label, *pos, *size, style, *validator, name); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif + + // void SetValue(bool state) + static int LUACALL wxLua_wxToggleButton_SetValue(lua_State *L) + { + wxLuaState wxlState(L); + // bool state + bool state = wxlState.GetBooleanType(2); + // get this + wxToggleButton * self = (wxToggleButton *)wxlState.GetUserDataType(1, s_wxluatag_wxToggleButton); + // call SetValue + self->SetValue(state); + + return 0; + } + + // bool GetValue() const + static int LUACALL wxLua_wxToggleButton_GetValue(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxToggleButton * self = (wxToggleButton *)wxlState.GetUserDataType(1, s_wxluatag_wxToggleButton); + // call GetValue + returns = self->GetValue(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxToggleButton_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxToggleButton_methods[] = { + + #if ((wxLUA_USE_wxButton) && (wxLUA_USE_wxValidator)) && (wxLUA_USE_wxPointSizeRect) + { LuaConstructor, "wxToggleButton", wxLua_wxToggleButton_constructor, 8, 3, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, &s_wxluatag_wxValidator, &s_wxluaarg_String, 0 } }, + { LuaMethod, "Create", wxLua_wxToggleButton_Create, 8, 3, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, &s_wxluatag_wxValidator, &s_wxluaarg_String, 0 } }, + #endif + + { LuaMethod, "SetValue", wxLua_wxToggleButton_SetValue, 1, 1, { &s_wxluaarg_Boolean, 0 } }, + { LuaMethod, "GetValue", wxLua_wxToggleButton_GetValue, 0, 0, { 0 } }, + { LuaDelete, "wxToggleButton", wxLua_wxToggleButton_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxToggleButton_methods = s_wxToggleButton_methods; + int wxToggleButton_methodCount = sizeof(s_wxToggleButton_methods)/sizeof(s_wxToggleButton_methods[0]); + #endif + + #if wxLUA_USE_wxCheckBox // ------------------------------------------------------------------------------------------------- Index: defsutil.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/defsutil.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** defsutil.cpp 2 May 2006 05:25:02 -0000 1.13 --- defsutil.cpp 16 May 2006 04:55:33 -0000 1.14 *************** *** 693,694 **** --- 693,768 ---- #endif + // ------------------------------------------------------------------------------------------------- + // Bind class wxBusyCursor + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxBusyCursor = -1; + + static int LUACALL wxLua_wxBusyCursor_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxBusyCursor * self = (wxBusyCursor *)wxlState.GetUserDataType(1, s_wxluatag_wxBusyCursor); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxBusyCursor_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxBusyCursor * self = (wxBusyCursor *)wxlState.GetUserDataType(1, s_wxluatag_wxBusyCursor); + // 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; + } + + + #if wxLUA_USE_wxCursor + // wxBusyCursor(const wxCursor* cursor = wxHOURGLASS_CURSOR) + static int LUACALL wxLua_wxBusyCursor_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxBusyCursor *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxCursor cursor = wxHOURGLASS_CURSOR + const wxCursor * cursor = (argCount >= 1 ? (const wxCursor *)wxlState.GetUserDataType(1, s_wxluatag_wxCursor) : wxHOURGLASS_CURSOR); + // call constructor + returns = new wxBusyCursor(cursor); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxBusyCursor *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); + + return 1; + } + + #endif + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxBusyCursor_methods[] = { + { LuaDelete, "wxBusyCursor", wxLua_wxBusyCursor_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxBusyCursor_Delete, 0, 0, {0} }, + + #if wxLUA_USE_wxCursor + { LuaConstructor, "wxBusyCursor", wxLua_wxBusyCursor_constructor, 1, 0, { &s_wxluatag_wxCursor, 0 } }, + #endif + + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxBusyCursor_methods = s_wxBusyCursor_methods; + int wxBusyCursor_methodCount = sizeof(s_wxBusyCursor_methods)/sizeof(s_wxBusyCursor_methods[0]); + Index: datetime.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/datetime.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** datetime.cpp 2 May 2006 05:25:02 -0000 1.13 --- datetime.cpp 16 May 2006 04:55:33 -0000 1.14 *************** *** 210,214 **** #endif ! // wxDateTime() static int LUACALL wxLua_wxDateTime_constructor(lua_State *L) { --- 210,214 ---- #endif ! // wxDateTime() static int LUACALL wxLua_wxDateTime_constructor(lua_State *L) { *************** *** 3645,3663 **** #if wxLUA_USE_wxCalendarCtrl // ------------------------------------------------------------------------------------------------- ! // Bind class wxCalendarEvent // ------------------------------------------------------------------------------------------------- // Lua MetaTable Tag for Class ! int s_wxluatag_wxCalendarEvent = -1; #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxCalendarCtrl) // const wxDateTime& GetDate() const ! static int LUACALL wxLua_wxCalendarEvent_GetDate(lua_State *L) { wxLuaState wxlState(L); const wxDateTime *returns; // get this ! wxCalendarEvent * self = (wxCalendarEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxCalendarEvent); // call GetDate returns = &self->GetDate(); --- 3645,3684 ---- #if wxLUA_USE_wxCalendarCtrl // ------------------------------------------------------------------------------------------------- ! // Bind class wxDateEvent // ------------------------------------------------------------------------------------------------- // Lua MetaTable Tag for Class ! int s_wxluatag_wxDateEvent = -1; #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxCalendarCtrl) + // wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type) + static int LUACALL wxLua_wxDateEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxDateEvent *returns; + // wxEventType type + wxEventType type = (wxEventType)wxlState.GetNumberType(3); + // const wxDateTime dt + const wxDateTime * dt = (const wxDateTime *)wxlState.GetUserDataType(2, s_wxluatag_wxDateTime); + // wxWindow win + wxWindow * win = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call constructor + returns = new wxDateEvent(win, *dt, type); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxDateEvent *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxDateEvent, returns); + + return 1; + } + // const wxDateTime& GetDate() const ! static int LUACALL wxLua_wxDateEvent_GetDate(lua_State *L) { wxLuaState wxlState(L); const wxDateTime *returns; // get this ! wxDateEvent * self = (wxDateEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxDateEvent); // call GetDate returns = &self->GetDate(); *************** *** 3668,3671 **** --- 3689,3767 ---- } + // void SetDate(const wxDateTime &date) + static int LUACALL wxLua_wxDateEvent_SetDate(lua_State *L) + { + wxLuaState wxlState(L); + // const wxDateTime date + const wxDateTime * date = (const wxDateTime *)wxlState.GetUserDataType(2, s_wxluatag_wxDateTime); + // get this + wxDateEvent * self = (wxDateEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxDateEvent); + // call SetDate + self->SetDate(*date); + + return 0; + } + + #endif + + static int LUACALL wxLua_wxDateEvent_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxDateEvent * self = (wxDateEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxDateEvent); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxDateEvent_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxDateEvent * self = (wxDateEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxDateEvent); + // 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_wxDateEvent_methods[] = { + + #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxCalendarCtrl) + { LuaConstructor, "wxDateEvent", wxLua_wxDateEvent_constructor, 3, 3, { &s_wxluatag_wxWindow, &s_wxluatag_wxDateTime, &s_wxluaarg_Number, 0 } }, + { LuaMethod, "GetDate", wxLua_wxDateEvent_GetDate, 0, 0, { 0 } }, + { LuaMethod, "SetDate", wxLua_wxDateEvent_SetDate, 1, 1, { &s_wxluatag_wxDateTime, 0 } }, + { LuaGetProp, "Date", wxLua_wxDateEvent_GetDate, 0, 0, {0} }, + #endif + + { LuaDelete, "wxDateEvent", wxLua_wxDateEvent_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxDateEvent_Delete, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxDateEvent_methods = s_wxDateEvent_methods; + int wxDateEvent_methodCount = sizeof(s_wxDateEvent_methods)/sizeof(s_wxDateEvent_methods[0]); + #endif + + + #if wxLUA_USE_wxCalendarCtrl + // ------------------------------------------------------------------------------------------------- + // Bind class wxCalendarEvent + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxCalendarEvent = -1; + + + #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxCalendarCtrl) // wxDateTime::WeekDay GetWeekDay() const static int LUACALL wxLua_wxCalendarEvent_GetWeekDay(lua_State *L) *************** *** 3683,3686 **** --- 3779,3796 ---- } + // void SetWeekDay(const wxDateTime::WeekDay wd) + static int LUACALL wxLua_wxCalendarEvent_SetWeekDay(lua_State *L) + { + wxLuaState wxlState(L); + // const wxDateTime::WeekDay wd + const wxDateTime::WeekDay wd = (wxDateTime::WeekDay)wxlState.GetEnumerationType(2); + // get this + wxCalendarEvent * self = (wxCalendarEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxCalendarEvent); + // call SetWeekDay + self->SetWeekDay(wd); + + return 0; + } + #endif *************** *** 3737,3744 **** #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxCalendarCtrl) - { LuaMethod, "GetDate", wxLua_wxCalendarEvent_GetDate, 0, 0, { 0 } }, { LuaMethod, "GetWeekDay", wxLua_wxCalendarEvent_GetWeekDay, 0, 0, { 0 } }, ! { LuaGetProp, "Date", wxLua_wxCalendarEvent_GetDate, 0, 0, {0} }, { LuaGetProp, "WeekDay", wxLua_wxCalendarEvent_GetWeekDay, 0, 0, {0} }, #endif --- 3847,3854 ---- #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxCalendarCtrl) { LuaMethod, "GetWeekDay", wxLua_wxCalendarEvent_GetWeekDay, 0, 0, { 0 } }, ! { LuaMethod, "SetWeekDay", wxLua_wxCalendarEvent_SetWeekDay, 1, 1, { &s_wxluaarg_Enumeration, 0 } }, { LuaGetProp, "WeekDay", wxLua_wxCalendarEvent_GetWeekDay, 0, 0, {0} }, + { LuaSetProp, "WeekDay", wxLua_wxCalendarEvent_SetWeekDay, 1, 1, {0} }, #endif Index: event.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/event.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** event.cpp 2 May 2006 05:25:02 -0000 1.17 --- event.cpp 16 May 2006 04:55:33 -0000 1.18 *************** *** 2807,2810 **** --- 2807,2894 ---- // ------------------------------------------------------------------------------------------------- + // Bind class wxMouseCaptureChangedEvent + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxMouseCaptureChangedEvent = -1; + + // wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = NULL) + static int LUACALL wxLua_wxMouseCaptureChangedEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxMouseCaptureChangedEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxWindow gainedCapture = NULL + wxWindow * gainedCapture = (argCount >= 2 ? (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow) : NULL); + // wxWindowID winid = 0 + wxWindowID winid = (argCount >= 1 ? (wxWindowID)wxlState.GetNumberType(1) : 0); + // call constructor + returns = new wxMouseCaptureChangedEvent(winid, gainedCapture); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxMouseCaptureChangedEvent *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxMouseCaptureChangedEvent, returns); + + return 1; + } + + // wxWindow* GetCapturedWindow() const + static int LUACALL wxLua_wxMouseCaptureChangedEvent_GetCapturedWindow(lua_State *L) + { + wxLuaState wxlState(L); + wxWindow *returns; + // get this + wxMouseCaptureChangedEvent * self = (wxMouseCaptureChangedEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxMouseCaptureChangedEvent); + // call GetCapturedWindow + returns = self->GetCapturedWindow(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWindow, returns); + + return 1; + } + + static int LUACALL wxLua_wxMouseCaptureChangedEvent_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxMouseCaptureChangedEvent * self = (wxMouseCaptureChangedEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxMouseCaptureChangedEvent); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxMouseCaptureChangedEvent_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxMouseCaptureChangedEvent * self = (wxMouseCaptureChangedEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxMouseCaptureChangedEvent); + // 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_wxMouseCaptureChangedEvent_methods[] = { + { LuaConstructor, "wxMouseCaptureChangedEvent", wxLua_wxMouseCaptureChangedEvent_constructor, 2, 0, { &s_wxluaarg_Number, &s_wxluatag_wxWindow, 0 } }, + { LuaMethod, "GetCapturedWindow", wxLua_wxMouseCaptureChangedEvent_GetCapturedWindow, 0, 0, { 0 } }, + { LuaDelete, "wxMouseCaptureChangedEvent", wxLua_wxMouseCaptureChangedEvent_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxMouseCaptureChangedEvent_Delete, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxMouseCaptureChangedEvent_methods = s_wxMouseCaptureChangedEvent_methods; + int wxMouseCaptureChangedEvent_methodCount = sizeof(s_wxMouseCaptureChangedEvent_methods)/sizeof(s_wxMouseCaptureChangedEvent_methods[0]); + + // ------------------------------------------------------------------------------------------------- // Bind class wxMoveEvent // ------------------------------------------------------------------------------------------------- *************** *** 3417,3420 **** --- 3501,3778 ---- // ------------------------------------------------------------------------------------------------- + // Bind class wxIconizeEvent + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxIconizeEvent = -1; + + // wxIconizeEvent(int winid = 0, bool iconized = true) + static int LUACALL wxLua_wxIconizeEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxIconizeEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // bool iconized = true + bool iconized = (argCount >= 2 ? wxlState.GetBooleanType(2) : true); + // int winid = 0 + int winid = (argCount >= 1 ? (int)wxlState.GetNumberType(1) : 0); + // call constructor + returns = new wxIconizeEvent(winid, iconized); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxIconizeEvent *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxIconizeEvent, returns); + + return 1; + } + + // bool Iconized() const + static int LUACALL wxLua_wxIconizeEvent_Iconized(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxIconizeEvent * self = (wxIconizeEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxIconizeEvent); + // call Iconized + returns = self->Iconized(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxIconizeEvent_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxIconizeEvent * self = (wxIconizeEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxIconizeEvent); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxIconizeEvent_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxIconizeEvent * self = (wxIconizeEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxIconizeEvent); + // 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_wxIconizeEvent_methods[] = { + { LuaConstructor, "wxIconizeEvent", wxLua_wxIconizeEvent_constructor, 2, 0, { &s_wxluaarg_Number, &s_wxluaarg_Boolean, 0 } }, + { LuaMethod, "Iconized", wxLua_wxIconizeEvent_Iconized, 0, 0, { 0 } }, + { LuaDelete, "wxIconizeEvent", wxLua_wxIconizeEvent_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxIconizeEvent_Delete, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxIconizeEvent_methods = s_wxIconizeEvent_methods; + int wxIconizeEvent_methodCount = sizeof(s_wxIconizeEvent_methods)/sizeof(s_wxIconizeEvent_methods[0]); + + // ------------------------------------------------------------------------------------------------- + // Bind class wxMaximizeEvent + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxMaximizeEvent = -1; + + // wxMaximizeEvent(int winid = 0) + static int LUACALL wxLua_wxMaximizeEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxMaximizeEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // int winid = 0 + int winid = (argCount >= 1 ? (int)wxlState.GetNumberType(1) : 0); + // call constructor + returns = new wxMaximizeEvent(winid); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxMaximizeEvent *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxMaximizeEvent, returns); + + return 1; + } + + static int LUACALL wxLua_wxMaximizeEvent_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxMaximizeEvent * self = (wxMaximizeEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxMaximizeEvent); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxMaximizeEvent_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxMaximizeEvent * self = (wxMaximizeEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxMaximizeEvent); + // 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_wxMaximizeEvent_methods[] = { + { LuaConstructor, "wxMaximizeEvent", wxLua_wxMaximizeEvent_constructor, 1, 0, { &s_wxluaarg_Number, 0 } }, + { LuaDelete, "wxMaximizeEvent", wxLua_wxMaximizeEvent_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxMaximizeEvent_Delete, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxMaximizeEvent_methods = s_wxMaximizeEvent_methods; + int wxMaximizeEvent_methodCount = sizeof(s_wxMaximizeEvent_methods)/sizeof(s_wxMaximizeEvent_methods[0]); + + // ------------------------------------------------------------------------------------------------- + // Bind class wxWindowCreateEvent + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxWindowCreateEvent = -1; + + // wxWindowCreateEvent(wxWindow *win = NULL) + static int LUACALL wxLua_wxWindowCreateEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWindowCreateEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxWindow win = NULL + wxWindow * win = (argCount >= 1 ? (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow) : NULL); + // call constructor + returns = new wxWindowCreateEvent(win); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxWindowCreateEvent, returns); + + return 1; + } + + // wxWindow *GetWindow() const + static int LUACALL wxLua_wxWindowCreateEvent_GetWindow(lua_State *L) + { + wxLuaState wxlState(L); + wxWindow *returns; + // get this + wxWindowCreateEvent * self = (wxWindowCreateEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxWindowCreateEvent); + // call GetWindow + returns = self->GetWindow(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWindow, returns); + + return 1; + } + + static int LUACALL wxLua_wxWindowCreateEvent_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxWindowCreateEvent_methods[] = { + { LuaConstructor, "wxWindowCreateEvent", wxLua_wxWindowCreateEvent_constructor, 1, 0, { &s_wxluatag_wxWindow, 0 } }, + { LuaMethod, "GetWindow", wxLua_wxWindowCreateEvent_GetWindow, 0, 0, { 0 } }, + { LuaDelete, "wxWindowCreateEvent", wxLua_wxWindowCreateEvent_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxWindowCreateEvent_methods = s_wxWindowCreateEvent_methods; + int wxWindowCreateEvent_methodCount = sizeof(s_wxWindowCreateEvent_methods)/sizeof(s_wxWindowCreateEvent_methods[0]); + + // ------------------------------------------------------------------------------------------------- + // Bind class wxWindowDestroyEvent + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxWindowDestroyEvent = -1; + + // wxWindowDestroyEvent(wxWindow *win = NULL) + static int LUACALL wxLua_wxWindowDestroyEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWindowDestroyEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxWindow win = NULL + wxWindow * win = (argCount >= 1 ? (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow) : NULL); + // call constructor + returns = new wxWindowDestroyEvent(win); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxWindowDestroyEvent, returns); + + return 1; + } + + // wxWindow *GetWindow() const + static int LUACALL wxLua_wxWindowDestroyEvent_GetWindow(lua_State *L) + { + wxLuaState wxlState(L); + wxWindow *returns; + // get this + wxWindowDestroyEvent * self = (wxWindowDestroyEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxWindowDestroyEvent); + // call GetWindow + returns = self->GetWindow(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWindow, returns); + + return 1; + } + + static int LUACALL wxLua_wxWindowDestroyEvent_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxWindowDestroyEvent_methods[] = { + { LuaConstructor, "wxWindowDestroyEvent", wxLua_wxWindowDestroyEvent_constructor, 1, 0, { &s_wxluatag_wxWindow, 0 } }, + { LuaMethod, "GetWindow", wxLua_wxWindowDestroyEvent_GetWindow, 0, 0, { 0 } }, + { LuaDelete, "wxWindowDestroyEvent", wxLua_wxWindowDestroyEvent_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxWindowDestroyEvent_methods = s_wxWindowDestroyEvent_methods; + int wxWindowDestroyEvent_methodCount = sizeof(s_wxWindowDestroyEvent_methods)/sizeof(s_wxWindowDestroyEvent_methods[0]); + + // ------------------------------------------------------------------------------------------------- // Bind class wxSysColourChangedEvent // ------------------------------------------------------------------------------------------------- *************** *** 3479,3482 **** --- 3837,3998 ---- // ------------------------------------------------------------------------------------------------- + // Bind class wxSetCursorEvent + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxSetCursorEvent = -1; + + // wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0) + static int LUACALL wxLua_wxSetCursorEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxSetCursorEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxCoord y = 0 + wxCoord y = (argCount >= 2 ? (wxCoord)wxlState.GetNumberType(2) : 0); + // wxCoord x = 0 + wxCoord x = (argCount >= 1 ? (wxCoord)wxlState.GetNumberType(1) : 0); + // call constructor + returns = new wxSetCursorEvent(x, y); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxSetCursorEvent *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxSetCursorEvent, returns); + + return 1; + } + + // wxCoord GetX() const + static int LUACALL wxLua_wxSetCursorEvent_GetX(lua_State *L) + { + wxLuaState wxlState(L); + wxCoord returns; + // get this + wxSetCursorEvent * self = (wxSetCursorEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxSetCursorEvent); + // call GetX + returns = self->GetX(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // wxCoord GetY() const + static int LUACALL wxLua_wxSetCursorEvent_GetY(lua_State *L) + { + wxLuaState wxlState(L); + wxCoord returns; + // get this + wxSetCursorEvent * self = (wxSetCursorEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxSetCursorEvent); + // call GetY + returns = self->GetY(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // bool HasCursor() const + static int LUACALL wxLua_wxSetCursorEvent_HasCursor(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxSetCursorEvent * self = (wxSetCursorEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxSetCursorEvent); + // call HasCursor + returns = self->HasCursor(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxSetCursorEvent_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxSetCursorEvent * self = (wxSetCursorEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxSetCursorEvent); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxSetCursorEvent_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxSetCursorEvent * self = (wxSetCursorEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxSetCursorEvent); + // 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; + } + + + #if wxLUA_USE_wxCursor + // void SetCursor(const wxCursor& cursor) + static int LUACALL wxLua_wxSetCursorEvent_SetCursor(lua_State *L) + { + wxLuaState wxlState(L); + // const wxCursor cursor + const wxCursor * cursor = (const wxCursor *)wxlState.GetUserDataType(2, s_wxluatag_wxCursor); + // get this + wxSetCursorEvent * self = (wxSetCursorEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxSetCursorEvent); + // call SetCursor + self->SetCursor(*cursor); + + return 0; + } + + // wxCursor GetCursor() const + static int LUACALL wxLua_wxSetCursorEvent_GetCursor(lua_State *L) + { + wxLuaState wxlState(L); + wxCursor *returns; + // get this + wxSetCursorEvent * self = (wxSetCursorEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxSetCursorEvent); + // call GetCursor + // allocate a new object using the copy constructor + returns = new wxCursor(self->GetCursor()); + // add the new object to the tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxCursor *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxCursor, returns); + + return 1; + } + + #endif + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxSetCursorEvent_methods[] = { + { LuaConstructor, "wxSetCursorEvent", wxLua_wxSetCursorEvent_constructor, 2, 0, { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 } }, + { LuaMethod, "GetX", wxLua_wxSetCursorEvent_GetX, 0, 0, { 0 } }, + { LuaMethod, "GetY", wxLua_wxSetCursorEvent_GetY, 0, 0, { 0 } }, + { LuaMethod, "HasCursor", wxLua_wxSetCursorEvent_HasCursor, 0, 0, { 0 } }, + { LuaDelete, "wxSetCursorEvent", wxLua_wxSetCursorEvent_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxSetCursorEvent_Delete, 0, 0, {0} }, + + #if wxLUA_USE_wxCursor + { LuaMethod, "SetCursor", wxLua_wxSetCursorEvent_SetCursor, 1, 1, { &s_wxluatag_wxCursor, 0 } }, + { LuaMethod, "GetCursor", wxLua_wxSetCursorEvent_GetCursor, 0, 0, { 0 } }, + #endif + + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxSetCursorEvent_methods = s_wxSetCursorEvent_methods; + int wxSetCursorEvent_methodCount = sizeof(s_wxSetCursorEvent_methods)/sizeof(s_wxSetCursorEvent_methods[0]); + + // ------------------------------------------------------------------------------------------------- // Bind class wxUpdateUIEvent // ------------------------------------------------------------------------------------------------- Index: windows.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/windows.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** windows.cpp 6 May 2006 19:54:32 -0000 1.21 --- windows.cpp 16 May 2006 04:55:33 -0000 1.22 *************** *** 30,33 **** --- 30,99 ---- // ------------------------------------------------------------------------------------------------- + // Bind class wxWindowDisabler + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxWindowDisabler = -1; + + // wxWindowDisabler(wxWindow *winToSkip = NULL) + static int LUACALL wxLua_wxWindowDisabler_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWindowDisabler *returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxWindow winToSkip = NULL + wxWindow * winToSkip = (argCount >= 1 ? (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow) : NULL); + // call constructor + returns = new wxWindowDisabler(winToSkip); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxWindowDisabler *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxWindowDisabler, returns); + + return 1; + } + + static int LUACALL wxLua_wxWindowDisabler_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxWindowDisabler * self = (wxWindowDisabler *)wxlState.GetUserDataType(1, s_wxluatag_wxWindowDisabler); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxWindowDisabler_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxWindowDisabler * self = (wxWindowDisabler *)wxlState.GetUserDataType(1, s_wxluatag_wxWindowDisabler); + // 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_wxWindowDisabler_methods[] = { + { LuaConstructor, "wxWindowDisabler", wxLua_wxWindowDisabler_constructor, 1, 0, { &s_wxluatag_wxWindow, 0 } }, + { LuaDelete, "wxWindowDisabler", wxLua_wxWindowDisabler_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxWindowDisabler_Delete, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxWindowDisabler_methods = s_wxWindowDisabler_methods; + int wxWindowDisabler_methodCount = sizeof(s_wxWindowDisabler_methods)/sizeof(s_wxWindowDisabler_methods[0]); + + // ------------------------------------------------------------------------------------------------- // Bind class wxVisualAttributes // ------------------------------------------------------------------------------------------------- Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wx_bind.cpp 15 May 2006 22:57:30 -0000 1.37 --- wx_bind.cpp 16 May 2006 04:55:33 -0000 1.38 *************** *** 141,148 **** --- 141,151 ---- { &wxEVT_COMMAND_TOOL_ENTER, "wxEVT_COMMAND_TOOL_ENTER", &s_wxluatag_wxCommandEvent }, { &wxEVT_COMMAND_TOOL_RCLICKED, "wxEVT_COMMAND_TOOL_RCLICKED", &s_wxluatag_wxCommandEvent }, + { &wxEVT_CREATE, "wxEVT_CREATE", &s_wxluatag_wxWindowCreateEvent }, + { &wxEVT_DESTROY, "wxEVT_DESTROY", &s_wxluatag_wxWindowDestroyEvent }, { &wxEVT_END_PROCESS, "wxEVT_END_PROCESS", &s_wxluatag_wxProcessEvent }, { &wxEVT_END_SESSION, "wxEVT_END_SESSION", &s_wxluatag_wxCloseEvent }, { &wxEVT_ENTER_WINDOW, "wxEVT_ENTER_WINDOW", &s_wxluatag_wxMouseEvent }, { &wxEVT_ERASE_BACKGROUND, "wxEVT_ERASE_BACKGROUND", &s_wxluatag_wxEraseEvent }, + { &wxEVT_ICONIZE, "wxEVT_ICONIZE", &s_wxluatag_wxIconizeEvent }, { &wxEVT_IDLE, "wxEVT_IDLE", &s_wxluatag_wxIdleEvent }, { &wxEVT_INIT_DIALOG, "wxEVT_INIT_DIALOG", &s_wxluatag_wxInitDialogEvent }, *************** *** 158,161 **** --- 161,165 ---- { &wxEVT_LEFT_DOWN, "wxEVT_LEFT_DOWN", &s_wxluatag_wxMouseEvent }, { &wxEVT_LEFT_UP, "wxEVT_LEFT_UP", &s_wxluatag_wxMouseEvent }, + { &wxEVT_MAXIMIZE, "wxEVT_MAXIMIZE", &s_wxluatag_wxMaximizeEvent }, { &wxEVT_MIDDLE_DCLICK, "wxEVT_MIDDLE_DCLICK", &s_wxluatag_wxMouseEvent }, { &wxEVT_MIDDLE_DOWN, "wxEVT_MIDDLE_DOWN", &s_wxluatag_wxMouseEvent }, *************** *** 163,166 **** --- 167,171 ---- { &wxEVT_MOTION, "wxEVT_MOTION", &s_wxluatag_wxMouseEvent }, { &wxEVT_MOUSEWHEEL, "wxEVT_MOUSEWHEEL", &s_wxluatag_wxMouseEvent }, + { &wxEVT_MOUSE_CAPTURE_CHANGED, "wxEVT_MOUSE_CAPTURE_CHANGED", &s_wxluatag_wxMouseCaptureChangedEvent }, { &wxEVT_MOVE, "wxEVT_MOVE", &s_wxluatag_wxMoveEvent }, { &wxEVT_NC_ENTER_WINDOW, "wxEVT_NC_ENTER_WINDOW", &s_wxluatag_wxMouseEvent }, *************** *** 198,201 **** --- 203,207 ---- { &wxEVT_SCROLL_THUMBTRACK, "wxEVT_SCROLL_THUMBTRACK", &s_wxluatag_wxScrollEvent }, { &wxEVT_SCROLL_TOP, "wxEVT_SCROLL_TOP", &s_wxluatag_wxScrollEvent }, + { &wxEVT_SET_CURSOR, "wxEVT_SET_CURSOR", &s_wxluatag_wxSetCursorEvent }, { &wxEVT_SET_FOCUS, "wxEVT_SET_FOCUS", &s_wxluatag_wxFocusEvent }, { &wxEVT_SIZE, "wxEVT_SIZE", &s_wxluatag_wxSizeEvent }, *************** *** 5126,5130 **** --- 5132,5138 ---- } + wxLUA_IMPLEMENT_ENCAPSULATION(wxBusyCursor) wxLUA_IMPLEMENT_ENCAPSULATION(wxProcess) + wxLUA_IMPLEMENT_ENCAPSULATION(wxWindowDisabler) #if wxCHECK_VERSION(2,7,0) *************** *** 5430,5433 **** --- 5438,5442 ---- { "wxActivateEvent", wxActivateEvent_methods, wxActivateEvent_methodCount, -1, CLASSINFO(wxActivateEvent), &s_wxluatag_wxActivateEvent, "wxEvent" }, + { "wxBusyCursor", wxBusyCursor_methods, wxBusyCursor_methodCount, -1, NULL, &s_wxluatag_wxBusyCursor, NULL }, { "wxClientData", wxClientData_methods, wxClientData_methodCount, -1, NULL, &s_wxluatag_wxClientData, NULL }, { "wxCloseEvent", wxCloseEvent_methods, wxCloseEvent_methodCount, -1, CLASSINFO(wxCloseEvent), &s_wxluatag_wxCloseEvent, "wxEvent" }, *************** *** 5439,5442 **** --- 5448,5452 ---- { "wxFocusEvent", wxFocusEvent_methods, wxFocusEvent_methodCount, -1, CLASSINFO(wxFocusEvent), &s_wxluatag_wxFocusEvent, "wxEvent" }, { "wxGDIObject", wxGDIObject_methods, wxGDIObject_methodCount, -1, CLASSINFO(wxGDIObject), &s_wxluatag_wxGDIObject, "wxObject" }, + { "wxIconizeEvent", wxIconizeEvent_methods, wxIconizeEvent_methodCount, -1, CLASSINFO(wxIconizeEvent), &s_wxluatag_wxIconizeEvent, "wxEvent" }, { "wxIdleEvent", wxIdleEvent_methods, wxIdleEvent_methodCount, -1, CLASSINFO(wxIdleEvent), &s_wxluatag_wxIdleEvent, "wxEvent" }, { "wxInitDialogEvent", wxInitDialogEvent_methods, wxInitDialogEvent_methodCount, -1, CLASSINFO(wxInitDialogEvent), &s_wxluatag_wxInitDialogEvent, "wxEvent" }, *************** *** 5445,5448 **** --- 5455,5460 ---- { "wxLuaObject", wxLuaObject_methods, wxLuaObject_methodCount, -1, CLASSINFO(wxLuaObject), &s_wxluatag_wxLuaObject, "wxObject" }, { "wxLuaState", wxLuaState_methods, wxLuaState_methodCount, -1, CLASSINFO(wxLuaState), &s_wxluatag_wxLuaState, "wxObject" }, + { "wxMaximizeEvent", wxMaximizeEvent_methods, wxMaximizeEvent_methodCount, -1, CLASSINFO(wxMaximizeEvent), &s_wxluatag_wxMaximizeEvent, "wxEvent" }, + { "wxMouseCaptureChangedEvent", wxMouseCaptureChangedEvent_methods, wxMouseCaptureChangedEvent_methodCount, -1, CLASSINFO(wxMouseCaptureChangedEvent), &s_wxluatag_wxMouseCaptureChangedEvent, "wxEvent" }, { "wxMouseEvent", wxMouseEvent_methods, wxMouseEvent_methodCount, -1, CLASSINFO(wxMouseEvent), &s_wxluatag_wxMouseEvent, "wxEvent" }, { "wxMoveEvent", wxMoveEvent_methods, wxMoveEvent_methodCount, -1, CLASSINFO(wxMoveEvent), &s_wxluatag_wxMoveEvent, "wxEvent" }, *************** *** 5455,5458 **** --- 5467,5471 ---- { "wxScrollEvent", wxScrollEvent_methods, wxScrollEvent_methodCount, -1, CLASSINFO(wxScrollEvent), &s_wxluatag_wxScrollEvent, "wxCommandEvent" }, { "wxScrollWinEvent", wxScrollWinEvent_methods, wxScrollWinEvent_methodCount, -1, CLASSINFO(wxScrollWinEvent), &s_wxluatag_wxScrollWinEvent, "wxEvent" }, + { "wxSetCursorEvent", wxSetCursorEvent_methods, wxSetCursorEvent_methodCount, -1, CLASSINFO(wxSetCursorEvent), &s_wxluatag_wxSetCursorEvent, "wxEvent" }, { "wxSizeEvent", wxSizeEvent_methods, wxSizeEvent_methodCount, -1, CLASSINFO(wxSizeEvent), &s_wxluatag_wxSizeEvent, "wxEvent" }, { "wxStringClientData", wxStringClientData_methods, wxStringClientData_methodCount, -1, NULL, &s_wxluatag_wxStringClientData, "wxClientData" }, *************** *** 5461,5464 **** --- 5474,5480 ---- { "wxVisualAttributes", wxVisualAttributes_methods, wxVisualAttributes_methodCount, -1, NULL, &s_wxluatag_wxVisualAttributes, NULL }, { "wxWindow", wxWindow_methods, wxWindow_methodCount, -1, CLASSINFO(wxWindow), &s_wxluatag_wxWindow, "wxEvtHandler" }, + { "wxWindowCreateEvent", wxWindowCreateEvent_methods, wxWindowCreateEvent_methodCount, -1, CLASSINFO(wxWindowCreateEvent), &s_wxluatag_wxWindowCreateEvent, "wxCommandEvent" }, + { "wxWindowDestroyEvent", wxWindowDestroyEvent_methods, wxWindowDestroyEvent_methodCount, -1, CLASSINFO(wxWindowDestroyEvent), &s_wxluatag_wxWindowDestroyEvent, "wxCommandEvent" }, + { "wxWindowDisabler", wxWindowDisabler_methods, wxWindowDisabler_methodCount, -1, NULL, &s_wxluatag_wxWindowDisabler, NULL }, #if wxCHECK_VERSION(2,3,0) *************** *** 5526,5529 **** --- 5542,5546 ---- #if wxLUA_USE_wxButton { "wxButton", wxButton_methods, wxButton_methodCount, -1, CLASSINFO(wxButton), &s_wxluatag_wxButton, "wxControl" }, + { "wxToggleButton", wxToggleButton_methods, wxToggleButton_methodCount, -1, CLASSINFO(wxToggleButton), &s_wxluatag_wxToggleButton, "wxControl" }, #endif *************** *** 5532,5536 **** { "wxCalendarCtrl", wxCalendarCtrl_methods, wxCalendarCtrl_methodCount, -1, CLASSINFO(wxCalendarCtrl), &s_wxluatag_wxCalendarCtrl, "wxControl" }, { "wxCalendarDateAttr", wxCalendarDateAttr_methods, wxCalendarDateAttr_methodCount, -1, NULL, &s_wxluatag_wxCalendarDateAttr, NULL }, ! { "wxCalendarEvent", wxCalendarEvent_methods, wxCalendarEvent_methodCount, -1, CLASSINFO(wxCalendarEvent), &s_wxluatag_wxCalendarEvent, "wxEvent" }, #endif --- 5549,5554 ---- { "wxCalendarCtrl", wxCalendarCtrl_methods, wxCalendarCtrl_methodCount, -1, CLASSINFO(wxCalendarCtrl), &s_wxluatag_wxCalendarCtrl, "wxControl" }, { "wxCalendarDateAttr", wxCalendarDateAttr_methods, wxCalendarDateAttr_methodCount, -1, NULL, &s_wxluatag_wxCalendarDateAttr, NULL }, ! { "wxCalendarEvent", wxCalendarEvent_methods, wxCalendarEvent_methodCount, -1, CLASSINFO(wxCalendarEvent), &s_wxluatag_wxCalendarEvent, "wxDateEvent" }, ! { "wxDateEvent", wxDateEvent_methods, wxDateEvent_methodCount, -1, CLASSINFO(wxDateEvent), &s_wxluatag_wxDateEvent, "wxCommandEvent" }, #endif *************** *** 5613,5619 **** --- 5631,5640 ---- #if wxLUA_USE_wxDC + { "wxBufferedDC", wxBufferedDC_methods, wxBufferedDC_methodCount, -1, CLASSINFO(wxBufferedDC), &s_wxluatag_wxBufferedDC, "wxMemoryDC" }, + { "wxBufferedPaintDC", wxBufferedPaintDC_methods, wxBufferedPaintDC_methodCount, -1, CLASSINFO(wxBufferedPaintDC), &s_wxluatag_wxBufferedPaintDC, "wxBufferedDC" }, { "wxClientDC", wxClientDC_methods, wxClientDC_methodCount, -1, CLASSINFO(wxClientDC), &s_wxluatag_wxClientDC, "wxWindowDC" }, { "wxDC", wxDC_methods, wxDC_methodCount, -1, CLASSINFO(wxDC), &s_wxluatag_wxDC, "wxObject" }, { "wxMemoryDC", wxMemoryDC_methods, wxMemoryDC_methodCount, -1, CLASSINFO(wxMemoryDC), &s_wxluatag_wxMemoryDC, "wxDC" }, + { "wxMirrorDC", wxMirrorDC_methods, wxMirrorDC_methodCount, -1, CLASSINFO(wxMirrorDC), &s_wxluatag_wxMirrorDC, "wxDC" }, { "wxPaintDC", wxPaintDC_methods, wxPaintDC_methodCount, -1, CLASSINFO(wxPaintDC), &s_wxluatag_wxPaintDC, "wxWindowDC" }, { "wxScreenDC", wxScreenDC_methods, wxScreenDC_methodCount, -1, CLASSINFO(wxScreenDC), &s_wxluatag_wxScreenDC, "wxDC" }, Index: gdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/gdi.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** gdi.cpp 14 May 2006 17:45:05 -0000 1.23 --- gdi.cpp 16 May 2006 04:55:33 -0000 1.24 *************** *** 2422,2426 **** #endif ! // wxFont(int pointSize, int family, int style, int weight, const bool underline = false, const wxString& faceName = "", wxFontEncoding encoding = wxFONTENCODING_DEFAULT) static int LUACALL wxLua_wxFont_constructor(lua_State *L) { --- 2422,2426 ---- #endif ! // wxFont(int pointSize, int family, int style, int weight, const bool underline = false, const wxString& faceName = "", wxFontEncoding encoding = wxFONTENCODING_DEFAULT) static int LUACALL wxLua_wxFont_constructor(lua_State *L) { *************** *** 3655,3659 **** #endif ! // %overload wxPen() static int LUACALL wxLua_wxPen_constructor1(lua_State *L) { --- 3655,3659 ---- #endif ! // %overload wxPen() static int LUACALL wxLua_wxPen_constructor1(lua_State *L) { *************** *** 5234,5238 **** #endif ! // %constructor wxDefaultBitmap() static int LUACALL wxLua_wxDefaultBitmap_constructor(lua_State *L) { --- 5234,5238 ---- #endif ! // %constructor wxDefaultBitmap() static int LUACALL wxLua_wxDefaultBitmap_constructor(lua_State *L) { *************** *** 8338,8341 **** --- 8338,8684 ---- + #if wxLUA_USE_wxDC + // ------------------------------------------------------------------------------------------------- + // Bind class wxBufferedDC + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxBufferedDC = -1; + + + #if (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxDC) + // %constructor wxBufferedDCFromBitmap(wxDC *dc, const wxBitmap& buffer, int style = wxBUFFER_CLIENT_AREA) + static int LUACALL wxLua_wxBufferedDCFromBitmap_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxBufferedDC *returns; + // get number of arguments + int argCount = lua_gettop(L); + // int style = wxBUFFER_CLIENT_AREA + int style = (argCount >= 3 ? (int)wxlState.GetNumberType(3) : wxBUFFER_CLIENT_AREA); + // const wxBitmap buffer + const wxBitmap * buffer = (const wxBitmap *)wxlState.GetUserDataType(2, s_wxluatag_wxBitmap); + // wxDC dc + wxDC * dc = (wxDC *)wxlState.GetUserDataType(1, s_wxluatag_wxDC); + // call constructor + returns = new wxBufferedDC(dc, *buffer, style); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxBufferedDC *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxBufferedDC, returns); + + return 1; + } + + // %rename InitFromBitmap void Init(wxDC *dc, const wxBitmap& buffer, int style = wxBUFFER_CLIENT_AREA) + static int LUACALL wxLua_wxBufferedDC_InitFromBitmap(lua_State *L) + { + wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // int style = wxBUFFER_CLIENT_AREA + int style = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : wxBUFFER_CLIENT_AREA); + // const wxBitmap buffer + const wxBitmap * buffer = (const wxBitmap *)wxlState.GetUserDataType(3, s_wxluatag_wxBitmap); + // wxDC dc + wxDC * dc = (wxDC *)wxlState.GetUserDataType(2, s_wxluatag_wxDC); + // get this + wxBufferedDC * self = (wxBufferedDC *)wxlState.GetUserDataType(1, s_wxluatag_wxBufferedDC); + // call Init + self->Init(dc, *buffer, style); + + return 0; + } + + #endif + + + #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxDC) + // %constructor wxBufferedDCFromSize(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA) + static int LUACALL wxLua_wxBufferedDCFromSize_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxBufferedDC *returns; + // get number of arguments + int argCount = lua_gettop(L); + // int style = wxBUFFER_CLIENT_AREA + int style = (argCount >= 3 ? (int)wxlState.GetNumberType(3) : wxBUFFER_CLIENT_AREA); + // const wxSize area + const wxSize * area = (const wxSize *)wxlState.GetUserDataType(2, s_wxluatag_wxSize); + // wxDC dc + wxDC * dc = (wxDC *)wxlState.GetUserDataType(1, s_wxluatag_wxDC); + // call constructor + returns = new wxBufferedDC(dc, *area, style); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxBufferedDC *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxBufferedDC, returns); + + return 1; + } + + // void Init(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA) + static int LUACALL wxLua_wxBufferedDC_Init(lua_State *L) + { + wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // int style = wxBUFFER_CLIENT_AREA + int style = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : wxBUFFER_CLIENT_AREA); + // const wxSize area + const wxSize * area = (const wxSize *)wxlState.GetUserDataType(3, s_wxluatag_wxSize); + // wxDC dc + wxDC * dc = (wxDC *)wxlState.GetUserDataType(2, s_wxluatag_wxDC); + // get this + wxBufferedDC * self = (wxBufferedDC *)wxlState.GetUserDataType(1, s_wxluatag_wxBufferedDC); + // call Init + self->Init(dc, *area, style); + + return 0; + } + + #endif + + // wxBufferedDC() + static int LUACALL wxLua_wxBufferedDC_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxBufferedDC *returns; + // call constructor + returns = new wxBufferedDC(); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxBufferedDC *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxBufferedDC, returns); + + return 1; + } + + static int LUACALL wxLua_wxBufferedDC_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxBufferedDC * self = (wxBufferedDC *)wxlState.GetUserDataType(1, s_wxluatag_wxBufferedDC); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxBufferedDC_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxBufferedDC * self = (wxBufferedDC *)wxlState.GetUserDataType(1, s_wxluatag_wxBufferedDC); + // 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_wxBufferedDC_methods[] = { + + #if (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxDC) + { LuaConstructor, "wxBufferedDCFromBitmap", wxLua_wxBufferedDCFromBitmap_constructor, 3, 2, { &s_wxluatag_wxDC, &s_wxluatag_wxBitmap, &s_wxluaarg_Number, 0 } }, + { LuaMethod, "InitFromBitmap", wxLua_wxBufferedDC_InitFromBitmap, 3, 2, { &s_wxluatag_wxDC, &s_wxluatag_wxBitmap, &s_wxluaarg_Number, 0 } }, + #endif + + + #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxDC) + { LuaConstructor, "wxBufferedDCFromSize", wxLua_wxBufferedDCFromSize_constructor, 3, 2, { &s_wxluatag_wxDC, &s_wxluatag_wxSize, &s_wxluaarg_Number, 0 } }, + { LuaMethod, "Init", wxLua_wxBufferedDC_Init, 3, 2, { &s_wxluatag_wxDC, &s_wxluatag_wxSize, &s_wxluaarg_Number, 0 } }, + #endif + + { LuaConstructor, "wxBufferedDC", wxLua_wxBufferedDC_constructor, 0, 0, { 0 } }, + { LuaDelete, "wxBufferedDC", wxLua_wxBufferedDC_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxBufferedDC_Delete, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxBufferedDC_methods = s_wxBufferedDC_methods; + int wxBufferedDC_methodCount = sizeof(s_wxBufferedDC_methods)/sizeof(s_wxBufferedDC_methods[0]); + #endif + + + #if wxLUA_USE_wxDC + // ------------------------------------------... [truncated message content] |