From: John L. <jr...@us...> - 2007-05-31 21:39:24
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11100/wxLua/samples Modified Files: debug.wx.lua editor.wx.lua wxluasudoku.wx.lua Log Message: More cleanup, remove %rename tag for functions that can be overloaded Format %override text in .i files uniformly Remove wxConfig::Read/WriteInt/Float since lua uses double, just have Read/Write Index: wxluasudoku.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/wxluasudoku.wx.lua,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** wxluasudoku.wx.lua 31 May 2007 17:18:56 -0000 1.67 --- wxluasudoku.wx.lua 31 May 2007 21:38:49 -0000 1.68 *************** *** 4408,4423 **** 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 config:Write(path.."/LastOpenedFilepath", sudokuGUI.filePath) config:Write(path.."/LastOpenedFilename", sudokuGUI.fileName) ! config:WriteInt(path.."/GenerateDifficulty", sudokuGUI.difficulty) end --- 4408,4423 ---- 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:Read(path.."/GenerateDifficulty", 0) end else config:Write(path.."/LastOpenedFilepath", sudokuGUI.filePath) config:Write(path.."/LastOpenedFilename", sudokuGUI.fileName) ! config:Write(path.."/GenerateDifficulty", sudokuGUI.difficulty) end *************** *** 4443,4451 **** if read then if config:HasEntry(key) then ! local _, v = config:ReadInt(key) sudokuGUI.CheckMenuItem(pref, inttobool(v)) end else ! config:WriteInt(key, booltoint(sudokuGUI.IsCheckedMenuItem(pref))) end end --- 4443,4451 ---- if read then if config:HasEntry(key) then ! local _, v = config:Read(key, 0) sudokuGUI.CheckMenuItem(pref, inttobool(v)) end else ! config:Write(key, booltoint(sudokuGUI.IsCheckedMenuItem(pref))) end end Index: debug.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/debug.wx.lua,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** debug.wx.lua 31 May 2007 17:18:55 -0000 1.10 --- debug.wx.lua 31 May 2007 21:38:49 -0000 1.11 *************** *** 385,392 **** frame:Connect(wxID_NOPROMPT, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) ! if config:ReadInt("/Controls/Check", 1) == 1 then ! config:WriteInt("/Controls/Check", 0) else ! config:WriteInt("/Controls/Check", 1) end end ) --- 385,392 ---- frame:Connect(wxID_NOPROMPT, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) ! if config:Read("/Controls/Check", 1) == 1 then ! config:Write("/Controls/Check", 0) else ! config:Write("/Controls/Check", 1) end end ) *************** *** 418,425 **** x, y = frame:GetPosition() ! config:WriteInt("/MainFrame/x", x) ! config:WriteInt("/MainFrame/y", y) ! config:WriteInt("/MainFrame/w", w) ! config:WriteInt("/MainFrame/h", h) config:Set():Destroy() --- 418,425 ---- x, y = frame:GetPosition() ! config:Write("/MainFrame/x", x) ! config:Write("/MainFrame/y", y) ! config:Write("/MainFrame/w", w) ! config:Write("/MainFrame/h", h) config:Set():Destroy() *************** *** 435,439 **** causeError() end) ! if config:ReadInt("/Controls/Check", 1) == 1 then wx.wxMessageBox([[You can disable this message box by unchecking the checkbox in the main window (of course, a real --- 435,439 ---- causeError() end) ! if config:Read("/Controls/Check", 1) == 1 then wx.wxMessageBox([[You can disable this message box by unchecking the checkbox in the main window (of course, a real *************** *** 447,454 **** local x, y, w, h ! x = config:ReadInt("x", 50) ! y = config:ReadInt("y", 50) ! w = config:ReadInt("w", 350) ! h = config:ReadInt("h", 200) frame:Move(x, y) --- 447,454 ---- local x, y, w, h ! x = config:Read("x", 50) ! y = config:Read("y", 50) ! w = config:Read("w", 350) ! h = config:Read("h", 200) frame:Move(x, y) Index: editor.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/editor.wx.lua,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** editor.wx.lua 31 May 2007 17:18:55 -0000 1.50 --- editor.wx.lua 31 May 2007 21:38:49 -0000 1.51 *************** *** 247,255 **** 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 --- 247,255 ---- config:SetPath("/"..windowName) ! local _, s = config:Read("s", -1) ! local _, x = config:Read("x", 0) ! local _, y = config:Read("y", 0) ! local _, w = config:Read("w", 0) ! local _, h = config:Read("h", 0) if (s ~= -1) and (s ~= 2) then *************** *** 285,295 **** end ! config:WriteInt("s", s) if s == 0 then ! config:WriteInt("x", x) ! config:WriteInt("y", y) ! config:WriteInt("w", w) ! config:WriteInt("h", h) end --- 285,295 ---- end ! config:Write("s", s) if s == 0 then ! config:Write("x", x) ! config:Write("y", y) ! config:Write("w", w) ! config:Write("h", h) end *************** *** 2327,2331 **** ConfigSaveFramePosition(frame, "MainFrame") ! config:Set():Destroy() event:Skip() CloseWatchWindow() --- 2327,2331 ---- ConfigSaveFramePosition(frame, "MainFrame") ! config:Set():Delete() event:Skip() CloseWatchWindow() |