Adding keyword sets to a subclassed CPP lexer

28 views
Skip to first unread message

Jonas O.

unread,
Nov 8, 2010, 5:14:38 PM11/8/10
to scintilla...@googlegroups.com
Hello, I'm using QScintilla and I want to highlight C++ keywords with
different colors; I tried this
enum
{
BaseType = 20,
Instruct = 21,
Modifiers = 22,
ClassRelated = 23,
Oper = 24,
Misc = 25
};

// and the keywords function :
const char *QsciLexerCO :: keywords(int set) const
{
switch (set)
{
case BaseType:
return
"bool char double enum float int long "
"short struct union void wchar_t";

case ClassRelated:
return
"class inline friend private protected public "
"template this virtual";

case Misc:
return
"asm namespace typedef using";

case Modifiers:
"auto const explicit extern mutable register "
"signed static unsigned volatile";

case Instruct:
return
"break case continue default do else "
"for goto if return switch while";
}

return 0;
}

Then I called the according setColor method in my QScintilla using
code, but I can't make it work...
What should I change in the QScintilla and/or Scintilla code to
recognize more keyword sets so I can colorize them differently ? And
(I don't know if it's Scintilla or QScintilla-specific) are the set
argument of the keywords method and the enum the same corresponding
value ?

Patel Kalpesh

unread,
Jan 19, 2017, 12:46:21 AM1/19/17
to scintilla-interest, ezj...@gmail.com
Hi jonas

Did you got any solution to your mentioned issue?

if yes then please share it with us
Reply all
Reply to author
Forward
0 new messages