c_ext/CFileEditor.py
changeset 1730 64d8f52bc8c8
parent 1511 91538d0c242c
child 1736 7e61baa047f0
equal deleted inserted replaced
1726:d51af006fa6b 1730:64d8f52bc8c8
    27 from controls.CustomStyledTextCtrl import faces
    27 from controls.CustomStyledTextCtrl import faces
    28 from editors.CodeFileEditor import CodeFileEditor, CodeEditor
    28 from editors.CodeFileEditor import CodeFileEditor, CodeEditor
    29 
    29 
    30 class CppEditor(CodeEditor):
    30 class CppEditor(CodeEditor):
    31 
    31 
    32     KEYWORDS = ["asm", "auto", "bool", "break", "case", "catch", "char", "class", 
    32     KEYWORDS = ["asm", "auto", "bool", "break", "case", "catch", "char", "class",
    33         "const", "const_cast", "continue", "default", "delete", "do", "double", 
    33         "const", "const_cast", "continue", "default", "delete", "do", "double",
    34         "dynamic_cast", "else", "enum", "explicit", "export", "extern", "false", 
    34         "dynamic_cast", "else", "enum", "explicit", "export", "extern", "false",
    35         "float", "for", "friend", "goto", "if", "inline", "int", "long", "mutable", 
    35         "float", "for", "friend", "goto", "if", "inline", "int", "long", "mutable",
    36         "namespace", "new", "operator", "private", "protected", "public", "register", 
    36         "namespace", "new", "operator", "private", "protected", "public", "register",
    37         "reinterpret_cast", "return", "short", "signed", "sizeof", "static", 
    37         "reinterpret_cast", "return", "short", "signed", "sizeof", "static",
    38         "static_cast", "struct", "switch", "template", "this", "throw", "true", "try",
    38         "static_cast", "struct", "switch", "template", "this", "throw", "true", "try",
    39         "typedef", "typeid", "typename", "union", "unsigned", "using", "virtual", 
    39         "typedef", "typeid", "typename", "union", "unsigned", "using", "virtual",
    40         "void", "volatile", "wchar_t", "while"]
    40         "void", "volatile", "wchar_t", "while"]
    41     COMMENT_HEADER = "/"
    41     COMMENT_HEADER = "/"
    42     
    42 
    43     def SetCodeLexer(self):
    43     def SetCodeLexer(self):
    44         self.SetLexer(stc.STC_LEX_CPP)
    44         self.SetLexer(stc.STC_LEX_CPP)
    45         
    45 
    46         self.StyleSetSpec(stc.STC_C_COMMENT, 'fore:#408060,size:%(size)d' % faces)
    46         self.StyleSetSpec(stc.STC_C_COMMENT, 'fore:#408060,size:%(size)d' % faces)
    47         self.StyleSetSpec(stc.STC_C_COMMENTLINE, 'fore:#408060,size:%(size)d' % faces)
    47         self.StyleSetSpec(stc.STC_C_COMMENTLINE, 'fore:#408060,size:%(size)d' % faces)
    48         self.StyleSetSpec(stc.STC_C_COMMENTDOC, 'fore:#408060,size:%(size)d' % faces)
    48         self.StyleSetSpec(stc.STC_C_COMMENTDOC, 'fore:#408060,size:%(size)d' % faces)
    49         self.StyleSetSpec(stc.STC_C_NUMBER, 'fore:#0076AE,size:%(size)d' % faces)
    49         self.StyleSetSpec(stc.STC_C_NUMBER, 'fore:#0076AE,size:%(size)d' % faces)
    50         self.StyleSetSpec(stc.STC_C_WORD, 'bold,fore:#800056,size:%(size)d' % faces)
    50         self.StyleSetSpec(stc.STC_C_WORD, 'bold,fore:#800056,size:%(size)d' % faces)
    56 #-------------------------------------------------------------------------------
    56 #-------------------------------------------------------------------------------
    57 #                          CFileEditor Main Frame Class
    57 #                          CFileEditor Main Frame Class
    58 #-------------------------------------------------------------------------------
    58 #-------------------------------------------------------------------------------
    59 
    59 
    60 class CFileEditor(CodeFileEditor):
    60 class CFileEditor(CodeFileEditor):
    61     
    61 
    62     CONFNODEEDITOR_TABS = [
    62     CONFNODEEDITOR_TABS = [
    63         (_("C code"), "_create_CodePanel")]
    63         (_("C code"), "_create_CodePanel")]
    64     CODE_EDITOR = CppEditor
    64     CODE_EDITOR = CppEditor
    65 
       
    66 
       
    67