[pywin32-checkins] pywin32/Pythonwin/pywin/scintilla view.py, 1.28.2.1, 1.28.2.2
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2008-09-01 08:03:48
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6312 Modified Files: Tag: py3k view.py Log Message: Always set codepage to enable Unicode Remove import * Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.28.2.1 retrieving revision 1.28.2.2 diff -C2 -d -r1.28.2.1 -r1.28.2.2 *** view.py 29 Aug 2008 06:16:42 -0000 1.28.2.1 --- view.py 1 Sep 2008 08:03:57 -0000 1.28.2.2 *************** *** 3,7 **** from pywin.mfc import docview from pywin.mfc import dialog ! from .scintillacon import * import win32con import win32ui --- 3,8 ---- from pywin.mfc import docview from pywin.mfc import dialog ! from . import scintillacon ! import win32con import win32ui *************** *** 77,86 **** command_reflectors = [ (win32ui.ID_EDIT_UNDO, win32con.WM_UNDO), ! (win32ui.ID_EDIT_REDO, SCI_REDO), (win32ui.ID_EDIT_CUT, win32con.WM_CUT), (win32ui.ID_EDIT_COPY, win32con.WM_COPY), (win32ui.ID_EDIT_PASTE, win32con.WM_PASTE), (win32ui.ID_EDIT_CLEAR, win32con.WM_CLEAR), ! (win32ui.ID_EDIT_SELECT_ALL, SCI_SELECTALL), ] --- 78,87 ---- command_reflectors = [ (win32ui.ID_EDIT_UNDO, win32con.WM_UNDO), ! (win32ui.ID_EDIT_REDO, scintillacon.SCI_REDO), (win32ui.ID_EDIT_CUT, win32con.WM_CUT), (win32ui.ID_EDIT_COPY, win32con.WM_COPY), (win32ui.ID_EDIT_PASTE, win32con.WM_PASTE), (win32ui.ID_EDIT_CLEAR, win32con.WM_CLEAR), ! (win32ui.ID_EDIT_SELECT_ALL, scintillacon.SCI_SELECTALL), ] *************** *** 192,204 **** doc = self.GetDocument() ! # Enable Unicode if we can ! if is_platform_unicode: ! self.SendScintilla(SCI_SETCODEPAGE, SC_CP_UTF8, 0) # Create margins ! self.SendScintilla(SCI_SETMARGINTYPEN, 1, SC_MARGIN_SYMBOL); ! self.SendScintilla(SCI_SETMARGINMASKN, 1, 0xF); ! self.SendScintilla(SCI_SETMARGINTYPEN, 2, SC_MARGIN_SYMBOL); ! self.SendScintilla(SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS); ! self.SendScintilla(SCI_SETMARGINSENSITIVEN, 2, 1); self.GetDocument().HookViewNotifications(self) # is there an MFC way to grab this? --- 193,204 ---- doc = self.GetDocument() ! # Enable Unicode ! self.SendScintilla(scintillacon.SCI_SETCODEPAGE, scintillacon.SC_CP_UTF8, 0) # Create margins ! self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 1, scintillacon.SC_MARGIN_SYMBOL); ! self.SendScintilla(scintillacon.SCI_SETMARGINMASKN, 1, 0xF); ! self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 2, scintillacon.SC_MARGIN_SYMBOL); ! self.SendScintilla(scintillacon.SCI_SETMARGINMASKN, 2, scintillacon.SC_MASK_FOLDERS); ! self.SendScintilla(scintillacon.SCI_SETMARGINSENSITIVEN, 2, 1); self.GetDocument().HookViewNotifications(self) # is there an MFC way to grab this? *************** *** 321,331 **** cmdui.Enable() def OnCmdViewRightEdge(self, cmd, code): # Handle the menu command ! if self.SCIGetEdgeMode() == EDGE_NONE: ! mode = EDGE_BACKGROUND else: ! mode = EDGE_NONE self.SCISetEdgeMode(mode) def OnUpdateViewRightEdge(self, cmdui): # Update the tick on the UI. ! cmdui.SetCheck(self.SCIGetEdgeMode() != EDGE_NONE) cmdui.Enable() def OnCmdViewEOL(self, cmd, code): # Handle the menu command --- 321,331 ---- cmdui.Enable() def OnCmdViewRightEdge(self, cmd, code): # Handle the menu command ! if self.SCIGetEdgeMode() == scintillacon.EDGE_NONE: ! mode = scintillacon.EDGE_BACKGROUND else: ! mode = scintillacon.EDGE_NONE self.SCISetEdgeMode(mode) def OnUpdateViewRightEdge(self, cmdui): # Update the tick on the UI. ! cmdui.SetCheck(self.SCIGetEdgeMode() != scintillacon.EDGE_NONE) cmdui.Enable() def OnCmdViewEOL(self, cmd, code): # Handle the menu command |