[pywin32-checkins] pywin32/Pythonwin/pywin/framework dbgcommands.py, 1.1, 1.2 scriptutils.py, 1.14,
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2008-02-25 21:56:40
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2560 Modified Files: dbgcommands.py scriptutils.py Log Message: Use active view when setting a breakpoint in a split editor window Index: dbgcommands.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/dbgcommands.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbgcommands.py 1 Sep 1999 23:33:45 -0000 1.1 --- dbgcommands.py 25 Feb 2008 21:56:41 -0000 1.2 *************** *** 6,10 **** import win32ui, win32con import scriptutils ! IdToBarNames = { win32ui.IDC_DBG_STACK : ("Stack",0), --- 6,11 ---- import win32ui, win32con import scriptutils ! import warnings ! IdToBarNames = { win32ui.IDC_DBG_STACK : ("Stack",0), *************** *** 89,97 **** def OnAdd(self, msg, code): ! doc = scriptutils.GetActiveEditorDocument() if doc is None: ! win32ui.MessageBox('There is no active window - no breakpoint can be added') pathName = doc.GetPathName() - view = doc.GetFirstView() lineNo = view.LineFromChar(view.GetSel()[0])+1 # If I have a debugger, then tell it, otherwise just add a marker --- 90,104 ---- def OnAdd(self, msg, code): ! doc, view = scriptutils.GetActiveEditorDocument() if doc is None: ! ## Don't do a messagebox, as this could be triggered from the app's ! ## idle loop whenever the debug toolbar is visible, giving a never-ending ! ## series of dialogs. This can happen when the OnUpdate handler ! ## for the toolbar button IDC_DBG_ADD fails, since MFC falls back to ! ## sending a normal command if the UI update command fails. ! ## win32ui.MessageBox('There is no active window - no breakpoint can be added') ! warnings.warn('There is no active window - no breakpoint can be added') ! return None pathName = doc.GetPathName() lineNo = view.LineFromChar(view.GetSel()[0])+1 # If I have a debugger, then tell it, otherwise just add a marker *************** *** 130,139 **** def OnUpdateAddBreakpoints(self, cmdui): ! doc = scriptutils.GetActiveEditorDocument() if doc is None: enabled = 0 else: enabled = 1 - view = doc.GetFirstView() lineNo = view.LineFromChar(view.GetSel()[0])+1 import pywin.framework.editor.color.coloreditor --- 137,145 ---- def OnUpdateAddBreakpoints(self, cmdui): ! doc, view = scriptutils.GetActiveEditorDocument() if doc is None: enabled = 0 else: enabled = 1 lineNo = view.LineFromChar(view.GetSel()[0])+1 import pywin.framework.editor.color.coloreditor Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** scriptutils.py 19 Feb 2008 01:19:30 -0000 1.14 --- scriptutils.py 25 Feb 2008 21:56:41 -0000 1.15 *************** *** 134,146 **** def GetActiveEditorDocument(): ! """Returns the active editor document, or None if no active document or its not an editor document. """ view = GetActiveView() ! if view is None: return None doc = view.GetDocument() if hasattr(doc, "MarkerAdd"): # Is it an Editor document? ! return doc ! return None def GetActiveFileName(bAutoSave = 1): --- 134,146 ---- def GetActiveEditorDocument(): ! """Returns the active editor document and view, or (None,None) if no active document or its not an editor document. """ view = GetActiveView() ! if view is None: return (None, None) doc = view.GetDocument() if hasattr(doc, "MarkerAdd"): # Is it an Editor document? ! return doc, view ! return (None, None) def GetActiveFileName(bAutoSave = 1): |