From: John L. <jr...@us...> - 2010-01-30 19:00:58
|
Update of /cvsroot/wxlua/wxLua/samples In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30377/wxLua/samples Modified Files: calculator.wx.lua Log Message: Make wxluaO_addgcobject return a bool instead of void. Silence XRC warnings in calculator.wx.lua since we provide them. Index: calculator.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/calculator.wx.lua,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** calculator.wx.lua 22 Jan 2008 04:45:39 -0000 1.12 --- calculator.wx.lua 30 Jan 2010 19:00:49 -0000 1.13 *************** *** 19,23 **** xmlResource = nil -- the XML resource handle txtDisplay = nil -- statictext window for the display ! clearDisplay = nil lastNumber = 0 -- the last number pressed, 0 - 9 lastOperationId = nil -- the window id of last operation button pressed --- 19,23 ---- xmlResource = nil -- the XML resource handle txtDisplay = nil -- statictext window for the display ! clearDisplay = false lastNumber = 0 -- the last number pressed, 0 - 9 lastOperationId = nil -- the window id of last operation button pressed *************** *** 100,104 **** displayString = "" end ! clearDisplay = nil -- Limit string length to 12 chars --- 100,104 ---- displayString = "" end ! clearDisplay = false -- Limit string length to 12 chars *************** *** 125,129 **** displayString = "0" elseif displayString == "" then ! displayString = num else displayString = displayString..num --- 125,129 ---- displayString = "0" elseif displayString == "" then ! displayString = tostring(num) else displayString = displayString..num *************** *** 131,135 **** end ! txtDisplay:SetLabel(tostring(displayString)) end end --- 131,135 ---- end ! txtDisplay:SetLabel(displayString) end end *************** *** 177,181 **** txtDisplay:SetLabel(tostring(displayString)) end ! clearDisplay = 1 lastOperationId = operationId end --- 177,181 ---- txtDisplay:SetLabel(tostring(displayString)) end ! clearDisplay = true lastOperationId = operationId end *************** *** 202,205 **** --- 202,207 ---- local xrcFilename = GetExePath().."/calculator.xrc" + local logNo = wx.wxLogNull() -- silence wxXmlResource error msg since we provide them + -- try to load the resource and ask for path to it if not found while not xmlResource:Load(xrcFilename) do *************** *** 225,228 **** --- 227,232 ---- end + logNo:delete() -- turn error messages back on + dialog = wx.wxDialog() if not xmlResource:LoadDialog(dialog, wx.NULL, "Calculator") then *************** *** 236,241 **** -- ----------------------------------------------------------------------- -- This is a little awkward, but it's how it's done in C++ too ! bitmap = wx.wxBitmap(xpmdata) ! icon = wx.wxIcon() icon:CopyFromBitmap(bitmap) dialog:SetIcon(icon) --- 240,245 ---- -- ----------------------------------------------------------------------- -- This is a little awkward, but it's how it's done in C++ too ! local bitmap = wx.wxBitmap(xpmdata) ! local icon = wx.wxIcon() icon:CopyFromBitmap(bitmap) dialog:SetIcon(icon) |