Re: Syntax Coloring
- Posted by ghaberek (admin) Nov 07, 2012
- 1306 views
Lone_EverGreen_Ranger said...
I am wondering if there is an easy way to add syntax coloring to your own text editor. I have looked at some other open source editors, but I just can't seem to figure out how to add my own syntax coloring. If someone could please post a simple example, I'd greatly appericate it.
Unfortunately, this is not really a simple topic to which anyone can really provide a simple example. It is, however, a topic very dear to my heart which I have have been following closely for years. I had found a really good tutorial for writing a syntax editor in plain ol' C with Win32 API that was very helpful, but I can't seem to find it right now. Here are some good things to look at in the mean time.
Win32Lib
- Don Phillips' original Syntax control (part of Extra Controls)
- Don Phillips' Syntax2, which is used in the Win32Lib IDE
wxEuphoria
- Matt Lewis converted Don Phillips' Syntax2 to wxEuphoria for wxIDE
- I am working on adding wxStyledTextCtrl to wxEuphoria as an external library (along with a few other controls).
Generic (Windows)
- Don Phillips' Nexus editor and its few revisions (Don's been busy on syntax highlighting!)
- Mike Duffy wrapped Scintilla for Windows, which you could use with any given Windows toolkit. This is likely out of date for Euphoria 4.0 features. I borrowed-and-updated Mike's lexer for the above wxStyledTextControl.
- Feel free to check out the source of my own wxEditor, which is my attempt to write a wxEuphoria-based syntax editor. It's "pure" Euphoria, so its methods could be translated to Win32Lib, etc.
-Greg