From: John L. <jr...@us...> - 2006-10-05 05:10:51
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28254/wxLua/samples Modified Files: editor.wx.lua Log Message: change wxLuaDebugeeEvent wxEVT_WXLUA_DEBUGGER_CLIENT_CONNECTED to wxEVT_WXLUA_DEBUGGER_DEBUGGEE_CONNECTED add wxEVT_WXLUA_DEBUGGER_DEBUGGEE_DISCONNECTED and send it when a read/write fails make wxEvtHandler::Connect check for numbers only, NOT nil or bool enhance the wxLuaSocketException replace more nil bool values with true/false in editor.wx.lua Index: editor.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/editor.wx.lua,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** editor.wx.lua 4 Oct 2006 22:07:23 -0000 1.31 --- editor.wx.lua 5 Oct 2006 05:10:48 -0000 1.32 *************** *** 328,332 **** else local filePath = openDocuments[id].filePath ! openDocuments[id].isModified = nil if resetModTime and filePath and string.len(filePath) > 0 then openDocuments[id].modTime = GetFileModTime(filePath) --- 328,332 ---- else local filePath = openDocuments[id].filePath ! openDocuments[id].isModified = false if resetModTime and filePath and string.len(filePath) > 0 then openDocuments[id].modTime = GetFileModTime(filePath) *************** *** 491,495 **** document.filePath = nil document.modTime = nil ! document.isModified = nil openDocuments[id] = document end --- 491,495 ---- document.filePath = nil document.modTime = nil ! document.isModified = false openDocuments[id] = document end *************** *** 831,835 **** local id = editor:GetId() if openDocuments[id] then ! event:Enable(openDocuments[id].isModified ~= nil) end end --- 831,835 ---- local id = editor:GetId() if openDocuments[id] then ! event:Enable(openDocuments[id].isModified) end end *************** *** 838,842 **** function SaveFileAs(editor) local id = editor:GetId() ! local saved = nil local fn = wx.wxFileName(openDocuments[id].filePath) fn:Normalize() -- want absolute path for dialog --- 838,842 ---- function SaveFileAs(editor) local id = editor:GetId() ! local saved = false local fn = wx.wxFileName(openDocuments[id].filePath) fn:Normalize() -- want absolute path for dialog *************** *** 1006,1010 **** end end ! document.isModified = nil end end --- 1006,1010 ---- end end ! document.isModified = false end end *************** *** 1508,1511 **** --- 1508,1512 ---- if openDocuments[id].isModified then SaveFile(editor, openDocuments[id].filePath) + openDocuments[id].isModified = false end *************** *** 1542,1547 **** function CreateDebugServer() ! local debugServer = wx.wxLuaDebuggerServer(portNumber) ! if not debugServer then return nil end local ok = debugServer:StartServer() --- 1543,1547 ---- function CreateDebugServer() ! debugServer = wx.wxLuaDebuggerServer(portNumber) local ok = debugServer:StartServer() *************** *** 1559,1563 **** end ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_CLIENT_CONNECTED, function (event) local ok = false --- 1559,1563 ---- end ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_DEBUGGEE_CONNECTED, function (event) local ok = false *************** *** 1586,1594 **** end) function DebuggerIgnoreFile(fileName) ! ignoreFlag = nil for idx, ignoreFile in pairs(ignoredFilesList) do if string.upper(ignoreFile) == string.upper(fileName) then ! ignoreFlag = 1 end end --- 1586,1601 ---- end) + debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_DEBUGGEE_DISCONNECTED, + function (event) + DisplayOutput(event:GetMessage().."\n") + debugServer:Delete() + debugServer = nil + end) + function DebuggerIgnoreFile(fileName) ! ignoreFlag = false for idx, ignoreFile in pairs(ignoredFilesList) do if string.upper(ignoreFile) == string.upper(fileName) then ! ignoreFlag = true end end *************** *** 1697,1706 **** end) - - return debugServer end - frame:Connect(ID_START_DEBUG, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) --- 1704,1710 ---- *************** *** 1734,1740 **** fIsConnected = false if debugServer then ! debugServer:Reset() ! debugServer:Delete() debugServer = nil end SetAllEditorsReadOnly(false) --- 1738,1746 ---- fIsConnected = false if debugServer then ! local ds = debugServer debugServer = nil + ds:Reset() + ds:StopServer() + ds:Delete() end SetAllEditorsReadOnly(false) *************** *** 1894,1898 **** local dlg = wx.wxDialog(frame, wx.wxID_ANY, "About wxLua IDE") - local topsizer = wx.wxBoxSizer(wx.wxVERTICAL) local html = wx.wxLuaHtmlWindow(dlg, wx.wxID_ANY, --- 1900,1903 ---- *************** *** 1909,1915 **** html:GetInternalRepresentation():GetHeight()) topsizer:AddWindow(html, 1, wx.wxALL, 10) topsizer:AddWindow(line, 0, wx.wxEXPAND + wx.wxLEFT + wx.wxRIGHT, 10) - topsizer:AddWindow(button, 0, wx.wxALL + wx.wxALIGN_RIGHT, 15) --- 1914,1920 ---- html:GetInternalRepresentation():GetHeight()) + local topsizer = wx.wxBoxSizer(wx.wxVERTICAL) topsizer:AddWindow(html, 1, wx.wxALL, 10) topsizer:AddWindow(line, 0, wx.wxEXPAND + wx.wxLEFT + wx.wxRIGHT, 10) topsizer:AddWindow(button, 0, wx.wxALL + wx.wxALIGN_RIGHT, 15) |