Changeset 479 – Pyragua

Changeset 479

Show
Ignore:
Timestamp:
03/22/11 09:52:14 (14 months ago)
Author:
ark
Message:

pythonstc: Se han removido algunas lineas de código que vienen del ejemplo

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pyragua/ui/buffers/pythonstc.py

    r475 r479  
    2121 
    2222 
    23 demoText = """\ 
    24 ## This version of the editor has been set up to edit Python source 
    25 ## code.  Here is a copy of wxPython/demo/Main.py to play with. 
    26  
    27  
    28 """ 
    29  
    30 #---------------------------------------------------------------------- 
    31  
    32  
    3323if 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, 
    4030             } 
    4131elif 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, 
    4838             } 
    4939else: 
    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, 
    5646             } 
    5747 
    5848 
    59 #---------------------------------------------------------------------- 
    60  
    6149class PythonSTC(stc.StyledTextCtrl): 
    6250 
    63     fold_symbols = 2 
    64  
     51    fold_symbols = 2  # todo: must be configurable 
     52     
    6553    def __init__(self, parent, ID, 
    6654                 pos=wx.DefaultPosition, size=wx.DefaultSize, 
     
    6856        stc.StyledTextCtrl.__init__(self, parent, ID, pos, size, style) 
    6957 
    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? 
    7563 
    7664        self.SetProperty("fold", "1") 
     
    7866        self.SetMargins(0,0) 
    7967 
    80         self.SetViewWhiteSpace(False) 
     68        self.SetViewWhiteSpace(False)  # todo: must be configurable 
    8169 
    8270        self.SetEdgeMode(stc.STC_EDGE_BACKGROUND) 
    8371        self.SetEdgeColumn(78) 
    84  
     72         
    8573        # Setup a margin to hold fold markers 
    8674        #self.SetFoldFlags(16)  ###  WHAT IS THIS VALUE?  WHAT ARE THE OTHER FLAGS?  DOES IT MATTER? 
     
    364352 
    365353 
    366 #---------------------------------------------------------------------- 
    367  
    368 _USE_PANEL = 1 
    369  
    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> should 
    374 be helpful. 
    375 </body><html> 
    376 """ 
    377