Changeset 479
- Timestamp:
- 03/22/11 09:52:14 (14 months ago)
- Files:
-
- 1 modified
-
trunk/pyragua/ui/buffers/pythonstc.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pyragua/ui/buffers/pythonstc.py
r475 r479 21 21 22 22 23 demoText = """\24 ## This version of the editor has been set up to edit Python source25 ## code. Here is a copy of wxPython/demo/Main.py to play with.26 27 28 """29 30 #----------------------------------------------------------------------31 32 33 23 if wx.Platform == '__WXMSW__': 34 faces = { 'times': 'Times New Roman',35 'mono' : 'Courier New',36 'helv' : 'Arial',37 'other': 'Comic Sans MS',38 'size' : 10,39 'size2': 8,24 faces = {'times': 'Times New Roman', 25 'mono' : 'Courier New', 26 'helv' : 'Arial', 27 'other': 'Comic Sans MS', 28 'size' : 10, 29 'size2': 8, 40 30 } 41 31 elif wx.Platform == '__WXMAC__': 42 faces = { 'times': 'Times New Roman',43 'mono' : 'Courier New',44 'helv' : 'Arial',45 'other': 'Comic Sans MS',46 'size' : 12,47 'size2': 10,32 faces = {'times': 'Times New Roman', 33 'mono' : 'Courier New', 34 'helv' : 'Arial', 35 'other': 'Comic Sans MS', 36 'size' : 12, 37 'size2': 10, 48 38 } 49 39 else: 50 faces = { 'times': 'Times',51 'mono' : 'Courier',52 'helv' : 'Helvetica',53 'other': 'new century schoolbook',54 'size' : 12,55 'size2': 10,40 faces = {'times': 'Times', 41 'mono' : 'Courier', 42 'helv' : 'Helvetica', 43 'other': 'new century schoolbook', 44 'size' : 12, 45 'size2': 10, 56 46 } 57 47 58 48 59 #----------------------------------------------------------------------60 61 49 class PythonSTC(stc.StyledTextCtrl): 62 50 63 fold_symbols = 2 64 51 fold_symbols = 2 # todo: must be configurable 52 65 53 def __init__(self, parent, ID, 66 54 pos=wx.DefaultPosition, size=wx.DefaultSize, … … 68 56 stc.StyledTextCtrl.__init__(self, parent, ID, pos, size, style) 69 57 70 self.CmdKeyAssign(ord(' B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN)71 self.CmdKeyAssign(ord(' N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)72 73 self.SetLexer(stc.STC_LEX_PYTHON) 74 self.SetKeyWords(0, " ".join(keyword.kwlist)) 58 self.CmdKeyAssign(ord('+'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) # todo: Get key from config file 59 self.CmdKeyAssign(ord('-'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT) 60 61 self.SetLexer(stc.STC_LEX_PYTHON) # just python for now 62 self.SetKeyWords(0, " ".join(keyword.kwlist)) # more keywords? 75 63 76 64 self.SetProperty("fold", "1") … … 78 66 self.SetMargins(0,0) 79 67 80 self.SetViewWhiteSpace(False) 68 self.SetViewWhiteSpace(False) # todo: must be configurable 81 69 82 70 self.SetEdgeMode(stc.STC_EDGE_BACKGROUND) 83 71 self.SetEdgeColumn(78) 84 72 85 73 # Setup a margin to hold fold markers 86 74 #self.SetFoldFlags(16) ### WHAT IS THIS VALUE? WHAT ARE THE OTHER FLAGS? DOES IT MATTER? … … 364 352 365 353 366 #----------------------------------------------------------------------367 368 _USE_PANEL = 1369 370 overview = """\371 <html><body>372 Once again, no docs yet. <b>Sorry.</b> But <a href="data/stc.h.html">this</a>373 and <a href="http://www.scintilla.org/ScintillaDoc.html">this</a> should374 be helpful.375 </body><html>376 """377
