From: John L. <jr...@us...> - 2008-01-23 06:43:43
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv692/wxLua/samples Modified Files: controls.wx.lua unittest.wx.lua Log Message: Use positive values for WXLUA_TXXX types not negative. Initialize the wxLua types when the bindings are initialized not when installed into Lua so we can install the bindings in any order or number for multiple wxLuaStates. Index: controls.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/controls.wx.lua,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** controls.wx.lua 22 Jan 2008 04:45:39 -0000 1.16 --- controls.wx.lua 23 Jan 2008 06:43:40 -0000 1.17 *************** *** 270,274 **** -- --------------------------------------------------------------------------- ! function FuncsToString(event, funcTable) local t = {} --- 270,274 ---- -- --------------------------------------------------------------------------- ! function FuncsToString(event, funcTable, evtClassName) local t = {} *************** *** 280,288 **** local typ_name, typ = wxlua.type(v) ! if typ == wxlua.WXLUAARG_String then s = s.."'"..tostring(v).."'" ! elseif typ == wxlua.WXLUAARG_Table then s = s.."("..table.concat(v, ",")..")" ! elseif typ <= 0 then -- the rest of generic lua types s = s..tostring(v) elseif typ_name == "wxPoint" then --- 280,288 ---- local typ_name, typ = wxlua.type(v) ! if typ == wxlua.WXLUA_TSTRING then s = s.."'"..tostring(v).."'" ! elseif typ == wxlua.WXLUA_TTABLE then s = s.."("..table.concat(v, ",")..")" ! elseif typ <= wxlua.WXLUA_TCFUNCTION then -- the rest of generic lua types s = s..tostring(v) elseif typ_name == "wxPoint" then *************** *** 315,319 **** --v:delete() -- If we haven't handled it yet, we probably should ! print("Unhandled wxLua data type in FuncsToString from ", wxlua.type(event), typ_name) end --- 315,319 ---- --v:delete() -- If we haven't handled it yet, we probably should ! print("Unhandled wxLua data type in FuncsToString from ", wxlua.type(event), typ_name, s, evtClassName) end *************** *** 365,369 **** while wxEvent_GetFuncs[evtClassName] do if type(wxEvent_GetFuncs[evtClassName]) == "table" then ! s = s.."\n\t"..evtClassName.." - "..FuncsToString(event, wxEvent_GetFuncs[evtClassName]) else s = s.."\n\t"..evtClassName.." - "..wxEvent_GetFuncs[evtClassName](event) --- 365,369 ---- while wxEvent_GetFuncs[evtClassName] do if type(wxEvent_GetFuncs[evtClassName]) == "table" then ! s = s.."\n\t"..evtClassName.." - "..FuncsToString(event, wxEvent_GetFuncs[evtClassName], evtClassName) else s = s.."\n\t"..evtClassName.." - "..wxEvent_GetFuncs[evtClassName](event) Index: unittest.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/unittest.wx.lua,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** unittest.wx.lua 22 Jan 2008 04:45:39 -0000 1.21 --- unittest.wx.lua 23 Jan 2008 06:43:40 -0000 1.22 *************** *** 94,98 **** end ! PrintOk(wxlua.WXLUA_TNIL == -2, "Test wxlua bindings wxlua.WXLUA_TNIL == -2") -- --------------------------------------------------------------------------- --- 94,98 ---- end ! PrintOk(wxlua.WXLUA_TNIL == 2, "Test wxlua bindings wxlua.WXLUA_TNIL == 2") -- --------------------------------------------------------------------------- |