From: John L. <jr...@us...> - 2007-02-22 00:01:42
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16385/wxLua/modules/wxbindstc/src Modified Files: stc.cpp Log Message: Added wxLuaState::GetwxStringType who's input is either a lua string or a wxString userdata Use it in bindings instead of GetStringType wxNode::IndexOf is now protected in wxWidgets 2.8 so remove it Index: stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/stc.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** stc.cpp 7 Feb 2007 18:39:12 -0000 1.22 --- stc.cpp 22 Feb 2007 00:01:36 -0000 1.23 *************** *** 141,145 **** wxLuaState wxlState(L); // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 141,145 ---- wxLuaState wxlState(L); // const wxString text ! const wxString text = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 156,160 **** wxLuaState wxlState(L); // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(3)); // int pos int pos = (int)wxlState.GetNumberType(2); --- 156,160 ---- wxLuaState wxlState(L); // const wxString text ! const wxString text = wxlState.GetwxStringType(3); // int pos int pos = (int)wxlState.GetNumberType(2); *************** *** 1005,1009 **** wxLuaState wxlState(L); // const wxString fontName ! const wxString fontName = lua2wx(wxlState.GetStringType(3)); // int style int style = (int)wxlState.GetNumberType(2); --- 1005,1009 ---- wxLuaState wxlState(L); // const wxString fontName ! const wxString fontName = wxlState.GetwxStringType(3); // int style int style = (int)wxlState.GetNumberType(2); *************** *** 1144,1148 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_SetStyleBytes[] = { &s_wxluaarg_Number, &s_wxluaarg_LightUserData, 0 }; // %override wxLua_wxStyledTextCtrl_SetStyleBytes // void SetStyleBytes(int length, const wxString &styleBytes) --- 1144,1148 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_SetStyleBytes[] = { &s_wxluaarg_Number, &s_wxluaarg_String, 0 }; // %override wxLua_wxStyledTextCtrl_SetStyleBytes // void SetStyleBytes(int length, const wxString &styleBytes) *************** *** 1217,1221 **** wxLuaState wxlState(L); // const wxString characters ! const wxString characters = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 1217,1221 ---- wxLuaState wxlState(L); // const wxString characters ! const wxString characters = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 1418,1422 **** wxLuaState wxlState(L); // const wxString itemList ! const wxString itemList = lua2wx(wxlState.GetStringType(3)); // int lenEntered int lenEntered = (int)wxlState.GetNumberType(2); --- 1418,1422 ---- wxLuaState wxlState(L); // const wxString itemList ! const wxString itemList = wxlState.GetwxStringType(3); // int lenEntered int lenEntered = (int)wxlState.GetNumberType(2); *************** *** 1489,1493 **** wxLuaState wxlState(L); // const wxString characterSet ! const wxString characterSet = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 1489,1493 ---- wxLuaState wxlState(L); // const wxString characterSet ! const wxString characterSet = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 1534,1538 **** wxLuaState wxlState(L); // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 1534,1538 ---- wxLuaState wxlState(L); // const wxString text ! const wxString text = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 1579,1583 **** wxLuaState wxlState(L); // const wxString characterSet ! const wxString characterSet = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 1579,1583 ---- wxLuaState wxlState(L); // const wxString characterSet ! const wxString characterSet = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 1654,1658 **** wxLuaState wxlState(L); // const wxString itemList ! const wxString itemList = lua2wx(wxlState.GetStringType(3)); // int listType int listType = (int)wxlState.GetNumberType(2); --- 1654,1658 ---- wxLuaState wxlState(L); // const wxString itemList ! const wxString itemList = wxlState.GetwxStringType(3); // int listType int listType = (int)wxlState.GetNumberType(2); *************** *** 2242,2246 **** int flags = (argCount >= 5 ? (int)wxlState.GetNumberType(5) : 0); // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(4)); // int maxPos int maxPos = (int)wxlState.GetNumberType(3); --- 2242,2246 ---- int flags = (argCount >= 5 ? (int)wxlState.GetNumberType(5) : 0); // const wxString text ! const wxString text = wxlState.GetwxStringType(4); // int maxPos int maxPos = (int)wxlState.GetNumberType(3); *************** *** 2518,2522 **** wxLuaState wxlState(L); // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 2518,2522 ---- wxLuaState wxlState(L); // const wxString text ! const wxString text = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 2650,2654 **** wxLuaState wxlState(L); // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 2650,2654 ---- wxLuaState wxlState(L); // const wxString text ! const wxString text = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 2816,2820 **** int returns; // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 2816,2820 ---- int returns; // const wxString text ! const wxString text = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 2834,2838 **** int returns; // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 2834,2838 ---- int returns; // const wxString text ! const wxString text = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 2852,2856 **** int returns; // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 2852,2856 ---- int returns; // const wxString text ! const wxString text = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 2899,2903 **** wxLuaState wxlState(L); // const wxString definition ! const wxString definition = lua2wx(wxlState.GetStringType(3)); // int pos int pos = (int)wxlState.GetNumberType(2); --- 2899,2903 ---- wxLuaState wxlState(L); // const wxString definition ! const wxString definition = wxlState.GetwxStringType(3); // int pos int pos = (int)wxlState.GetNumberType(2); *************** *** 3560,3564 **** int returns; // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(3)); // int style int style = (int)wxlState.GetNumberType(2); --- 3560,3564 ---- int returns; // const wxString text ! const wxString text = wxlState.GetwxStringType(3); // int style int style = (int)wxlState.GetNumberType(2); *************** *** 3657,3661 **** wxLuaState wxlState(L); // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 3657,3661 ---- wxLuaState wxlState(L); // const wxString text ! const wxString text = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 4653,4657 **** int returns; // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(3)); // int flags int flags = (int)wxlState.GetNumberType(2); --- 4653,4657 ---- int returns; // const wxString text ! const wxString text = wxlState.GetwxStringType(3); // int flags int flags = (int)wxlState.GetNumberType(2); *************** *** 4673,4677 **** int returns; // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(3)); // int flags int flags = (int)wxlState.GetNumberType(2); --- 4673,4677 ---- int returns; // const wxString text ! const wxString text = wxlState.GetwxStringType(3); // int flags int flags = (int)wxlState.GetNumberType(2); *************** *** 5303,5307 **** wxLuaState wxlState(L); // const wxString text ! const wxString text = lua2wx(wxlState.GetStringType(3)); // int length int length = (int)wxlState.GetNumberType(2); --- 5303,5307 ---- wxLuaState wxlState(L); // const wxString text ! const wxString text = wxlState.GetwxStringType(3); // int length int length = (int)wxlState.GetNumberType(2); *************** *** 5590,5594 **** wxLuaState wxlState(L); // const wxString characters ! const wxString characters = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 5590,5594 ---- wxLuaState wxlState(L); // const wxString characters ! const wxString characters = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 5822,5828 **** wxLuaState wxlState(L); // const wxString value ! const wxString value = lua2wx(wxlState.GetStringType(3)); // const wxString key ! const wxString key = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 5822,5828 ---- wxLuaState wxlState(L); // const wxString value ! const wxString value = wxlState.GetwxStringType(3); // const wxString key ! const wxString key = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 5839,5843 **** wxLuaState wxlState(L); // const wxString keyWords ! const wxString keyWords = lua2wx(wxlState.GetStringType(3)); // int keywordSet int keywordSet = (int)wxlState.GetNumberType(2); --- 5839,5843 ---- wxLuaState wxlState(L); // const wxString keyWords ! const wxString keyWords = wxlState.GetwxStringType(3); // int keywordSet int keywordSet = (int)wxlState.GetNumberType(2); *************** *** 5856,5860 **** wxLuaState wxlState(L); // const wxString language ! const wxString language = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 5856,5860 ---- wxLuaState wxlState(L); // const wxString language ! const wxString language = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 5872,5876 **** wxString returns; // const wxString key ! const wxString key = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 5872,5876 ---- wxString returns; // const wxString key ! const wxString key = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 5890,5894 **** wxString returns; // const wxString key ! const wxString key = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 5890,5894 ---- wxString returns; // const wxString key ! const wxString key = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 5908,5912 **** int returns; // const wxString key ! const wxString key = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 5908,5912 ---- int returns; // const wxString key ! const wxString key = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 5955,5959 **** wxLuaState wxlState(L); // const wxString spec ! const wxString spec = lua2wx(wxlState.GetStringType(3)); // int styleNum int styleNum = (int)wxlState.GetNumberType(2); --- 5955,5959 ---- wxLuaState wxlState(L); // const wxString spec ! const wxString spec = wxlState.GetwxStringType(3); // int styleNum int styleNum = (int)wxlState.GetNumberType(2); *************** *** 6125,6129 **** bool returns; // const wxString filename ! const wxString filename = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 6125,6129 ---- bool returns; // const wxString filename ! const wxString filename = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 6143,6147 **** bool returns; // const wxString filename ! const wxString filename = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 6143,6147 ---- bool returns; // const wxString filename ! const wxString filename = wxlState.GetwxStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 6184,6188 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_AddTextRaw[] = { &s_wxluaarg_LightUserData, 0 }; // void AddTextRaw(const char* text); static int LUACALL wxLua_wxStyledTextCtrl_AddTextRaw(lua_State *L) --- 6184,6188 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_AddTextRaw[] = { &s_wxluaarg_String, 0 }; // void AddTextRaw(const char* text); static int LUACALL wxLua_wxStyledTextCtrl_AddTextRaw(lua_State *L) *************** *** 6190,6194 **** wxLuaState wxlState(L); // const char text ! const char * text = (const char *)wxlState.ttouserdata(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); --- 6190,6194 ---- wxLuaState wxlState(L); // const char text ! wxCharBuffer text = wxlState.GetStringType(2); // get this wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); *************** *** 6199,6203 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_InsertTextRaw[] = { &s_wxluaarg_Number, &s_wxluaarg_LightUserData, 0 }; // void InsertTextRaw(int pos, const char* text); static int LUACALL wxLua_wxStyledTextCtrl_InsertTextRaw(lua_State *L) --- 6199,6203 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_InsertTextRaw[] = { &s_wxluaarg_Number, &s_wxluaarg_String, 0 }; // void InsertTextRaw(int pos, const char* text); static int LUACALL wxLua_wxStyledTextCtrl_InsertTextRaw(lua_State *L) *************** *** 6205,6209 **** wxLuaState wxlState(L); // const char text ! const char * text = (const char *)wxlState.ttouserdata(3); // int pos int pos = (int)wxlState.GetNumberType(2); --- 6205,6209 ---- wxLuaState wxlState(L); // const char text ! wxCharBuffer text = wxlState.GetStringType(3); // int pos int pos = (int)wxlState.GetNumberType(2); *************** *** 6674,6678 **** bool bold = wxlState.GetBooleanType(5); // const wxString faceName ! const wxString faceName = lua2wx(wxlState.GetStringType(4)); // int size int size = (int)wxlState.GetNumberType(3); --- 6674,6678 ---- bool bold = wxlState.GetBooleanType(5); // const wxString faceName ! const wxString faceName = wxlState.GetwxStringType(4); // int size int size = (int)wxlState.GetNumberType(3); *************** *** 6717,6721 **** int argCount = lua_gettop(L); // const wxString name = "wxStyledTextCtrl" ! const wxString name = (argCount >= 6 ? lua2wx(wxlState.GetStringType(6)) : wxString(wxT("wxStyledTextCtrl"))); // long style = 0 long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : 0); --- 6717,6721 ---- int argCount = lua_gettop(L); // const wxString name = "wxStyledTextCtrl" ! const wxString name = (argCount >= 6 ? wxlState.GetwxStringType(6) : wxString(wxT("wxStyledTextCtrl"))); // long style = 0 long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : 0); *************** *** 7509,7513 **** wxLuaState wxlState(L); // const wxString t ! const wxString t = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextEvent); --- 7509,7513 ---- wxLuaState wxlState(L); // const wxString t ! const wxString t = wxlState.GetwxStringType(2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextEvent); *************** *** 7704,7708 **** wxLuaState wxlState(L); // const wxString val ! const wxString val = lua2wx(wxlState.GetStringType(2)); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextEvent); --- 7704,7708 ---- wxLuaState wxlState(L); // const wxString val ! const wxString val = wxlState.GetwxStringType(2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextEvent); |