From: John L. <jr...@us...> - 2007-03-09 06:10:24
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16936/wxLua/modules/wxbind/src Modified Files: config.cpp controls.cpp data.cpp event.cpp wx_bind.cpp Log Message: update to wxWidgets 2.8 using C++ headers Make wxConfig::Read return [bool, value] not the other way around Index: event.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/event.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** event.cpp 9 Mar 2007 00:15:15 -0000 1.36 --- event.cpp 9 Mar 2007 06:10:18 -0000 1.37 *************** *** 667,670 **** --- 667,792 ---- // --------------------------------------------------------------------------- + // Bind class wxPropagationDisabler + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxPropagationDisabler' + int s_wxluatag_wxPropagationDisabler = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxPropagationDisabler_constructor[] = { &s_wxluatag_wxEvent, 0 }; + // wxPropagationDisabler(wxEvent& event) + static int LUACALL wxLua_wxPropagationDisabler_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxPropagationDisabler *returns; + // wxEvent event + wxEvent * event = (wxEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxEvent); + // call constructor + returns = new wxPropagationDisabler(*event); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxPropagationDisabler *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxPropagationDisabler, returns); + + return 1; + } + + static int LUACALL wxLua_wxPropagationDisabler_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxPropagationDisabler * self = (wxPropagationDisabler *)wxlState.GetUserDataType(1, s_wxluatag_wxPropagationDisabler); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedObject(self); + return 0; + } + + static int LUACALL wxLua_wxPropagationDisabler_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxPropagationDisabler * self = (wxPropagationDisabler *)wxlState.GetUserDataType(1, s_wxluatag_wxPropagationDisabler); + // remove from tracked memory list + if (self != 0) + if (wxlState.RemoveTrackedObject(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 + WXLUAMETHOD wxPropagationDisabler_methods[] = { + { LuaConstructor, "wxPropagationDisabler", wxLua_wxPropagationDisabler_constructor, 1, 1, s_wxluatagArray_wxLua_wxPropagationDisabler_constructor }, + { LuaDelete, "wxPropagationDisabler", wxLua_wxPropagationDisabler_destructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxPropagationDisabler_Delete, 0, 0, s_wxluaargArray_None }, + }; + + int wxPropagationDisabler_methodCount = sizeof(wxPropagationDisabler_methods)/sizeof(wxPropagationDisabler_methods[0]); + + // --------------------------------------------------------------------------- + // Bind class wxPropagateOnce + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxPropagateOnce' + int s_wxluatag_wxPropagateOnce = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxPropagateOnce_constructor[] = { &s_wxluatag_wxEvent, 0 }; + // wxPropagateOnce(wxEvent& event) + static int LUACALL wxLua_wxPropagateOnce_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxPropagateOnce *returns; + // wxEvent event + wxEvent * event = (wxEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxEvent); + // call constructor + returns = new wxPropagateOnce(*event); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxPropagateOnce *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxPropagateOnce, returns); + + return 1; + } + + static int LUACALL wxLua_wxPropagateOnce_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxPropagateOnce * self = (wxPropagateOnce *)wxlState.GetUserDataType(1, s_wxluatag_wxPropagateOnce); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedObject(self); + return 0; + } + + static int LUACALL wxLua_wxPropagateOnce_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxPropagateOnce * self = (wxPropagateOnce *)wxlState.GetUserDataType(1, s_wxluatag_wxPropagateOnce); + // remove from tracked memory list + if (self != 0) + if (wxlState.RemoveTrackedObject(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 + WXLUAMETHOD wxPropagateOnce_methods[] = { + { LuaConstructor, "wxPropagateOnce", wxLua_wxPropagateOnce_constructor, 1, 1, s_wxluatagArray_wxLua_wxPropagateOnce_constructor }, + { LuaDelete, "wxPropagateOnce", wxLua_wxPropagateOnce_destructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxPropagateOnce_Delete, 0, 0, s_wxluaargArray_None }, + }; + + int wxPropagateOnce_methodCount = sizeof(wxPropagateOnce_methods)/sizeof(wxPropagateOnce_methods[0]); + + // --------------------------------------------------------------------------- // Bind class wxCommandEvent // --------------------------------------------------------------------------- *************** *** 710,713 **** --- 832,850 ---- } + // %rename GetStringClientObject wxStringClientData* GetClientObject() + static int LUACALL wxLua_wxCommandEvent_GetStringClientObject(lua_State *L) + { + wxLuaState wxlState(L); + wxStringClientData *returns; + // get this + wxCommandEvent * self = (wxCommandEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandEvent); + // call GetClientObject + returns = (wxStringClientData *)self->GetClientObject(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxStringClientData, returns); + + return 1; + } + // long GetExtraLong() static int LUACALL wxLua_wxCommandEvent_GetExtraLong(lua_State *L) *************** *** 911,914 **** --- 1048,1052 ---- { LuaConstructor, "wxCommandEvent", wxLua_wxCommandEvent_constructor, 2, 0, s_wxluatagArray_wxLua_wxCommandEvent_constructor }, { LuaMethod, "GetClientObject", wxLua_wxCommandEvent_GetClientObject, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetStringClientObject", wxLua_wxCommandEvent_GetStringClientObject, 0, 0, s_wxluaargArray_None }, { LuaMethod, "GetExtraLong", wxLua_wxCommandEvent_GetExtraLong, 0, 0, s_wxluaargArray_None }, { LuaMethod, "GetInt", wxLua_wxCommandEvent_GetInt, 0, 0, s_wxluaargArray_None }, *************** *** 4684,4687 **** --- 4822,4874 ---- + #if wxCHECK_VERSION(2,8,0) + // %wxchkver_2_8 bool GetShown() const + static int LUACALL wxLua_wxUpdateUIEvent_GetShown(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxUpdateUIEvent * self = (wxUpdateUIEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxUpdateUIEvent); + // call GetShown + returns = self->GetShown(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // %wxchkver_2_8 bool GetSetShown() const + static int LUACALL wxLua_wxUpdateUIEvent_GetSetShown(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxUpdateUIEvent * self = (wxUpdateUIEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxUpdateUIEvent); + // call GetSetShown + returns = self->GetSetShown(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxUpdateUIEvent_Show[] = { &s_wxluaarg_Boolean, 0 }; + // %wxchkver_2_8 void Show(bool show) + static int LUACALL wxLua_wxUpdateUIEvent_Show(lua_State *L) + { + wxLuaState wxlState(L); + // bool show + bool show = wxlState.GetBooleanType(2); + // get this + wxUpdateUIEvent * self = (wxUpdateUIEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxUpdateUIEvent); + // call Show + self->Show(show); + + return 0; + } + + #endif // wxCHECK_VERSION(2,8,0) + + // Map Lua Class Methods to C Binding Functions *************** *** 4712,4715 **** --- 4899,4909 ---- { LuaDelete, "wxUpdateUIEvent", wxLua_wxUpdateUIEvent_destructor, 0, 0, s_wxluaargArray_None }, { LuaMethod, "Delete", wxLua_wxUpdateUIEvent_Delete, 0, 0, s_wxluaargArray_None }, + + #if wxCHECK_VERSION(2,8,0) + { LuaMethod, "GetShown", wxLua_wxUpdateUIEvent_GetShown, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetSetShown", wxLua_wxUpdateUIEvent_GetSetShown, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Show", wxLua_wxUpdateUIEvent_Show, 1, 1, s_wxluatagArray_wxLua_wxUpdateUIEvent_Show }, + #endif // wxCHECK_VERSION(2,8,0) + }; *************** *** 4723,4726 **** --- 4917,4978 ---- int s_wxluatag_wxHelpEvent = -1; + + #if (!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxPointSizeRect) + static wxLuaArgTag s_wxluatagArray_wxLua_wxHelpEvent_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluatag_wxPoint, 0 }; + // !%wxchkver_2_8 wxHelpEvent(wxEventType type = wxEVT_NULL, wxWindowID id = 0, const wxPoint& pt = wxDefaultPosition) + static int LUACALL wxLua_wxHelpEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxHelpEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxPoint pt = wxDefaultPosition + const wxPoint * pt = (argCount >= 3 ? (const wxPoint *)wxlState.GetUserDataType(3, s_wxluatag_wxPoint) : &wxDefaultPosition); + // wxWindowID id = 0 + wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlState.GetNumberType(2) : 0); + // wxEventType type = wxEVT_NULL + wxEventType type = (argCount >= 1 ? (wxEventType)wxlState.GetNumberType(1) : wxEVT_NULL); + // call constructor + returns = new wxHelpEvent(type, id, *pt); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxHelpEvent *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxHelpEvent, returns); + + return 1; + } + + #endif // (!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxPointSizeRect) + + + #if (wxLUA_USE_wxPointSizeRect) && (wxCHECK_VERSION(2,8,0)) + static wxLuaArgTag s_wxluatagArray_wxLua_wxHelpEvent_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluatag_wxPoint, &s_wxluaarg_Enumeration, 0 }; + // %wxchkver_2_8 wxHelpEvent(wxEventType type = wxEVT_NULL, wxWindowID id = 0, const wxPoint& pt = wxDefaultPosition, wxHelpEvent::Origin origin = wxHelpEvent::Origin_Unknown) + static int LUACALL wxLua_wxHelpEvent_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxHelpEvent *returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxHelpEvent::Origin origin = wxHelpEvent::Origin_Unknown + wxHelpEvent::Origin origin = (argCount >= 4 ? (wxHelpEvent::Origin)wxlState.GetEnumerationType(4) : wxHelpEvent::Origin_Unknown); + // const wxPoint pt = wxDefaultPosition + const wxPoint * pt = (argCount >= 3 ? (const wxPoint *)wxlState.GetUserDataType(3, s_wxluatag_wxPoint) : &wxDefaultPosition); + // wxWindowID id = 0 + wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlState.GetNumberType(2) : 0); + // wxEventType type = wxEVT_NULL + wxEventType type = (argCount >= 1 ? (wxEventType)wxlState.GetNumberType(1) : wxEVT_NULL); + // call constructor + returns = new wxHelpEvent(type, id, *pt, origin); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxHelpEvent *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxHelpEvent, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxPointSizeRect) && (wxCHECK_VERSION(2,8,0)) + // wxString GetLink() static int LUACALL wxLua_wxHelpEvent_GetLink(lua_State *L) *************** *** 4809,4837 **** ! #if wxLUA_USE_wxPointSizeRect ! static wxLuaArgTag s_wxluatagArray_wxLua_wxHelpEvent_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluatag_wxPoint, 0 }; ! // wxHelpEvent(wxEventType type = wxEVT_NULL, wxWindowID id = 0, const wxPoint& pt = wxDefaultPosition) ! static int LUACALL wxLua_wxHelpEvent_constructor(lua_State *L) { wxLuaState wxlState(L); ! wxHelpEvent *returns; ! // get number of arguments ! int argCount = lua_gettop(L); ! // const wxPoint pt = wxDefaultPosition ! const wxPoint * pt = (argCount >= 3 ? (const wxPoint *)wxlState.GetUserDataType(3, s_wxluatag_wxPoint) : &wxDefaultPosition); ! // wxWindowID id = 0 ! wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlState.GetNumberType(2) : 0); ! // wxEventType type = wxEVT_NULL ! wxEventType type = (argCount >= 1 ? (wxEventType)wxlState.GetNumberType(1) : wxEVT_NULL); ! // call constructor ! returns = new wxHelpEvent(type, id, *pt); ! // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxHelpEvent *)returns); ! // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxHelpEvent, returns); return 1; } // wxPoint GetPosition() static int LUACALL wxLua_wxHelpEvent_GetPosition(lua_State *L) --- 5061,5099 ---- ! #if wxCHECK_VERSION(2,8,0) ! // %wxchkver_2_8 wxHelpEvent::Origin GetOrigin() const ! static int LUACALL wxLua_wxHelpEvent_GetOrigin(lua_State *L) { wxLuaState wxlState(L); ! wxHelpEvent::Origin returns; ! // get this ! wxHelpEvent * self = (wxHelpEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxHelpEvent); ! // call GetOrigin ! returns = self->GetOrigin(); ! // push the result number ! lua_pushnumber(L, returns); return 1; } + static wxLuaArgTag s_wxluatagArray_wxLua_wxHelpEvent_SetOrigin[] = { &s_wxluaarg_Enumeration, 0 }; + // %wxchkver_2_8 void SetOrigin(wxHelpEvent::Origin origin) + static int LUACALL wxLua_wxHelpEvent_SetOrigin(lua_State *L) + { + wxLuaState wxlState(L); + // wxHelpEvent::Origin origin + wxHelpEvent::Origin origin = (wxHelpEvent::Origin)wxlState.GetEnumerationType(2); + // get this + wxHelpEvent * self = (wxHelpEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxHelpEvent); + // call SetOrigin + self->SetOrigin(origin); + + return 0; + } + + #endif // wxCHECK_VERSION(2,8,0) + + + #if wxLUA_USE_wxPointSizeRect // wxPoint GetPosition() static int LUACALL wxLua_wxHelpEvent_GetPosition(lua_State *L) *************** *** 4873,4876 **** --- 5135,5148 ---- // Map Lua Class Methods to C Binding Functions WXLUAMETHOD wxHelpEvent_methods[] = { + + #if (!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxPointSizeRect) + { LuaConstructor, "wxHelpEvent", wxLua_wxHelpEvent_constructor, 3, 0, s_wxluatagArray_wxLua_wxHelpEvent_constructor }, + #endif // (!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxPointSizeRect) + + + #if (wxLUA_USE_wxPointSizeRect) && (wxCHECK_VERSION(2,8,0)) + { LuaConstructor, "wxHelpEvent", wxLua_wxHelpEvent_constructor, 4, 0, s_wxluatagArray_wxLua_wxHelpEvent_constructor }, + #endif // (wxLUA_USE_wxPointSizeRect) && (wxCHECK_VERSION(2,8,0)) + { LuaMethod, "GetLink", wxLua_wxHelpEvent_GetLink, 0, 0, s_wxluaargArray_None }, { LuaMethod, "GetTarget", wxLua_wxHelpEvent_GetTarget, 0, 0, s_wxluaargArray_None }, *************** *** 4884,4889 **** { LuaMethod, "Delete", wxLua_wxHelpEvent_Delete, 0, 0, s_wxluaargArray_None }, #if wxLUA_USE_wxPointSizeRect - { LuaConstructor, "wxHelpEvent", wxLua_wxHelpEvent_constructor, 3, 0, s_wxluatagArray_wxLua_wxHelpEvent_constructor }, { LuaMethod, "GetPosition", wxLua_wxHelpEvent_GetPosition, 0, 0, s_wxluaargArray_None }, { LuaMethod, "SetPosition", wxLua_wxHelpEvent_SetPosition, 1, 1, s_wxluatagArray_wxLua_wxHelpEvent_SetPosition }, --- 5156,5166 ---- { LuaMethod, "Delete", wxLua_wxHelpEvent_Delete, 0, 0, s_wxluaargArray_None }, + #if wxCHECK_VERSION(2,8,0) + { LuaMethod, "GetOrigin", wxLua_wxHelpEvent_GetOrigin, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetOrigin", wxLua_wxHelpEvent_SetOrigin, 1, 1, s_wxluatagArray_wxLua_wxHelpEvent_SetOrigin }, + #endif // wxCHECK_VERSION(2,8,0) + + #if wxLUA_USE_wxPointSizeRect { LuaMethod, "GetPosition", wxLua_wxHelpEvent_GetPosition, 0, 0, s_wxluaargArray_None }, { LuaMethod, "SetPosition", wxLua_wxHelpEvent_SetPosition, 1, 1, s_wxluatagArray_wxLua_wxHelpEvent_SetPosition }, Index: data.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/data.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** data.cpp 9 Mar 2007 00:15:14 -0000 1.36 --- data.cpp 9 Mar 2007 06:10:18 -0000 1.37 *************** *** 808,812 **** } - private: wxString valString; }; --- 808,811 ---- Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** wx_bind.cpp 9 Mar 2007 00:15:17 -0000 1.83 --- wx_bind.cpp 9 Mar 2007 06:10:18 -0000 1.84 *************** *** 1426,1433 **** #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxAcceleratorTable && wxUSE_ACCEL) - #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxConfig && wxUSE_CONFIG) - { "wxCONFIG_USE_SUBDIR", wxCONFIG_USE_SUBDIR }, - #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxConfig && wxUSE_CONFIG) - #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDC) { "wxLayout_Default", wxLayout_Default }, --- 1426,1429 ---- *************** *** 1457,1460 **** --- 1453,1460 ---- #endif // (wxCHECK_VERSION(2,8,0)) && (wxUSE_HOTKEY) + #if (wxCHECK_VERSION(2,8,1)) && (wxLUA_USE_wxConfig && wxUSE_CONFIG) + { "wxCONFIG_USE_SUBDIR", wxCONFIG_USE_SUBDIR }, + #endif // (wxCHECK_VERSION(2,8,1)) && (wxLUA_USE_wxConfig && wxUSE_CONFIG) + #if (wxLUA_USE_wxLuaPrintout) && (wxLUA_USE_wxPrint && wxUSE_PRINTING_ARCHITECTURE) { "wxPRINTER_CANCELLED", wxPRINTER_CANCELLED }, *************** *** 1666,1669 **** --- 1666,1671 ---- { "wxDOWN", wxDOWN }, { "wxEAST", wxEAST }, + { "wxEVENT_PROPAGATE_MAX", wxEVENT_PROPAGATE_MAX }, + { "wxEVENT_PROPAGATE_NONE", wxEVENT_PROPAGATE_NONE }, { "wxEXPAND", wxEXPAND }, { "wxFILE_MUST_EXIST", wxFILE_MUST_EXIST }, *************** *** 4667,4670 **** --- 4669,4692 ---- #endif // wxCHECK_VERSION(2,7,0) + #if wxCHECK_VERSION(2,8,0) + + static wxLuaArgTag s_wxluatagArray_wxLua_function_wxFindFocusDescendant[] = { &s_wxluatag_wxWindow, 0 }; + // %wxchkver_2_8 %function wxWindow* wxFindFocusDescendant(wxWindow* ancestor) + static int LUACALL wxLua_function_wxFindFocusDescendant(lua_State *L) + { + wxLuaState wxlState(L); + wxWindow *returns; + // wxWindow ancestor + wxWindow * ancestor = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call wxFindFocusDescendant + returns = (wxWindow *)wxFindFocusDescendant(ancestor); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWindow, returns); + + return 1; + } + + #endif // wxCHECK_VERSION(2,8,0) + #if wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog *************** *** 5572,5575 **** --- 5594,5602 ---- + #if wxCHECK_VERSION(2,8,0) + { LuaGlobal, "wxFindFocusDescendant", wxLua_function_wxFindFocusDescendant, 1, 1, s_wxluatagArray_wxLua_function_wxFindFocusDescendant }, + #endif // wxCHECK_VERSION(2,8,0) + + #if wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog { LuaGlobal, "wxAboutBox", wxLua_function_wxAboutBox, 1, 1, s_wxluatagArray_wxLua_function_wxAboutBox }, *************** *** 5920,5923 **** --- 5947,5952 ---- { "wxPanel", wxPanel_methods, wxPanel_methodCount, CLASSINFO(wxPanel), &s_wxluatag_wxPanel, "wxWindow", NULL }, { "wxProcessEvent", wxProcessEvent_methods, wxProcessEvent_methodCount, CLASSINFO(wxProcessEvent), &s_wxluatag_wxProcessEvent, "wxEvent", NULL }, + { "wxPropagateOnce", wxPropagateOnce_methods, wxPropagateOnce_methodCount, NULL, &s_wxluatag_wxPropagateOnce, NULL, NULL }, + { "wxPropagationDisabler", wxPropagationDisabler_methods, wxPropagationDisabler_methodCount, NULL, &s_wxluatag_wxPropagationDisabler, NULL, NULL }, { "wxQueryNewPaletteEvent", wxQueryNewPaletteEvent_methods, wxQueryNewPaletteEvent_methodCount, CLASSINFO(wxQueryNewPaletteEvent), &s_wxluatag_wxQueryNewPaletteEvent, "wxEvent", NULL }, { "wxScrollEvent", wxScrollEvent_methods, wxScrollEvent_methodCount, CLASSINFO(wxScrollEvent), &s_wxluatag_wxScrollEvent, "wxCommandEvent", NULL }, *************** *** 6846,6849 **** --- 6875,6880 ---- #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDataObject && wxUSE_DATAOBJ) + wxLUA_IMPLEMENT_ENCAPSULATION(wxPropagateOnce, wxPropagateOnce) + wxLUA_IMPLEMENT_ENCAPSULATION(wxPropagationDisabler, wxPropagationDisabler) wxLUA_IMPLEMENT_ENCAPSULATION(wxString, wxString) wxLUA_IMPLEMENT_ENCAPSULATION(wxWindowDisabler, wxWindowDisabler) Index: controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/controls.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** controls.cpp 9 Mar 2007 00:15:13 -0000 1.45 --- controls.cpp 9 Mar 2007 06:10:17 -0000 1.46 *************** *** 1020,1024 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxControlWithItems_GetStringClientObject[] = { &s_wxluaarg_Number, 0 }; - // %override wxLua_wxControlWithItems_GetStringClientObject // %rename GetStringClientObject wxStringClientData* GetClientObject(int n) const static int LUACALL wxLua_wxControlWithItems_GetStringClientObject(lua_State *L) --- 1020,1023 ---- *************** *** 1031,1035 **** wxControlWithItems * self = (wxControlWithItems *)wxlState.GetUserDataType(1, s_wxluatag_wxControlWithItems); // call GetClientObject ! returns = (wxStringClientData*)self->GetClientObject(n); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxStringClientData, returns); --- 1030,1034 ---- wxControlWithItems * self = (wxControlWithItems *)wxlState.GetUserDataType(1, s_wxluatag_wxControlWithItems); // call GetClientObject ! returns = (wxStringClientData *)self->GetClientObject(n); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxStringClientData, returns); *************** *** 3776,3793 **** // %override wxLua_wxListCtrl_SortItems ! static int wxLua_LCF_tag = -1; ! static wxLuaState wxLua_LCF_wxlState; int wxCALLBACK wxLua_ListCompareFunction(long item1, long item2, long sortData) { ! lua_State *L = wxLua_LCF_wxlState.GetLuaState(); ! lua_rawgeti(L, LUA_REGISTRYINDEX, wxLua_LCF_tag); lua_pushnumber(L, item1); lua_pushnumber(L, item2); ! lua_pushnumber(L, sortData); ! wxLua_LCF_wxlState.LuaCall(3, 1); ! int returns = (int)wxLua_LCF_wxlState.GetNumberType(1); ! return returns; } --- 3775,3798 ---- // %override wxLua_wxListCtrl_SortItems ! ! struct wxLua_LCF_data // wrap up the wxLuaState, lua_tag, and the compare data ! { ! wxLuaState* wxlState; ! int lua_tag; ! long data; ! }; int wxCALLBACK wxLua_ListCompareFunction(long item1, long item2, long sortData) { ! wxLua_LCF_data* LCF_data = (wxLua_LCF_data*)sortData; ! ! lua_State *L = LCF_data->wxlState->GetLuaState(); ! lua_rawgeti(L, LUA_REGISTRYINDEX, LCF_data->lua_tag); lua_pushnumber(L, item1); lua_pushnumber(L, item2); ! lua_pushnumber(L, LCF_data->data); ! LCF_data->wxlState->LuaCall(3, 1); ! return (int)LCF_data->wxlState->GetNumberType(1); } *************** *** 3796,3803 **** { wxLuaState wxlState(L); - wxLua_LCF_wxlState = wxlState; long returns; // long data long data = (long)wxlState.GetNumberType(3); // get this wxListCtrl *self = (wxListCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxListCtrl); --- 3801,3808 ---- { wxLuaState wxlState(L); long returns; // long data long data = (long)wxlState.GetNumberType(3); + wxLua_LCF_data LCF_data = { &wxlState, -1, data }; // get this wxListCtrl *self = (wxListCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxListCtrl); *************** *** 3806,3818 **** // lua sort function, was index 2 is now index 1 if (lua_isfunction (L, 1)) ! wxLua_LCF_tag = luaL_ref(L, LUA_REGISTRYINDEX); // pops it from stack else ! wxlState.terror(wxString::Format(_("wxLua: Expected lua function for parameter %d, but got '%s'."), 2, wxlState.lua_TypeNameIndex(1).c_str())); // call SortItems ! returns = self->SortItems(wxLua_ListCompareFunction, data); ! wxLua_LCF_wxlState.Destroy(); ! wxLua_LCF_tag = -1; // push the result number lua_pushnumber(L, returns); --- 3811,3821 ---- // lua sort function, was index 2 is now index 1 if (lua_isfunction (L, 1)) ! LCF_data.lua_tag = luaL_ref(L, LUA_REGISTRYINDEX); // pops it from stack else ! wxlState.terror(wxString::Format(_("wxLua: Expected lua function(long item1, long item2, long data) for parameter %d, but got '%s'."), 2, wxlState.lua_TypeNameIndex(1).c_str())); // call SortItems ! returns = self->SortItems(wxLua_ListCompareFunction, (long)&LCF_data); // push the result number lua_pushnumber(L, returns); Index: config.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/config.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** config.cpp 9 Mar 2007 00:15:13 -0000 1.29 --- config.cpp 9 Mar 2007 06:10:17 -0000 1.30 *************** *** 508,515 **** // call Read bool ret = self->Read(key, &returns, defaultVal); - // push the result number - wxlState.lua_PushString(returns); // push the result bool lua_pushboolean(L, ret); // return the number of parameters return 2; --- 508,515 ---- // call Read bool ret = self->Read(key, &returns, defaultVal); // push the result bool lua_pushboolean(L, ret); + // push the result string + wxlState.lua_PushString(returns); // return the number of parameters return 2; *************** *** 533,540 **** // call Read bool ret = self->Read(key, &returns, defaultVal); - // push the result number - lua_pushnumber(L, returns); // push the result bool lua_pushboolean(L, ret); // return the number of parameters return 2; --- 533,540 ---- // call Read bool ret = self->Read(key, &returns, defaultVal); // push the result bool lua_pushboolean(L, ret); + // push the result number + lua_pushnumber(L, returns); // return the number of parameters return 2; *************** *** 558,565 **** // call Read bool ret = self->Read(key, &returns, defaultVal); - // push the result number - lua_pushnumber(L, returns); // push the result bool lua_pushboolean(L, ret); // return the number of parameters return 2; --- 558,565 ---- // call Read bool ret = self->Read(key, &returns, defaultVal); // push the result bool lua_pushboolean(L, ret); + // push the result number + lua_pushnumber(L, returns); // return the number of parameters return 2; |