From: John L. <jr...@us...> - 2006-10-04 02:41:12
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv31238/wxLua/modules/wxbind/src Modified Files: wx_bind.cpp Log Message: Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** wx_bind.cpp 20 Sep 2006 04:24:27 -0000 1.56 --- wx_bind.cpp 28 Sep 2006 22:26:04 -0000 1.57 *************** *** 3123,3126 **** --- 3123,3147 ---- + // %override wxLua_function_CompileLuaScript + // %function int CompileLuaScript(const wxString& luaScript, const wxString& fileName) + static int LUACALL wxLua_function_CompileLuaScript(lua_State *L) + { + wxLuaState wxlState(L); + 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; + wxLuaState wxlState2(true); // create a brand new empty lua state to compile in + returns = wxlState2.CompileString(luaScript, fileName, &errMsg, &line_num); + // push the result number + lua_pushnumber(L, returns); + lua_pushstring(L, wx2lua(errMsg)); + lua_pushnumber(L, line_num); + return 3; + } + // %function void wxBell() static int LUACALL wxLua_function_wxBell(lua_State *L) *************** *** 4932,4935 **** --- 4953,4957 ---- #endif // (wxUSE_NUMBERDLG) && (wxLUA_USE_wxPointSizeRect) + { LuaGlobal, "CompileLuaScript", wxLua_function_CompileLuaScript, 2, 2, { &s_wxluaarg_String, &s_wxluaarg_String, 0 } }, { LuaGlobal, "wxBell", wxLua_function_wxBell, 0, 0, { 0 } }, { LuaGlobal, "wxCHECK_VERSION", wxLua_function_wxCHECK_VERSION, 3, 3, { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 } }, |