From: John L. <jr...@us...> - 2007-06-30 00:12:32
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9448/wxLua/samples Modified Files: bindings.wx.lua controls.wx.lua unittest.wx.lua Log Message: Fix for MingW added in wxWidgets bindings for wxDefaultPoint and wxEVT_FILEPICKER/DIRPICKER... Rename the functions to get the type names from wxLua to match closer to the lua type() function, wxlua.i Change op_add_assign to just op_iadd (others as well) = op_assign is now op_set Index: controls.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/controls.wx.lua,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** controls.wx.lua 28 Jun 2007 03:15:34 -0000 1.10 --- controls.wx.lua 30 Jun 2007 00:12:27 -0000 1.11 *************** *** 89,104 **** -- --------------------------------------------------------------------------- -- Turn the array from the binding into a lookup table by event type wxEVT_List = {} ! wxEVT_Array = wx.wxLuaBinding_wx.GetEventArray wxEVT_TableByType = {} for i = 1, #wxEVT_Array do wxEVT_TableByType[wxEVT_Array[i].eventType] = wxEVT_Array[i] ! table.insert(wxEVT_List, {wxlua.wxlua_typename(wxEVT_Array[i].class_tag), wxEVT_Array[i].name}) end table.sort(wxEVT_List, function(t1, t2) return t1[1] > t2[1] end) -- Turn the array from the binding into a lookup table by class name ! wxCLASS_Array = wx.wxLuaBinding_wx.GetClassArray wxCLASS_TableByName = {} for i = 1, #wxCLASS_Array do --- 89,117 ---- -- --------------------------------------------------------------------------- + wxLuaBinding_wx = nil + + do + local bindTable = wxlua.GetBindings() + for n = 1, #bindTable do + if bindTable[n].name == "wx" then + wxLuaBinding_wx = bindTable[n].binding + break + end + end + end + + -- Turn the array from the binding into a lookup table by event type wxEVT_List = {} ! wxEVT_Array = wxLuaBinding_wx.GetEventArray wxEVT_TableByType = {} for i = 1, #wxEVT_Array do wxEVT_TableByType[wxEVT_Array[i].eventType] = wxEVT_Array[i] ! table.insert(wxEVT_List, {wxlua.typename(wxEVT_Array[i].class_tag), wxEVT_Array[i].name}) end table.sort(wxEVT_List, function(t1, t2) return t1[1] > t2[1] end) -- Turn the array from the binding into a lookup table by class name ! wxCLASS_Array = wxLuaBinding_wx.GetClassArray wxCLASS_TableByName = {} for i = 1, #wxCLASS_Array do *************** *** 246,251 **** local s = funcTable[n].."=" ! local typ = wxlua.wxlua_type(v) ! local typ_name = wxlua.wxlua_typename(typ) if typ == wxlua.WXLUAARG_String then --- 259,263 ---- local s = funcTable[n].."=" ! local typ_name, typ = wxlua.type(v) if typ == wxlua.WXLUAARG_String then *************** *** 284,288 **** --v:delete() -- If we haven't handled it yet, we probably should ! print("Unhandled wxLua data type in FuncsToString from ", wxlua.wxlua_typename(wxlua.wxlua_type(event)), typ_name) end --- 296,300 ---- --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 *************** *** 299,303 **** function OnEvent(event) local skip = true ! local evtClassName = wxlua.wxlua_typename(wxEVT_TableByType[event:GetEventType()].class_tag) local evtTypeStr = wxEVT_TableByType[event:GetEventType()].name --- 311,315 ---- function OnEvent(event) local skip = true ! local evtClassName = wxlua.typename(wxEVT_TableByType[event:GetEventType()].class_tag) local evtTypeStr = wxEVT_TableByType[event:GetEventType()].name *************** *** 377,381 **** end ! local flexSizer = wx.wxFlexGridSizer(20, 2, 5, 5) flexSizer:AddGrowableCol(1) --- 389,393 ---- end ! local flexSizer = wx.wxFlexGridSizer(50, 2, 5, 5) flexSizer:AddGrowableCol(1) Index: bindings.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/bindings.wx.lua,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** bindings.wx.lua 28 Jun 2007 21:52:57 -0000 1.13 --- bindings.wx.lua 30 Jun 2007 00:12:27 -0000 1.14 *************** *** 313,317 **** for j = 1, #args_table do ! local s = wxlua.wxlua_typename(args_table[j]) -- The first arg for a class member function is the self --- 313,317 ---- for j = 1, #args_table do ! local s = wxlua.typename(args_table[j]) -- The first arg for a class member function is the self *************** *** 518,522 **** -- Add the class tag name for the event for i = 2, #t do ! t[i][3] = wxlua.wxlua_typename(t[i][3]).." ("..t[i][3]..")" -- if t[i-1][2] == t[i][2] then t[i].color = wx.wxRED end -- see if there's dups, there's a couple, but they're right end --- 518,522 ---- -- Add the class tag name for the event for i = 2, #t do ! t[i][3] = wxlua.typename(t[i][3]).." ("..t[i][3]..")" -- if t[i-1][2] == t[i][2] then t[i].color = wx.wxRED end -- see if there's dups, there's a couple, but they're right end *************** *** 534,538 **** -- Add the class tag name for the user data for i = 2, #t do ! t[i][3] = wxlua.wxlua_typename(t[i][3]).." ("..t[i][3]..")" end --- 534,538 ---- -- Add the class tag name for the user data for i = 2, #t do ! t[i][3] = wxlua.typename(t[i][3]).." ("..t[i][3]..")" end *************** *** 896,900 **** for j = 1, #lua_types do local ltype = wxlua[lua_types[j]] ! local ok = wxlua.wxlua_iswxluatype(ltype, wxltype) table.insert(item, tostr[ok]) end --- 896,900 ---- for j = 1, #lua_types do local ltype = wxlua[lua_types[j]] ! local ok = wxlua.iswxluatype(ltype, wxltype) table.insert(item, tostr[ok]) end Index: unittest.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/unittest.wx.lua,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** unittest.wx.lua 18 Jun 2007 18:37:47 -0000 1.14 --- unittest.wx.lua 30 Jun 2007 00:12:27 -0000 1.15 *************** *** 159,162 **** --- 159,186 ---- -- --------------------------------------------------------------------------- + print("\nTest some %operator binding class functions.\n") + -- --------------------------------------------------------------------------- + + a = wx.wxPoint(1, 2) + b = wx.wxPoint(1, 2) + c = wx.wxPoint(2, 4) + PrintOk(a:op_eq(b), "%operator wxPoint& operator==(const wxPoint& p) const") + PrintOk(a:op_eq(a), "%operator wxPoint& operator==(const wxPoint& p) const") + PrintOk(not a:op_ne(b), "%operator wxPoint& operator!=(const wxPoint& p) const") + PrintOk(a:op_ne(c), "%operator wxPoint& operator!=(const wxPoint& p) const") + + d = a:op_add(b) + PrintOk(d:op_eq(c), "%operator wxPoint operator+(const wxPoint& p) const") + d:op_set(a); d:op_iadd(a) + PrintOk(d:op_eq(c), "%operator wxPoint& operator+=(const wxPoint& p)") + d:op_set(a); d = d:op_neg() + PrintOk(d:op_eq(wx.wxPoint(-1, -2)), "%operator wxPoint& operator-()") + + d = a:op_add(wx.wxSize(1,2)) + PrintOk(d:op_eq(c), "%operator wxPoint operator+(const wxSize& p) const") + d:op_set(a); d:op_iadd(wx.wxSize(1,2)) + PrintOk(d:op_eq(c), "%operator wxPoint& operator+=(const wxSize& p)") + + -- --------------------------------------------------------------------------- print("\nTest some binding class functions.\n") -- --------------------------------------------------------------------------- |