From: John L. <jr...@us...> - 2007-02-22 05:40:56
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28638/wxLua/bindings/wxwidgets Modified Files: override.hpp Log Message: use wxLuaState::GetwxStringType instead of lua2wx use wxLuaState::lua_PushString instead of wx2lua fix name == nil when adding notebook page to the wxLua editor Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/override.hpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** override.hpp 21 Jan 2007 23:13:06 -0000 1.59 --- override.hpp 22 Feb 2007 05:40:52 -0000 1.60 *************** *** 369,373 **** for (idx = 0; idx < numFiles; ++idx) { ! lua_pushstring(L, wx2lua(files[idx])); lua_rawseti(L, -2, idx + 1); } --- 369,373 ---- for (idx = 0; idx < numFiles; ++idx) { ! wxlState.lua_PushString(files[idx]); lua_rawseti(L, -2, idx + 1); } *************** *** 427,437 **** long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE); // const wxString& globalFilename = "" ! wxString globalFilename = (argCount >= 4 ? lua2wx(lua_tostring(L, 4)) : wxString(wxEmptyString)); // const wxString& localFilename = "", ! wxString localFilename = (argCount >= 3 ? lua2wx(lua_tostring(L, 3)) : wxString(wxEmptyString)); // const wxString& vendorName = "" ! wxString vendorName = (argCount >= 2 ? lua2wx(lua_tostring(L, 2)) : wxString(wxEmptyString)); // const wxString& appName = "" ! wxString appName = (argCount >= 1 ? lua2wx(lua_tostring(L, 1)) : wxString(wxEmptyString)); // call constructor returns = (wxConfigBase*)new wxFileConfig(appName, vendorName, localFilename, globalFilename, style); --- 427,437 ---- long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE); // const wxString& globalFilename = "" ! wxString globalFilename = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); // const wxString& localFilename = "", ! wxString localFilename = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // const wxString& vendorName = "" ! wxString vendorName = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxEmptyString)); // const wxString& appName = "" ! wxString appName = (argCount >= 1 ? wxlState.GetwxStringType(1) : wxString(wxEmptyString)); // call constructor returns = (wxConfigBase*)new wxFileConfig(appName, vendorName, localFilename, globalFilename, style); *************** *** 467,473 **** int argCount = lua_gettop(L); // wxString defaultVal ! wxString defaultVal = (argCount >= 3 ? lua2wx(wxlState.GetStringType(3)) : wxString(wxEmptyString)); // const wxString& key ! wxString key = lua2wx(wxlState.GetStringType(2)); // get this wxConfigBase *self = (wxConfigBase *)wxlState.GetUserDataType(1, s_wxluatag_wxConfigBase); --- 467,473 ---- int argCount = lua_gettop(L); // wxString defaultVal ! wxString defaultVal = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // const wxString& key ! wxString key = wxlState.GetwxStringType(2); // get this wxConfigBase *self = (wxConfigBase *)wxlState.GetUserDataType(1, s_wxluatag_wxConfigBase); *************** *** 475,479 **** bool ret = self->Read(key, &returns, defaultVal); // push the result number ! lua_pushstring(L, wx2lua(returns)); // push the result bool lua_pushboolean(L, ret); --- 475,479 ---- bool ret = self->Read(key, &returns, defaultVal); // push the result number ! wxlState.lua_PushString(returns); // push the result bool lua_pushboolean(L, ret); *************** *** 494,498 **** long defaultVal = (argCount >= 3 ? (long)wxlState.GetNumberType(3) : 0); // const wxString& key ! wxString key = lua2wx(wxlState.GetStringType(2)); // get this wxConfigBase *self = (wxConfigBase *)wxlState.GetUserDataType(1, s_wxluatag_wxConfigBase); --- 494,498 ---- long defaultVal = (argCount >= 3 ? (long)wxlState.GetNumberType(3) : 0); // const wxString& key ! wxString key = wxlState.GetwxStringType(2); // get this wxConfigBase *self = (wxConfigBase *)wxlState.GetUserDataType(1, s_wxluatag_wxConfigBase); *************** *** 519,523 **** double defaultVal = (argCount >= 3 ? (double)wxlState.GetNumberType(3) : 0); // const wxString& key ! wxString key = lua2wx(wxlState.GetStringType(2)); // get this wxConfigBase *self = (wxConfigBase *)wxlState.GetUserDataType(1, s_wxluatag_wxConfigBase); --- 519,523 ---- double defaultVal = (argCount >= 3 ? (double)wxlState.GetNumberType(3) : 0); // const wxString& key ! wxString key = wxlState.GetwxStringType(2); // get this wxConfigBase *self = (wxConfigBase *)wxlState.GetUserDataType(1, s_wxluatag_wxConfigBase); *************** *** 543,547 **** // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlState.GetNumberType(3) : 0); ! wxString str = (argCount >= 2 ? lua2wx(wxlState.GetStringType(2)) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxlState.GetUserDataType(1, s_wxluatag_wxConfig); --- 543,547 ---- // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlState.GetNumberType(3) : 0); ! wxString str = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxlState.GetUserDataType(1, s_wxluatag_wxConfig); *************** *** 551,555 **** lua_pushboolean(L, returns); // push the result string ! lua_pushstring(L, wx2lua(str)); // push the next index lua_pushnumber(L, index); --- 551,555 ---- lua_pushboolean(L, returns); // push the result string ! wxlState.lua_PushString(str); // push the next index lua_pushnumber(L, index); *************** *** 569,573 **** // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlState.GetNumberType(3) : 0); ! wxString str = (argCount >= 2 ? lua2wx(wxlState.GetStringType(2)) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxlState.GetUserDataType(1, s_wxluatag_wxConfig); --- 569,573 ---- // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlState.GetNumberType(3) : 0); ! wxString str = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxlState.GetUserDataType(1, s_wxluatag_wxConfig); *************** *** 577,581 **** lua_pushboolean(L, returns); // push the next string ! lua_pushstring(L, wx2lua(str)); // push the next index lua_pushnumber(L, index); --- 577,581 ---- lua_pushboolean(L, returns); // push the next string ! wxlState.lua_PushString(str); // push the next index lua_pushnumber(L, index); *************** *** 601,605 **** lua_pushboolean(L, returns); // push the next result string ! lua_pushstring(L, wx2lua(str)); // push the next index lua_pushnumber(L, index); --- 601,605 ---- lua_pushboolean(L, returns); // push the next result string ! wxlState.lua_PushString(str); // push the next index lua_pushnumber(L, index); *************** *** 625,629 **** lua_pushboolean(L, returns); // push the result string ! lua_pushstring(L, wx2lua(str)); // push the next index lua_pushnumber(L, index); --- 625,629 ---- lua_pushboolean(L, returns); // push the result string ! wxlState.lua_PushString(str); // push the next index lua_pushnumber(L, index); *************** *** 987,991 **** int argCount = lua_gettop(L); // const wxString str = "" ! const wxString str = (argCount >= 1 ? lua2wx(wxlState.GetStringType(1)) : wxString(wxEmptyString)); // call constructor returns = new wxString(str); --- 987,991 ---- int argCount = lua_gettop(L); // const wxString str = "" ! const wxString str = (argCount >= 1 ? wxlState.GetwxStringType(1) : wxString(wxEmptyString)); // call constructor returns = new wxString(str); *************** *** 1006,1010 **** wxClassInfo *returns; // const wxString &name ! wxString name = lua2wx(wxlState.GetStringType(1)); // call constructor returns = wxClassInfo::FindClass((wxChar *)name.c_str()); --- 1006,1010 ---- wxClassInfo *returns; // const wxString &name ! wxString name = wxlState.GetwxStringType(1); // call constructor returns = wxClassInfo::FindClass((wxChar *)name.c_str()); *************** *** 1086,1090 **** // call constructor if (argCount >= 2) ! returns = new wxLuaTextValidator(style, lua2wx(wxlState.GetStringType(2))); else returns = new wxLuaTextValidator(style); --- 1086,1090 ---- // call constructor if (argCount >= 2) ! returns = new wxLuaTextValidator(style, wxlState.GetwxStringType(2)); else returns = new wxLuaTextValidator(style); *************** *** 1283,1287 **** { for (idx = 1; idx < argCount; ++idx) ! returns->Add(lua2wx(lua_tostring(L, idx))); } } --- 1283,1287 ---- { for (idx = 1; idx < argCount; ++idx) ! returns->Add(wxlState.GetwxStringType(idx)); } } *************** *** 1359,1363 **** int flags = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : 0); // const wxString command ! const wxString command = lua2wx(wxlState.GetStringType(1)); // call wxExecute wxArrayString output; --- 1359,1363 ---- int flags = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : 0); // const wxString command ! const wxString command = wxlState.GetwxStringType(1); // call wxExecute wxArrayString output; *************** *** 1382,1386 **** int flags = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : 0); // const wxString command ! const wxString command = lua2wx(wxlState.GetStringType(1)); // call wxExecute wxArrayString output; --- 1382,1386 ---- int flags = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : 0); // const wxString command ! const wxString command = wxlState.GetwxStringType(1); // call wxExecute wxArrayString output; *************** *** 1466,1470 **** wxLuaState wxlState(L); bool returns; ! wxString var = lua2wx(wxlState.GetStringType(1)); wxString value; // call wxGetEnv --- 1466,1470 ---- wxLuaState wxlState(L); bool returns; ! wxString var = wxlState.GetwxStringType(1); wxString value; // call wxGetEnv *************** *** 1472,1476 **** // push the result number lua_pushboolean(L, returns); ! lua_pushstring(L, wx2lua(value)); // return the number of parameters return 2; --- 1472,1476 ---- // push the result number lua_pushboolean(L, returns); ! wxlState.lua_PushString(value); // return the number of parameters return 2; *************** *** 1528,1534 **** int count = 0; wxLuaSmartStringArray ptr; wxString *choices; ptr = choices = wxlState.GetStringArray(4, count); // const wxString& caption ! wxString caption = lua2wx(wxlState.GetStringType(3)); // const wxString& message ! wxString message = lua2wx(wxlState.GetStringType(2)); // wxArrayInt& selections wxArrayInt selections; --- 1528,1534 ---- int count = 0; wxLuaSmartStringArray ptr; wxString *choices; ptr = choices = wxlState.GetStringArray(4, count); // const wxString& caption ! wxString caption = wxlState.GetwxStringType(3); // const wxString& message ! wxString message = wxlState.GetwxStringType(2); // wxArrayInt& selections wxArrayInt selections; *************** *** 1594,1600 **** int dummy_count; wxArrayString choices = wxArrayString(); dummy_count = wxlState.GetwxArrayString(4, choices); // const wxString caption ! const wxString caption = lua2wx(wxlState.GetStringType(3)); // const wxString message ! const wxString message = lua2wx(wxlState.GetStringType(2)); // wxWindow parent wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); --- 1594,1600 ---- int dummy_count; wxArrayString choices = wxArrayString(); dummy_count = wxlState.GetwxArrayString(4, choices); // const wxString caption ! const wxString caption = wxlState.GetwxStringType(3); // const wxString message ! const wxString message = wxlState.GetwxStringType(2); // wxWindow parent wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); *************** *** 1620,1624 **** int argCount = lua_gettop(L); // const wxString newmsg = "" ! const wxString newmsg = (argCount >= 3 ? lua2wx(wxlState.GetStringType(3)) : wxString(wxEmptyString)); // int value = -1 int value = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : -1); --- 1620,1624 ---- int argCount = lua_gettop(L); // const wxString newmsg = "" ! const wxString newmsg = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // int value = -1 int value = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : -1); *************** *** 2053,2063 **** wxString path; // const wxString& fullpath ! wxString fullpath = lua2wx(wxlState.GetStringType(2)); // call SplitPath wxFileName::SplitPath(fullpath, &path, &name, &ext, format); // push the result strings ! lua_pushstring(L, wx2lua(path)); ! lua_pushstring(L, wx2lua(name)); ! lua_pushstring(L, wx2lua(ext)); // return the number of parameters return 3; --- 2053,2063 ---- wxString path; // const wxString& fullpath ! wxString fullpath = wxlState.GetwxStringType(2); // call SplitPath wxFileName::SplitPath(fullpath, &path, &name, &ext, format); // push the result strings ! wxlState.lua_PushString(path); ! wxlState.lua_PushString(name); ! wxlState.lua_PushString(ext); // return the number of parameters return 3; *************** *** 2079,2090 **** wxString volume; // const wxString& fullpath ! wxString fullpath = lua2wx(wxlState.GetStringType(2)); // call SplitPath wxFileName::SplitPath(fullpath, &volume, &path, &name, &ext, format); // push the result strings ! lua_pushstring(L, wx2lua(volume)); ! lua_pushstring(L, wx2lua(path)); ! lua_pushstring(L, wx2lua(name)); ! lua_pushstring(L, wx2lua(ext)); // return the number of parameters return 4; --- 2079,2090 ---- wxString volume; // const wxString& fullpath ! wxString fullpath = wxlState.GetwxStringType(2); // call SplitPath wxFileName::SplitPath(fullpath, &volume, &path, &name, &ext, format); // push the result strings ! wxlState.lua_PushString(volume); ! wxlState.lua_PushString(path); ! wxlState.lua_PushString(name); ! wxlState.lua_PushString(ext); // return the number of parameters return 4; *************** *** 2102,2106 **** wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlState.GetEnumerationType(3) : wxPATH_NATIVE); // const wxString fullpath ! const wxString fullpath = lua2wx(wxlState.GetStringType(2)); wxString volume; wxString path; --- 2102,2106 ---- wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlState.GetEnumerationType(3) : wxPATH_NATIVE); // const wxString fullpath ! const wxString fullpath = wxlState.GetwxStringType(2); wxString volume; wxString path; *************** *** 2108,2113 **** wxFileName::SplitVolume(fullpath, &volume, &path, format); // push the result strings ! lua_pushstring(L, wx2lua(volume)); ! lua_pushstring(L, wx2lua(path)); return 2; } --- 2108,2113 ---- wxFileName::SplitVolume(fullpath, &volume, &path, format); // push the result strings ! wxlState.lua_PushString(volume); ! wxlState.lua_PushString(path); return 2; } *************** *** 2125,2129 **** int flags = (argCount >= 3 ? (int)wxlState.GetNumberType(3) : wxDIR_DEFAULT); // const wxString& filespec = "" ! wxString filespec = (argCount >= 2 ? lua2wx(wxlState.GetStringType(2)) : wxString(wxT(""))); // wxString * filename wxString filename; --- 2125,2129 ---- int flags = (argCount >= 3 ? (int)wxlState.GetNumberType(3) : wxDIR_DEFAULT); // const wxString& filespec = "" ! wxString filespec = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxT(""))); // wxString * filename wxString filename; *************** *** 2134,2138 **** lua_pushboolean(L, returns); // push the result number ! lua_pushstring(L, wx2lua(filename)); // return the number of parameters return 2; --- 2134,2138 ---- lua_pushboolean(L, returns); // push the result number ! wxlState.lua_PushString(filename); // return the number of parameters return 2; *************** *** 2154,2158 **** lua_pushboolean(L, returns); // push the result number ! lua_pushstring(L, wx2lua(filename)); // return the number of parameters return 2; --- 2154,2158 ---- lua_pushboolean(L, returns); // push the result number ! wxlState.lua_PushString(filename); // return the number of parameters return 2; *************** *** 2171,2179 **** int flags = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : wxDIR_DEFAULT); // const wxString& filespec = "" ! wxString filespec = (argCount >= 3 ? lua2wx(wxlState.GetStringType(3)) : wxString(wxT(""))); // wxArrayString *files wxArrayString files; // const wxString& dirname ! wxString dirname = lua2wx(wxlState.GetStringType(2)); // call GetAllFiles returns = wxDir::GetAllFiles(dirname, &files, filespec, flags); --- 2171,2179 ---- int flags = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : wxDIR_DEFAULT); // const wxString& filespec = "" ! wxString filespec = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxT(""))); // wxArrayString *files wxArrayString files; // const wxString& dirname ! wxString dirname = wxlState.GetwxStringType(2); // call GetAllFiles returns = wxDir::GetAllFiles(dirname, &files, filespec, flags); *************** *** 2391,2395 **** bool interactive = (argCount >= 5 ? wxlState.GetBooleanType(4) : true); // const wxString &faceName = wxEmptyString ! wxString faceName = (argCount >= 4 ? lua2wx(wxlState.GetStringType(3)) : wxString(wxT(""))); // wxFontEncoding *altEncoding wxFontEncoding altEncoding; --- 2391,2395 ---- bool interactive = (argCount >= 5 ? wxlState.GetBooleanType(4) : true); // const wxString &faceName = wxEmptyString ! wxString faceName = (argCount >= 4 ? wxlState.GetwxStringType(3) : wxString(wxT(""))); // wxFontEncoding *altEncoding wxFontEncoding altEncoding; *************** *** 2632,2636 **** wxCoord w; ! wxString string = lua2wx(lua_tostring(L, 2)); // get this wxDC *self = (wxDC *)wxlState.GetUserDataType(1, s_wxluatag_wxDC); --- 2632,2636 ---- wxCoord w; ! wxString string = wxlState.GetwxStringType(2); // get this wxDC *self = (wxDC *)wxlState.GetUserDataType(1, s_wxluatag_wxDC); *************** *** 2938,2942 **** case LUA_TSTRING: { ! wxString param = lua2wx(wxlState.GetStringType(3)); returns = self->Find(condition, ¶m); } --- 2938,2942 ---- case LUA_TSTRING: { ! wxString param = wxlState.GetwxStringType(3); returns = self->Find(condition, ¶m); } *************** *** 2970,2974 **** wxColour *retColour = new wxColour; // const wxString& par ! wxString par = lua2wx(wxlState.GetStringType(2)); // get this wxHtmlTag *self = (wxHtmlTag *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlTag); --- 2970,2974 ---- wxColour *retColour = new wxColour; // const wxString& par ! wxString par = wxlState.GetwxStringType(2); // get this wxHtmlTag *self = (wxHtmlTag *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlTag); *************** *** 2992,2996 **** int value; // const wxString& par ! wxString par = lua2wx(wxlState.GetStringType(2)); // get this wxHtmlTag *self = (wxHtmlTag *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlTag); --- 2992,2996 ---- int value; // const wxString& par ! wxString par = wxlState.GetwxStringType(2); // get this wxHtmlTag *self = (wxHtmlTag *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlTag); *************** *** 3050,3056 **** // wxString fixed_face ! wxString fixed_face = lua2wx(wxlState.GetStringType(3)); // wxString normal_face ! wxString normal_face = lua2wx(wxlState.GetStringType(2)); // get this wxHtmlWinParser *self = (wxHtmlWinParser *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlWinParser); --- 3050,3056 ---- // wxString fixed_face ! wxString fixed_face = wxlState.GetwxStringType(3); // wxString normal_face ! wxString normal_face = wxlState.GetwxStringType(2); // get this wxHtmlWinParser *self = (wxHtmlWinParser *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlWinParser); *************** *** 3106,3112 **** // wxString fixed_face ! wxString fixed_face = lua2wx(wxlState.GetStringType(3)); // wxString normal_face ! wxString normal_face = lua2wx(wxlState.GetStringType(2)); // get this wxHtmlWindow *self = (wxHtmlWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlWindow); --- 3106,3112 ---- // wxString fixed_face ! wxString fixed_face = wxlState.GetwxStringType(3); // wxString normal_face ! wxString normal_face = wxlState.GetwxStringType(2); // get this wxHtmlWindow *self = (wxHtmlWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlWindow); *************** *** 3376,3380 **** bool returns; // wxString buf ! wxString buf = lua2wx(wxlState.GetStringType(2)); // get this wxDocManager * self = (wxDocManager *)wxlState.GetUserDataType(1, s_wxluatag_wxDocManager); --- 3376,3380 ---- bool returns; // wxString buf ! wxString buf = wxlState.GetwxStringType(2); // get this wxDocManager * self = (wxDocManager *)wxlState.GetUserDataType(1, s_wxluatag_wxDocManager); *************** *** 3383,3387 **** // push the result flag lua_pushboolean(L, returns); ! lua_pushstring(L, wx2lua(buf)); return 2; --- 3383,3387 ---- // push the result flag lua_pushboolean(L, returns); ! wxlState.lua_PushString(buf); return 2; *************** *** 3395,3404 **** wxLuaState wxlState(L); // wxString name ! wxString name = lua2wx(wxlState.GetStringType(2)); // get this wxDocument * self = (wxDocument *)wxlState.GetUserDataType(1, s_wxluatag_wxDocument); // call GetPrintableName self->GetPrintableName(name); ! lua_pushstring(L, wx2lua(name)); return 1; --- 3395,3404 ---- wxLuaState wxlState(L); // wxString name ! wxString name = wxlState.GetwxStringType(2); // get this wxDocument * self = (wxDocument *)wxlState.GetUserDataType(1, s_wxluatag_wxDocument); // call GetPrintableName self->GetPrintableName(name); ! wxlState.lua_PushString(name); return 1; *************** *** 3457,3461 **** long style = (argCount >= 3 ? (long)wxlState.GetNumberType(3) : 0); // const wxString& title = "" ! wxString title = (argCount >= 2 ? lua2wx(wxlState.GetStringType(2)) : wxString(wxT(""))); // int table if (lua_istable(L, 1)) --- 3457,3461 ---- long style = (argCount >= 3 ? (long)wxlState.GetNumberType(3) : 0); // const wxString& title = "" ! wxString title = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxT(""))); // int table if (lua_istable(L, 1)) *************** *** 3491,3495 **** lua_pushnumber(L, 2); lua_gettable(L, -2); ! menuText = lua2wx(lua_tostring(L, -1)); lua_pop(L, 1); --- 3491,3495 ---- lua_pushnumber(L, 2); lua_gettable(L, -2); ! menuText = wxlState.GetwxStringType(-1); lua_pop(L, 1); *************** *** 3497,3501 **** lua_gettable(L, -2); if (lua_isstring(L, -1)) ! helpText = lua2wx(lua_tostring(L, -1)); lua_pop(L, 1); --- 3497,3501 ---- lua_gettable(L, -2); if (lua_isstring(L, -1)) ! helpText = wxlState.GetwxStringType(-1); lua_pop(L, 1); *************** *** 3585,3591 **** wxItemKind itemkind = (wxItemKind)(argCount >= 5 ? wxlState.GetEnumerationType(5) : wxITEM_NORMAL); // const wxString& help = wxEmptyString ! wxString help = (argCount >= 4 ? lua2wx(wxlState.GetStringType(4)) : wxString(wxEmptyString)); // const wxString& text = wxEmptyString ! wxString text = (argCount >= 3 ? lua2wx(wxlState.GetStringType(3)) : wxString(wxEmptyString)); // int id = wxID_SEPARATOR int id = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : wxID_SEPARATOR); --- 3585,3591 ---- wxItemKind itemkind = (wxItemKind)(argCount >= 5 ? wxlState.GetEnumerationType(5) : wxITEM_NORMAL); // const wxString& help = wxEmptyString ! wxString help = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); // const wxString& text = wxEmptyString ! wxString text = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // int id = wxID_SEPARATOR int id = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : wxID_SEPARATOR); *************** *** 3809,3815 **** size_t maxMatches = (argCount >= 4 ? (size_t)wxlState.GetNumberType(4) : 0); // const wxString& replacement ! wxString replacement = lua2wx(wxlState.GetStringType(3)); // wxString* text ! wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxRegEx *self = (wxRegEx *)wxlState.GetUserDataType(1, s_wxluatag_wxRegEx); --- 3809,3815 ---- size_t maxMatches = (argCount >= 4 ? (size_t)wxlState.GetNumberType(4) : 0); // const wxString& replacement ! wxString replacement = wxlState.GetwxStringType(3); // wxString* text ! wxString text = wxlState.GetwxStringType(2); // get this wxRegEx *self = (wxRegEx *)wxlState.GetUserDataType(1, s_wxluatag_wxRegEx); *************** *** 3819,3823 **** lua_pushnumber(L, returns); // push the result text ! lua_pushstring(L, wx2lua(text)); // return the number of parameters return 2; --- 3819,3823 ---- lua_pushnumber(L, returns); // push the result text ! wxlState.lua_PushString(text); // return the number of parameters return 2; *************** *** 3832,3838 **** int returns; // const wxString& replacement ! wxString replacement = lua2wx(wxlState.GetStringType(3)); // wxString* text ! wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxRegEx *self = (wxRegEx *)wxlState.GetUserDataType(1, s_wxluatag_wxRegEx); --- 3832,3838 ---- int returns; // const wxString& replacement ! wxString replacement = wxlState.GetwxStringType(3); // wxString* text ! wxString text = wxlState.GetwxStringType(2); // get this wxRegEx *self = (wxRegEx *)wxlState.GetUserDataType(1, s_wxluatag_wxRegEx); *************** *** 3842,3846 **** lua_pushnumber(L, returns); // push the result text ! lua_pushstring(L, wx2lua(text)); // return the number of parameters return 2; --- 3842,3846 ---- lua_pushnumber(L, returns); // push the result text ! wxlState.lua_PushString(text); // return the number of parameters return 2; *************** *** 3855,3861 **** int returns; // const wxString& replacement ! wxString replacement = lua2wx(wxlState.GetStringType(3)); // wxString* text ! wxString text = lua2wx(wxlState.GetStringType(2)); // get this wxRegEx *self = (wxRegEx *)wxlState.GetUserDataType(1, s_wxluatag_wxRegEx); --- 3855,3861 ---- int returns; // const wxString& replacement ! wxString replacement = wxlState.GetwxStringType(3); // wxString* text ! wxString text = wxlState.GetwxStringType(2); // get this wxRegEx *self = (wxRegEx *)wxlState.GetUserDataType(1, s_wxluatag_wxRegEx); *************** *** 3865,3869 **** lua_pushnumber(L, returns); // push the result text ! lua_pushstring(L, wx2lua(text)); // return the number of parameters return 2; --- 3865,3869 ---- lua_pushnumber(L, returns); // push the result text ! wxlState.lua_PushString(text); // return the number of parameters return 2; *************** *** 4138,4142 **** int h; // const wxString& string ! wxString string = lua2wx(wxlState.GetStringType(2)); // get this wxWindow *self = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); --- 4138,4142 ---- int h; // const wxString& string ! wxString string = wxlState.GetwxStringType(2); // get this wxWindow *self = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); *************** *** 4379,4385 **** int returns; // const wxString fileName ! const wxString fileName = lua2wx(wxlState.GetStringType(2)); // const wxString luaScript ! const wxString luaScript = lua2wx(wxlState.GetStringType(1)); wxString errMsg; int line_num = -1; --- 4379,4385 ---- int returns; // const wxString fileName ! const wxString fileName = wxlState.GetwxStringType(2); // const wxString luaScript ! const wxString luaScript = wxlState.GetwxStringType(1); wxString errMsg; int line_num = -1; *************** *** 4388,4392 **** // push the result number lua_pushnumber(L, returns); ! lua_pushstring(L, wx2lua(errMsg)); lua_pushnumber(L, line_num); return 3; --- 4388,4392 ---- // push the result number lua_pushnumber(L, returns); ! wxlState.lua_PushString(errMsg); lua_pushnumber(L, line_num); return 3; *************** *** 4450,4454 **** wxLuaObject * pObject = (argCount >= 2 ? (wxLuaObject *)wxlState.GetUserDataType(2, s_wxluatag_wxLuaObject) : NULL); // const wxString title = "Printout" ! const wxString title = (argCount >= 1 ? lua2wx(wxlState.GetStringType(1)) : wxString(wxT("Printout"))); // call constructor returns = new wxLuaPrintout(wxlState, title, pObject); --- 4450,4454 ---- wxLuaObject * pObject = (argCount >= 2 ? (wxLuaObject *)wxlState.GetUserDataType(2, s_wxluatag_wxLuaObject) : NULL); // const wxString title = "Printout" ! const wxString title = (argCount >= 1 ? wxlState.GetwxStringType(1) : wxString(wxT("Printout"))); // call constructor returns = new wxLuaPrintout(wxlState, title, pObject); *************** *** 4471,4475 **** int argCount = lua_gettop(L); // const wxString name = "wxLuaHtmlWindow" ! const wxString name = (argCount >= 6 ? lua2wx(wxlState.GetStringType(6)) : wxString(wxT("wxLuaHtmlWindow"))); // long style = wxHW_SCROLLBAR_AUTO long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : wxHW_SCROLLBAR_AUTO); --- 4471,4475 ---- int argCount = lua_gettop(L); // const wxString name = "wxLuaHtmlWindow" ! const wxString name = (argCount >= 6 ? wxlState.GetwxStringType(6) : wxString(wxT("wxLuaHtmlWindow"))); // long style = wxHW_SCROLLBAR_AUTO long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : wxHW_SCROLLBAR_AUTO); *************** *** 4507,4511 **** wxString value; // const wxString& propName ! wxString propName = lua2wx(wxlState.GetStringType(2)); // get this wxXmlNode *self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); --- 4507,4511 ---- wxString value; // const wxString& propName ! wxString propName = wxlState.GetwxStringType(2); // get this wxXmlNode *self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); *************** *** 4515,4519 **** lua_pushboolean(L, returns); // push the result string ! lua_pushstring(L, wx2lua(value)); // return the number of parameters return 2; --- 4515,4519 ---- lua_pushboolean(L, returns); // push the result string ! wxlState.lua_PushString(value); // return the number of parameters return 2; *************** *** 4545,4549 **** returns = new wxFrame; // const wxString& name ! wxString name = lua2wx(wxlState.GetStringType(3)); // wxWindow* parent wxWindow *parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); --- 4545,4549 ---- returns = new wxFrame; // const wxString& name ! wxString name = wxlState.GetwxStringType(3); // wxWindow* parent wxWindow *parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); *************** *** 4571,4575 **** returns = new wxDialog; // const wxString& name ! wxString name = lua2wx(wxlState.GetStringType(3)); // wxWindow* parent wxWindow *parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); --- 4571,4575 ---- returns = new wxDialog; // const wxString& name ! wxString name = wxlState.GetwxStringType(3); // wxWindow* parent wxWindow *parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); *************** *** 4610,4614 **** int returns; // const wxString &stringID ! wxString stringID = lua2wx(wxlState.GetStringType(2)); // call GetXRCID returns = wxXmlResource::GetXRCID(stringID); --- 4610,4614 ---- int returns; // const wxString &stringID ! wxString stringID = wxlState.GetwxStringType(2); // call GetXRCID returns = wxXmlResource::GetXRCID(stringID); |