> I'm using wxStyledTextCtrl to make simple editor. I have been abled to
> make syntax highlighting for PHP and HTML but not Javascript. How do I
> activate Javascript in scintilla HTML Lexer?
The main thing to be aware of is that there are two sets of
Javascript styles because Javascript can be used both on the client
and the server. 40..52 are for client-side styles and 55..67 for
server-side. Since SciTE implements most Scintilla features, it is a
good source for examples.
Neil
If the property files are not imported (not shown in menu listing)
then they may not have been installed into the proper directory,
e.g. /usr/share/scite
> Also I'm curious as to what the difference between the above
> javascripts as far as scintilla is concerned!
> Thanks
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia
> Also I'm curious as to what the difference between the above
> javascripts as far as scintilla is concerned!
They are highlighted separately so the user can see where the
Javascript is interpreted.
Neil
HTML highlighting works for me. Look in html.properties.
If you still have problems, please provide a short snippet, it
will be easier for anyone in the list community to test and try to
reproduce your problem.
Scintilla? Are you using the edit control in some app? In any
case, SciTE is always a good reference point to check if something
doesn't work in some custom stuff.
IIRC all the PHP highlighting stuff is in LexHTML.cxx.
You should provide clear info if you need anyone on the list to
attempt to diagnose any problems you may be experiencing...
On Fri, Nov 4, 2011 at 9:27 AM, HT <hosanna.te...@gmail.com> wrote:
> Hi KHMan,
>
>
>> Scintilla? Are you using the edit control in some app?
> That is right. I'm making simple editor using wxStyledTextCtrl
> (wxWidgets) and I have successfully done the HTML/JS and Much of PHP.
> The problem is I cannot find the way to change color of <?php and ?>.
> Are they considered html tags?
>
IIRC, STC_H_XMLSTART and STC_H_XMLEND style are used for the embedded
php tags in the HTML lexer.
May also find this useful for the various style ids:
http://wiki.wxpython.org/StyledTextCtrl%20Lexer%20Quick%20Reference
Regards,
Cody
I don't know any of wxStyledTextCtrl, but in Scintilla.iface, the
property for the <?php start is SCE_H_QUESTION.
In LexHTML.cxx, see line 897 onwards. On SciTE, the line in
question in html.properties is:
# PHP
style.hypertext.18=fore:#0000FF,back:#FFEFBF
HTH,
On Fri, Nov 4, 2011 at 9:50 AM, KHMan <kein...@gmail.com> wrote:
> On 11/4/2011 10:45 PM, HT wrote:
>>
>> Hello Cody,
>> this is fun because I was trying to figure out how you did it in
>> Editra.
>> Thanks for the Links also!
>>
>> On Nov 4, 5:41 pm, Cody wrote:
>>>
>>> Hi,
>>>
>>> On Fri, Nov 4, 2011 at 9:27 AM, HT wrote:
>>>>
>>>> Hi KHMan,
>>>
>>>>> Scintilla? Are you using the edit control in some app?
>>>>
>>>> That is right. I'm making simple editor using wxStyledTextCtrl
>>>> (wxWidgets) and I have successfully done the HTML/JS and Much of PHP.
>>>> The problem is I cannot find the way to change color of<?php and ?>.
>>>> Are they considered html tags?
>>>
>>> IIRC, STC_H_XMLSTART and STC_H_XMLEND style are used for the embedded
>>> php tags in the HTML lexer.
>
> I don't know any of wxStyledTextCtrl, but in Scintilla.iface, the property
> for the <?php start is SCE_H_QUESTION.
>
Yes that is correct my mistake. (STC_H_QUESTION)
Cody