c_ext/CFileEditor.py
changeset 1091 5f612651d227
parent 1066 b6a5ae4a68d7
child 1096 c9ace6a881c9
equal deleted inserted replaced
1090:f4d08cea7774 1091:5f612651d227
     6 import wx.lib.buttons
     6 import wx.lib.buttons
     7 
     7 
     8 from controls import CustomGrid, CustomTable
     8 from controls import CustomGrid, CustomTable
     9 from editors.ConfTreeNodeEditor import ConfTreeNodeEditor, SCROLLBAR_UNIT
     9 from editors.ConfTreeNodeEditor import ConfTreeNodeEditor, SCROLLBAR_UNIT
    10 from util.BitmapLibrary import GetBitmap
    10 from util.BitmapLibrary import GetBitmap
    11 from editors.TextViewer import GetCursorPos, faces
    11 from controls.CustomStyledTextCtrl import CustomStyledTextCtrl, faces, GetCursorPos
    12 
    12 
    13 def AppendMenu(parent, help, id, kind, text):
    13 def AppendMenu(parent, help, id, kind, text):
    14     if wx.VERSION >= (2, 6, 0):
    14     if wx.VERSION >= (2, 6, 0):
    15         parent.Append(help=help, id=id, kind=kind, text=text)
    15         parent.Append(help=help, id=id, kind=kind, text=text)
    16     else:
    16     else:
    28     "reinterpret_cast", "return", "short", "signed", "sizeof", "static", 
    28     "reinterpret_cast", "return", "short", "signed", "sizeof", "static", 
    29     "static_cast", "struct", "switch", "template", "this", "throw", "true", "try",
    29     "static_cast", "struct", "switch", "template", "this", "throw", "true", "try",
    30     "typedef", "typeid", "typename", "union", "unsigned", "using", "virtual", 
    30     "typedef", "typeid", "typename", "union", "unsigned", "using", "virtual", 
    31     "void", "volatile", "wchar_t", "while"]
    31     "void", "volatile", "wchar_t", "while"]
    32 
    32 
    33 class CppEditor(stc.StyledTextCtrl):
    33 class CppEditor(CustomStyledTextCtrl):
    34 
    34 
    35     fold_symbols = 3
    35     fold_symbols = 3
    36     
    36     
    37     def __init__(self, parent, name, window, controler):
    37     def __init__(self, parent, name, window, controler):
    38         stc.StyledTextCtrl.__init__(self, parent, ID_CPPEDITOR, wx.DefaultPosition, 
    38         CustomStyledTextCtrl.__init__(self, parent, ID_CPPEDITOR, wx.DefaultPosition, 
    39                  wx.Size(-1, 300), 0)
    39                  wx.Size(-1, 300), 0)
    40 
    40 
    41         self.SetMarginType(1, stc.STC_MARGIN_NUMBER)
    41         self.SetMarginType(1, stc.STC_MARGIN_NUMBER)
    42         self.SetMarginWidth(1, 25)
    42         self.SetMarginWidth(1, 25)
    43 
    43