From: John L. <jr...@us...> - 2007-03-09 06:10:26
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16936/wxLua/samples Modified Files: editor.wx.lua wxluasudoku.wx.lua Log Message: update to wxWidgets 2.8 using C++ headers Make wxConfig::Read return [bool, value] not the other way around Index: wxluasudoku.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/wxluasudoku.wx.lua,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** wxluasudoku.wx.lua 1 Mar 2007 05:27:47 -0000 1.65 --- wxluasudoku.wx.lua 9 Mar 2007 06:10:21 -0000 1.66 *************** *** 4292,4296 **** if config then local dispX, dispY, dispW, dispH = wx.wxClientDisplayRect() ! local str = config:Read("wxLuaSudoku/Frame") local x, y, w, h, max = string.match(str, "x:(%d+) y:(%d+) w:(%d+) h:(%d+) maximized:(%d+)") if (x ~= nil) and (y ~= nil) and (w ~= nil) and (h ~= nil) and (max ~= nil) then --- 4292,4296 ---- if config then local dispX, dispY, dispW, dispH = wx.wxClientDisplayRect() ! local _, str = config:Read("wxLuaSudoku/Frame") local x, y, w, h, max = string.match(str, "x:(%d+) y:(%d+) w:(%d+) h:(%d+) maximized:(%d+)") if (x ~= nil) and (y ~= nil) and (w ~= nil) and (h ~= nil) and (max ~= nil) then *************** *** 4354,4358 **** if read then if config:HasEntry(key) then ! local str = config:Read(key) local r, g, b = string.match(str, "r:(%d+) g:(%d+) b:(%d+)") if (r == nil) or (g == nil) or (b == nil) then return end --- 4354,4358 ---- if read then if config:HasEntry(key) then ! local _, str = config:Read(key) local r, g, b = string.match(str, "r:(%d+) g:(%d+) b:(%d+)") if (r == nil) or (g == nil) or (b == nil) then return end *************** *** 4371,4375 **** if read then if config:HasEntry(key) then ! local str = config:Read(key) local face, family, style, underlined, weight = string.match(str, "face:(\"[%w ]+\") family:(%d+) style:(%d+) underlined:(%d+) weight:(%d+)") if (face == nil) or (family == nil) or (style == nil) or (underlined == nil) or (weight == nil) then return end --- 4371,4375 ---- if read then if config:HasEntry(key) then ! local _, str = config:Read(key) local face, family, style, underlined, weight = string.match(str, "face:(\"[%w ]+\") family:(%d+) style:(%d+) underlined:(%d+) weight:(%d+)") if (face == nil) or (family == nil) or (style == nil) or (underlined == nil) or (weight == nil) then return end *************** *** 4406,4417 **** if read then if config:HasEntry(path.."/LastOpenedFilepath") then ! sudokuGUI.filePath = config:Read(path.."/LastOpenedFilepath") end if config:HasEntry(path.."/LastOpenedFilename") then ! sudokuGUI.fileName = config:Read(path.."/LastOpenedFilename") end if config:HasEntry(path.."/GenerateDifficulty") then ! sudokuGUI.difficulty = config:ReadInt(path.."/GenerateDifficulty") end else --- 4406,4418 ---- if read then + local _ if config:HasEntry(path.."/LastOpenedFilepath") then ! _, sudokuGUI.filePath = config:Read(path.."/LastOpenedFilepath") end if config:HasEntry(path.."/LastOpenedFilename") then ! _, sudokuGUI.fileName = config:Read(path.."/LastOpenedFilename") end if config:HasEntry(path.."/GenerateDifficulty") then ! _, sudokuGUI.difficulty = config:ReadInt(path.."/GenerateDifficulty") end else *************** *** 4442,4447 **** if read then if config:HasEntry(key) then ! local v = inttobool(config:ReadInt(key)) ! sudokuGUI.CheckMenuItem(pref, v) end else --- 4443,4448 ---- if read then if config:HasEntry(key) then ! local _, v = config:ReadInt(key) ! sudokuGUI.CheckMenuItem(pref, inttobool(v)) end else Index: editor.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/editor.wx.lua,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** editor.wx.lua 22 Feb 2007 05:40:54 -0000 1.44 --- editor.wx.lua 9 Mar 2007 06:10:20 -0000 1.45 *************** *** 241,249 **** config:SetPath("/"..windowName) ! local s = config:ReadInt("s", -1) ! local x = config:ReadInt("x", 0) ! local y = config:ReadInt("y", 0) ! local w = config:ReadInt("w", 0) ! local h = config:ReadInt("h", 0) if (s ~= -1) and (s ~= 2) then --- 241,249 ---- config:SetPath("/"..windowName) ! local _, s = config:ReadInt("s", -1) ! local _, x = config:ReadInt("x", 0) ! local _, y = config:ReadInt("y", 0) ! local _, w = config:ReadInt("w", 0) ! local _, h = config:ReadInt("h", 0) if (s ~= -1) and (s ~= 2) then |