Click here to Skip to main content
11,805,316 members (62,821 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: PHP
Ive been playing with Scintilla for a little while, and want to use PHP with it.

Thing is i cant seem to get any key words highlighted

what ever colour i set SCE_HPHP_DEFAULT to, it will color the key words and general text that colour, even if SCE_HPHP_WORD is set to something different.

Ive entered this as my code

note :
wEditor is the hWnd for the Scintilla editor window which has been defined.

LRESULT SendEditor(UINT Msg, WPARAM wParam=0, LPARAM lParam=0) 
	return ::SendMessage(wEditor, Msg, wParam, lParam);
void SetAStyle(int style, COLORREF fore, COLORREF back, int size, const char *face) {
	SendEditor(SCI_STYLESETFORE, style, fore);
	SendEditor(SCI_STYLESETBACK, style, back);
	if (size >= 1)
	SendEditor(SCI_STYLESETSIZE, style, size);
	if (face) 
	SendEditor(SCI_STYLESETFONT, style, reinterpret_cast<LPARAM>(face));

	SetAStyle(SCE_HPHP_DEFAULT, RGB(0, 0, 0));
	SetAStyle(SCE_HPHP_HSTRING, RGB(0x80,0,0x80));
	SetAStyle(SCE_HPHP_SIMPLESTRING, RGB(0x80,0,0x80));
	SetAStyle(SCE_HPHP_WORD, RGB(250, 0, 55));
	SetAStyle(SCE_HPHP_NUMBER, RGB(128, 0, 0));
	SetAStyle(SCE_HPHP_VARIABLE, RGB(255, 125, 64));
	SetAStyle(SCE_HPHP_COMMENT, RGB(0, 128, 0));
	SetAStyle(SCE_HPHP_COMMENTLINE, RGB(0, 128, 0));
	SetAStyle(SCE_HPHP_HSTRING_VARIABLE, RGB(0x80,0,0x80));
	SetAStyle(SCE_HPHP_OPERATOR, RGB(128, 0, 128));
	SetAStyle(SCE_HBA_STRING, RGB(0x80,0,0x80));

Everything else works fine such it should. SCE_HPHP_NUMBER, SCE_HPHP_VARIABLE, SCE_HPHP_COMMENT all seem fine.

Does anyone have anythoughts why SCE_HPHP_DEFAULT cancels out SCE_HPHP_WORD

If more code is required, please let me know

Thanks in advance

Posted 13-Nov-12 11:32am
Peter_in_2780 at 13-Nov-12 17:52pm
You might do better changing your tags on the question. This doesn't look like a PHP issue to me, as in "my extensive PHP experience is of no use answering this question. What is Scintilla, anyway?"

Good luck,
Sergey Alexandrovich Kryukov at 13-Nov-12 18:34pm
Scintilla is a text editor and the library -- not too bad thing, frankly.
Peter_in_2780 at 14-Nov-12 5:57am
I guessed that, but my point was really that PHP is a bad tag for the question.

Sergey Alexandrovich Kryukov at 14-Nov-12 11:26am
Oh, sure. I can see only C++ code sample, it looks like...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 315
1 Richard Deeming 225
2 Sergey Alexandrovich Kryukov 190
3 CPallini 160
4 ppolymorphe 154
0 OriginalGriff 3,265
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100