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) |