I'm working on a gui, with wxPython, intented to write php code (in a
StyledTextCtrl). I managed to set styles for different elements of php
code, but i can't find any helpful informations about the way to set
style for special words and control structures of php (i.e. "class",
"function", "while", "for", "if", "else", etc...)
I'm working on a gui, with wxPython, intented to write php code (in a
StyledTextCtrl). I managed to set styles for different elements of php
code, but i can't find any helpful informations about the way to set
style for special words and control structures of php (i.e. "class",
"function", "while", "for", "if", "else", etc...)
I thank you in advance for your help!
1) You need to set the style for:
STC_HPHP_WORD
2) You need to tell the control what the special keywords are by calling
The SET_INDEX is an integer that represents the set of keywords,
unfortunately the only real way to see what index to use for what set
of keywords is to look at the Scintilla source code. For PHP keywords
using the HTML lexer you can use 4.
The STRING_OF_KEYWORDS is a string of space separated keywords that
are to be highlighted using the style that was set for the set of
keywords.
SetKeyWords(4, "while if else for ...")
Cody
···
On Tue, Mar 1, 2011 at 5:54 AM, stephane <stephanehnzr@gmail.com> wrote:
The SET_INDEX is an integer that represents the set of keywords,
unfortunately the only real way to see what index to use for what set
of keywords is to look at the Scintilla source code. For PHP keywords
using the HTML lexer you can use 4.
The STRING_OF_KEYWORDS is a string of space separated keywords that
are to be highlighted using the style that was set for the set of
keywords.