October 31, 2025, 02:34:55 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Simple Text Editor with Highlighting

Started by tbohon, January 25, 2009, 06:54:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tbohon

Have been tapped at work to produce an ftp scripting engine in C#.Net (I'm sorry, I really tried for EB!!!)  That part is going OK.

However, for script development, I think it would be a nice touch to be able to call a simple text editor which highlights comments and all keywords.  While I can write (and have written) simple text editors, I have no idea how to do the highlighting.  The other complication is that, to make it flexible and able to respond to what I'm guessing are going to be other commands required, I need to be able to easy specify (in a text/.ini file???) which commands are to be highlighted and probably load that on execution of the program.

Has anybody here created anything like this, have any ideas/pointers/hints ... ?

Tnx in advance.

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

Parker

The easiest and most professional way I can think of would be to use Scintilla (http://www.scintilla.org/). If your language is similar to an existing one, you can use one of the existing lexers, otherwise you'll need to write your own. There may be examples on the forums somewhere, but if you need I can make one, it just will be a couple days before I have time.

Alyce

Quote from: tbohon on January 25, 2009, 06:54:06 PM
I think it would be a nice touch to be able to call a simple text editor which highlights comments and all keywords. 
Has anybody here created anything like this, have any ideas/pointers/hints ... ?

Tnx in advance.

Tom

Tom, I think that user aurelCB was working on something like this and there are some threads about it. I'm not sure which language he used.

I use Scintilla in my commercial program written in Visual Basic. I've used it with Emergence as well, but I'm not sure I have the code at my fingertips. It was quite a while ago. I think you can find code that uses Scintilla here on the forum, though.

I created a DLL for people who need simple capabililties without the complexities of Scintilla. I call it CodeAChrome. There's a demo for Emergence on my site:
http://alycesrestaurant.com/ibasic/



You can set comment colors and keyword colors, and use your own list of keywords, which can change at any time. Perhaps it will meet your needs.
-Alyce

tbohon

Alyce, that sound perfect - knew about it from the LB forums but had totally forgotten about it.

I'll go check it out right now.

THANKS!!!!!

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

tbohon

And it IS perfect for what I need.  Simple, clean and colorful ...  ;D

Thanks again, Alyce.

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

Alyce

-Alyce