Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.


C++
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


David
Posted
Comments
Peter_in_2780 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,
Peter
Sergey Alexandrovich Kryukov 13-Nov-12 18:34pm    
Scintilla is a text editor and the library -- not too bad thing, frankly.
http://en.wikipedia.org/wiki/Scintilla_%28editing_component%29
--SA
Peter_in_2780 14-Nov-12 5:57am    
I guessed that, but my point was really that PHP is a bad tag for the question.

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900