[pywin32-checkins] pywin32/Pythonwin/pywin/framework/editor/color coloreditor.py, 1.13, 1.14
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2008-09-02 20:56:07
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32293 Modified Files: coloreditor.py Log Message: Remove import * Index: coloreditor.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color/coloreditor.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** coloreditor.py 13 Jun 2008 20:47:56 -0000 1.13 --- coloreditor.py 2 Sep 2008 20:56:16 -0000 1.14 *************** *** 19,30 **** MARKER_CURRENT = 2 ! # XXX - copied from debugger\dbgcon.py ! DBGSTATE_NOT_DEBUGGING = 0 ! DBGSTATE_RUNNING = 1 ! DBGSTATE_BREAK = 2 ! from pywin.scintilla.document import CScintillaDocument from pywin.framework.editor.document import EditorDocumentBase ! from pywin.scintilla.scintillacon import * # For the marker definitions import pywin.scintilla.view --- 19,26 ---- MARKER_CURRENT = 2 ! from pywin.debugger import dbgcon from pywin.scintilla.document import CScintillaDocument from pywin.framework.editor.document import EditorDocumentBase ! from pywin.scintilla import scintillacon # For the marker definitions import pywin.scintilla.view *************** *** 62,89 **** # Define the markers # self.SCIMarkerDeleteAll() ! self.SCIMarkerDefineAll(MARKER_BOOKMARK, SC_MARK_ROUNDRECT, win32api.RGB(0x0, 0x0, 0x0), win32api.RGB(0, 0xff, 0xff)) ! self.SCIMarkerDefine(MARKER_CURRENT, SC_MARK_ARROW) self.SCIMarkerSetBack(MARKER_CURRENT, win32api.RGB(0xff, 0xff, 0x00)) # Define the folding markers if 1: #traditional markers ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPEN, SC_MARK_MINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDER, SC_MARK_PLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERSUB, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERTAIL, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEREND, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPENMID, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) else: # curved markers ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefine(MARKER_BREAKPOINT, SC_MARK_CIRCLE) # Marker background depends on debugger state self.SCIMarkerSetFore(MARKER_BREAKPOINT, win32api.RGB(0x0, 0, 0)) --- 58,85 ---- # Define the markers # self.SCIMarkerDeleteAll() ! self.SCIMarkerDefineAll(MARKER_BOOKMARK, scintillacon.SC_MARK_ROUNDRECT, win32api.RGB(0x0, 0x0, 0x0), win32api.RGB(0, 0xff, 0xff)) ! self.SCIMarkerDefine(MARKER_CURRENT, scintillacon.SC_MARK_ARROW) self.SCIMarkerSetBack(MARKER_CURRENT, win32api.RGB(0xff, 0xff, 0x00)) # Define the folding markers if 1: #traditional markers ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPEN, scintillacon.SC_MARK_MINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDER, scintillacon.SC_MARK_PLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERSUB, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERTAIL, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEREND, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPENMID, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERMIDTAIL, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) else: # curved markers ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPEN, scintillacon.SC_MARK_CIRCLEMINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDER, scintillacon.SC_MARK_CIRCLEPLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERSUB, scintillacon.SC_MARK_VLINE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERTAIL, scintillacon.SC_MARK_LCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEREND, scintillacon.SC_MARK_CIRCLEPLUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPENMID, scintillacon.SC_MARK_CIRCLEMINUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERMIDTAIL, scintillacon.SC_MARK_TCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefine(MARKER_BREAKPOINT, scintillacon.SC_MARK_CIRCLE) # Marker background depends on debugger state self.SCIMarkerSetFore(MARKER_BREAKPOINT, win32api.RGB(0x0, 0, 0)) *************** *** 92,100 **** import pywin.debugger if pywin.debugger.currentDebugger is None: ! state = DBGSTATE_NOT_DEBUGGING else: state = pywin.debugger.currentDebugger.debuggerState except ImportError: ! state = DBGSTATE_NOT_DEBUGGING self.OnDebuggerStateChange(state) --- 88,96 ---- import pywin.debugger if pywin.debugger.currentDebugger is None: ! state = dbgcon.DBGSTATE_NOT_DEBUGGING else: state = pywin.debugger.currentDebugger.debuggerState except ImportError: ! state = dbgcon.DBGSTATE_NOT_DEBUGGING self.OnDebuggerStateChange(state) *************** *** 115,121 **** if GetEditorOption("Right Edge Enabled", 0): ! mode = EDGE_BACKGROUND else: ! mode = EDGE_NONE self.SCISetEdgeMode(mode) self.SCISetEdgeColumn( GetEditorOption("Right Edge Column", 75) ) --- 111,117 ---- if GetEditorOption("Right Edge Enabled", 0): ! mode = scintillacon.EDGE_BACKGROUND else: ! mode = scintillacon.EDGE_NONE self.SCISetEdgeMode(mode) self.SCISetEdgeColumn( GetEditorOption("Right Edge Column", 75) ) *************** *** 130,134 **** self.bFolding = GetEditorOption("Enable Folding", 1) fold_flags = 0 ! self.SendScintilla(SCI_SETMODEVENTMASK, SC_MOD_CHANGEFOLD); if self.bFolding: if GetEditorOption("Fold Lines", 1): --- 126,130 ---- self.bFolding = GetEditorOption("Enable Folding", 1) fold_flags = 0 ! self.SendScintilla(scintillacon.SCI_SETMODEVENTMASK, scintillacon.SC_MOD_CHANGEFOLD); if self.bFolding: if GetEditorOption("Fold Lines", 1): *************** *** 139,143 **** tt_color = GetEditorOption("Tab Timmy Color", win32api.RGB(0xff, 0, 0)) ! self.SendScintilla(SCI_INDICSETFORE, 1, tt_color) tt_use = GetEditorOption("Use Tab Timmy", 1) --- 135,139 ---- tt_color = GetEditorOption("Tab Timmy Color", win32api.RGB(0xff, 0, 0)) ! self.SendScintilla(scintillacon.SCI_INDICSETFORE, 1, tt_color) tt_use = GetEditorOption("Use Tab Timmy", 1) *************** *** 183,187 **** def OnDebuggerStateChange(self, state): ! if state == DBGSTATE_NOT_DEBUGGING: # Indicate breakpoints arent really usable. # Not quite white - useful when no marker margin, so set as background color. --- 179,183 ---- def OnDebuggerStateChange(self, state): ! if state == dbgcon.DBGSTATE_NOT_DEBUGGING: # Indicate breakpoints arent really usable. # Not quite white - useful when no marker margin, so set as background color. *************** *** 218,222 **** line_click = self.LineFromChar(notify.position) # max_line = self.GetLineCount() ! if self.SCIGetFoldLevel(line_click) & SC_FOLDLEVELHEADERFLAG: # If a fold point. self.SCIToggleFold(line_click) --- 214,218 ---- line_click = self.LineFromChar(notify.position) # max_line = self.GetLineCount() ! if self.SCIGetFoldLevel(line_click) & scintillacon.SC_FOLDLEVELHEADERFLAG: # If a fold point. self.SCIToggleFold(line_click) *************** *** 283,287 **** enable = 0 lineno = self.LineFromChar(self.GetSel()[0]) ! foldable = self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG is_expanded = self.SCIGetFoldExpanded(lineno) if id == win32ui.ID_VIEW_FOLD_EXPAND: --- 279,283 ---- enable = 0 lineno = self.LineFromChar(self.GetSel()[0]) ! foldable = self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG is_expanded = self.SCIGetFoldExpanded(lineno) if id == win32ui.ID_VIEW_FOLD_EXPAND: *************** *** 357,361 **** # Find the first line, and check out its state. for lineSeek in xrange(maxLine): ! if self.SCIGetFoldLevel(lineSeek) & SC_FOLDLEVELHEADERFLAG: expanding = not self.SCIGetFoldExpanded(lineSeek) break --- 353,357 ---- # Find the first line, and check out its state. for lineSeek in xrange(maxLine): ! if self.SCIGetFoldLevel(lineSeek) & scintillacon.SC_FOLDLEVELHEADERFLAG: expanding = not self.SCIGetFoldExpanded(lineSeek) break *************** *** 365,370 **** for lineSeek in xrange(lineSeek, maxLine): level = self.SCIGetFoldLevel(lineSeek) ! level_no = level & SC_FOLDLEVELNUMBERMASK - SC_FOLDLEVELBASE ! is_header = level & SC_FOLDLEVELHEADERFLAG # print lineSeek, level_no, is_header if level_no == 0 and is_header: --- 361,366 ---- for lineSeek in xrange(lineSeek, maxLine): level = self.SCIGetFoldLevel(lineSeek) ! level_no = level & scintillacon.SC_FOLDLEVELNUMBERMASK - scintillacon.SC_FOLDLEVELBASE ! is_header = level & scintillacon.SC_FOLDLEVELHEADERFLAG # print lineSeek, level_no, is_header if level_no == 0 and is_header: *************** *** 382,392 **** ## already formatted parts of file outside visible window. self.Colorize() ! levels=[SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in xrange(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) --- 378,388 ---- ## already formatted parts of file outside visible window. self.Colorize() ! levels=[scintillacon.SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in xrange(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & scintillacon.SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & scintillacon.SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) *************** *** 408,418 **** ## already formatted parts of file outside visible window. self.Colorize() ! levels=[SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in xrange(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) --- 404,414 ---- ## already formatted parts of file outside visible window. self.Colorize() ! levels=[scintillacon.SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in xrange(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & scintillacon.SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & scintillacon.SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) *************** *** 432,436 **** win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 428,432 ---- win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 442,446 **** win32ui.DoWaitCursor(1) for lineno in xrange(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 438,442 ---- win32ui.DoWaitCursor(1) for lineno in xrange(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 452,456 **** win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 448,452 ---- win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 463,467 **** self.Colorize() for lineno in xrange(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 459,463 ---- self.Colorize() for lineno in xrange(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) |