Scintilla Development
...Scintilla is an open source text editing component...

PN Home

Scintilla Home


WTL Scintilla Control Wrappers <download release 1>

Last Updated: 10/12/2002 - This is the WTL implementation of the plain C++ wrapper classes below. All in one file (atlscintilla.h) the file provides CScintilla and CScintillaWindowImpl. The zip file that you download also contains a sample project where we simply include atlscintilla.h , and the change the base class that the view inherits from to CScintillaWindowImpl. Drop the SciLexer.dll file in the build directory et voila! - a Scintilla view.

These classes implement all the scintilla methods as do the wrappers below, although these methods can be removed from the compile if you wish by setting a #define in atlscintilla.h.

Please be gentle, this is a first release and there are some things that I'm not yet happy with. For example, there are still some virtual functions in the CScintillaIF class and that's not really in line with standard WTL window classes which use the "T* pT" method instead. There may also be bugs, I've not tested this code much. Oh, and yes this is completely free source, just leave my name at the top!

C++ Scintilla Control Wrapper <download release 4>

Last Updated: 10/12/2002 - I began a project using Scintilla in C++, and quickly got very bored of typing in all of the SendMessage commands. Having created a control for Scintilla in Delphi (see below), I wondered why not do a similar thing for C++. Ok, it doesn't sub-class the window or anything clever like that yet (MFC and WTL windows coming soon), so message processing is still a bit manual, but I find this class allows me to drop Scintilla into a project in no time at all.

CScintilla implements all methods from scintilla.iface, which are created using a conversion of the python generator provided with Scintilla. It provides the code from SciTE which deals with file loading and saving - which works quite well. The code also provides brace highlighting and folding support - code all pretty much copied from SciTE. Very little plumbing is required to get this thing going - see IsScintillaNotify and HandleNotify member functions.

Anyway, for now, give it a go! There aren't any instructions, but start out by looking at index.html in the html directory, which contains a class reference for CScintilla (a bit out of date). The class should work well in both static build and dll load environments - see the STATIC_SCILEXER define. Oh, and yes this is completely free source, just leave my name at the top!

Borland Delphi control wrapper for Scintilla: <download version 1.4>

Last Updated: 10/03/2004 - Scintilla is a fairly standard windowed control and this wrapper is fairly simple, a lot of it is generated using the included python files.

Another update from Kiriakos, the wrapper is now up to date with Scintilla 1.56, provides for key command customization at design and run time, adds built in styling support for python, ruby, XML and HTML, and also includes a help file. The release also fixes some bugs reported by users.

30/03/2003: This release adds even more work by Kiriakos Vlahos. Kiriakos added lots of code to make scintilla more delphi-friendly and much easier to use for new users. Finally, note that the SetFocus method of Scintilla is SetFocusEx for the wrapper because SetFocus is a useful method of TWinControl from which TScintilla derives.

09/03/2003: Uploaded much improved code thanks to Kiriakos Vlahos. Control now works in design time, with a number of properties surfaced as delphi properties. The download also includes a demonstration project.

13/12/2001: added a fix recommended by Gertjan Schuurmans and Jeff Cogswell which fixes the flickering and incorrect background repainting. Also added a Delphi port of the Accessor class.

note:: you cannot configure the control until it's window has been created - you will cause a crash otherwise. Oh, and yes this is completely free source, just leave my name at the top!

Wrapper Updating Code <download wrapper updater>

Last Updated: 10/12/2002 - The above scintilla wrappers contain a large number of generated methods. These are generated from a file distributed with scintilla called scintilla.iface - which is created exactly for this purpose. This zip file contains the python code which updates the wrappers to include the latest methods and values from scintilla. You will need python to run this!

External pascal lexer, written in pascal. <download>

External lexer support was recently integrated into Scintilla, and to show that the creation of lexers is now supported in multiple languages, this file contains pascal source for a pascal lexer. It has only been compiled in Delphi 5 to test so far, but it should work in other versions.

Modifications to enable Static Building of Scintilla <download modifications>

Revised: 10/01/2002 - For Visual C++, this modification adds a project which builds Scintilla into a static library (.lib file) for win32. By default SCI_LEXER is enabled, and the libs build into scilexer.lib and scilexerd.lib in the lib directory. I also changed the vcbuild project to build into the bin directory.

My Scintilla modifications:

External lexer modifications
<now integrated>

I modified scintilla to allow the use of external lexers (lexers in DLLs). The most recent changes involved changing the interface so that external lexers must be specifically loaded by the user rather than being discovered on loading.

Hotspot modifications
<now integrated>

I added support to Scintilla for hotspots, including:
  • Enable any style as a hot spot
  • Mouse-cursor changes to a hand when the mouse hovers over it. (win32 only so far)
  • Notification is sent when a hotspot is clicked, including position of hotspot and modifiers
  • Hot spot double-click notification.
  • Specify active hot spot fore colour, back colour and / or underline.