1. Syntax Coloring

Hello,

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.

new topic     » topic index » view message » categorize

2. Re: Syntax Coloring

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: Syntax Coloring

Lone_EverGreen_Ranger said...

Hello,

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.

Which editor are you looking at? They all have different ways of implementing highlighting. We have a mercurial repository of syntax highlighting files for various editors to which many people have contributed.

Matt

new topic     » goto parent     » topic index » view message » categorize

4. Re: Syntax Coloring

Greg,

I attempted to download your wxEditor and received this error message:

----------------------------------------- 
Server error 
The website encountered an error while retrieving http://wxeditor.sourceforge.net/. It may be down for maintenance or configured incorrectly. 
Here are some suggestions: 
Reload this webpage later. 
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. 
------------------------------------------ 

I tried several times. No Joy.

ghaberek said...
  • 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

new topic     » goto parent     » topic index » view message » categorize

5. Re: Syntax Coloring

K_D_R said...

I attempted to download your wxEditor and received this error message:

----------------------------------------- 
Server error 
The website encountered an error while retrieving http://wxeditor.sourceforge.net/. It may be down for maintenance or configured incorrectly. 
Here are some suggestions: 
Reload this webpage later. 
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. 
------------------------------------------ 

I tried several times. No Joy.

Yes the site's been down for a while. You can visit the project page instead and either download the files or checkout the svn trunk. I will put up a new site when I'm ready to release the next version.

I will admit up-and-down that my wxSyntax control is very unstable and needs a lot of work. I'm fine with replacing my wxSyntax with wxStyledTextCtrl (Scintilla) since it offers long-standing stability and an extensive list of features.

-Greg

new topic     » goto parent     » topic index » view message » categorize

6. Re: Syntax Coloring

I am trying to make my own editor. So I was wondering if there was an easy way to add syntax coloring. I have looked at other open source editors, but it seems like adding syntax color isn't too easy, but it is still a great feature, and I would like to try to add syntax coloring to my editor.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Syntax Coloring

Lone_EverGreen_Ranger said...

Hello,

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.

It was just a coincidence, but the my topic with the subject:
"MleText window does not show text"
uses exactly the resources you will need to make an editor with syntax color.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu