From: John L. <jr...@us...> - 2007-06-12 00:08:45
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/modules/wxbindstc/src Modified Files: stc.cpp Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/stc.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** stc.cpp 8 Jun 2007 01:36:30 -0000 1.37 --- stc.cpp 12 Jun 2007 00:08:41 -0000 1.38 *************** *** 7224,7228 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontAttr[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxStyledTextCtrl_StyleSetFontAttr(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextCtrl_StyleSetFontAttr[1] = {{ wxLua_wxStyledTextCtrl_StyleSetFontAttr, WXLUAMETHOD_METHOD, 7, 8, s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontAttr }}; --- 7224,7228 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontAttr[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxStyledTextCtrl_StyleSetFontAttr(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextCtrl_StyleSetFontAttr[1] = {{ wxLua_wxStyledTextCtrl_StyleSetFontAttr, WXLUAMETHOD_METHOD, 7, 8, s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontAttr }}; *************** *** 7234,7238 **** int argCount = lua_gettop(L); // wxFontEncoding encoding = wxFONTENCODING_DEFAULT ! wxFontEncoding encoding = (argCount >= 8 ? (wxFontEncoding)wxlua_getenumerationtype(L, 8) : wxFONTENCODING_DEFAULT); // bool underline bool underline = wxlua_getbooleantype(L, 7); --- 7234,7238 ---- int argCount = lua_gettop(L); // wxFontEncoding encoding = wxFONTENCODING_DEFAULT ! wxFontEncoding encoding = (argCount >= 8 ? (wxFontEncoding)wxlua_getintegertype(L, 8) : wxFONTENCODING_DEFAULT); // bool underline bool underline = wxlua_getbooleantype(L, 7); *************** *** 7255,7259 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontEncoding[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_Number, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxStyledTextCtrl_StyleSetFontEncoding(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextCtrl_StyleSetFontEncoding[1] = {{ wxLua_wxStyledTextCtrl_StyleSetFontEncoding, WXLUAMETHOD_METHOD, 3, 3, s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontEncoding }}; --- 7255,7259 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontEncoding[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_Number, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxStyledTextCtrl_StyleSetFontEncoding(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextCtrl_StyleSetFontEncoding[1] = {{ wxLua_wxStyledTextCtrl_StyleSetFontEncoding, WXLUAMETHOD_METHOD, 3, 3, s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontEncoding }}; *************** *** 7263,7267 **** wxLuaState wxlState(L); // wxFontEncoding encoding ! wxFontEncoding encoding = (wxFontEncoding)wxlua_getenumerationtype(L, 3); // int style int style = (int)wxlua_getnumbertype(L, 2); --- 7263,7267 ---- wxLuaState wxlState(L); // wxFontEncoding encoding ! wxFontEncoding encoding = (wxFontEncoding)wxlua_getintegertype(L, 3); // int style int style = (int)wxlua_getnumbertype(L, 2); *************** *** 7978,7984 **** // call constructor returns = new wxStyledTextCtrl(parent, id, *pos, *size, style, name); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextCtrl, returns); --- 7978,7983 ---- // call constructor returns = new wxStyledTextCtrl(parent, id, *pos, *size, style, name); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextCtrl, returns); *************** *** 9013,9017 **** #if wxLUA_USE_wxDragDrop && wxUSE_DRAG_AND_DROP ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextEvent_SetDragResult[] = { &s_wxluatag_wxStyledTextEvent, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxStyledTextEvent_SetDragResult(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextEvent_SetDragResult[1] = {{ wxLua_wxStyledTextEvent_SetDragResult, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStyledTextEvent_SetDragResult }}; --- 9012,9016 ---- #if wxLUA_USE_wxDragDrop && wxUSE_DRAG_AND_DROP ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextEvent_SetDragResult[] = { &s_wxluatag_wxStyledTextEvent, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxStyledTextEvent_SetDragResult(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextEvent_SetDragResult[1] = {{ wxLua_wxStyledTextEvent_SetDragResult, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStyledTextEvent_SetDragResult }}; *************** *** 9021,9025 **** wxLuaState wxlState(L); // wxDragResult val ! wxDragResult val = (wxDragResult)wxlua_getenumerationtype(L, 2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextEvent); --- 9020,9024 ---- wxLuaState wxlState(L); // wxDragResult val ! wxDragResult val = (wxDragResult)wxlua_getintegertype(L, 2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextEvent); *************** *** 9356,9360 **** returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxlState.AddTrackedObject((wxStyledTextEvent *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextEvent, returns); --- 9355,9359 ---- returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextEvent, returns); |