XThe Delphi Scintilla Interface Components is a FREE collection of components that makes it easy to use the
Scintilla source code editing control from within Delphi, C++ Builder and BDS (Win32 Mode).
The components in this collection are, for now:
Visual:
TScintillaMemo, TScintilla and TSciDocumentTabControl
NonVisual:
TSciLanguageManager, TSciAutoComplete, TSciCallTips, TSciMacroRecorder,
TSciSearchReplace, TScintillaOptionsDlg,
TSciPropertyLoader, TSciAbbrevManager, TSciPrinter.
Database:
TScintillaMemoDB, TScintillaDB
TBX:
TSciSearchReplaceTBX
SpTBX:
TSciSearchReplaceSPTBX
If you are have a question, please check the Frequently Asked Questions (FAQ) first.
If you use C++ Builder and upgrading from 0.23 to 0.50 you might want to read Instructions on how to
upgrade from 0.23 to 0.50 in C++ Builder. Most of these instructions should fit Delphi users too.
This project also has a editor (MyEditor) which showcases some of the features of these components and Scintilla (the program itself is very basic, but does what it should).
Also please check the Scintilla Documentation before asking questions which is answered properly there,
this is after all only a
wrapper/interface
around it's functionality so that would be your ultimate guide to it unless it is more DelphiSci specific..
Notice
This is an interface for Delphi/C++ Builder
to the Scintilla API, and as such, in case of bugs,
there can be two to blame:
First the components themself (these should be explored first), and second, the Scintilla
control.
The latter is most often to blame when
a document is incorrectly lexed (when using Scintilla's builtin lexers),
i.e such as
if
the coloring of a string is terminated before it should and similar things.
About the Scintilla Project
Scintilla is a free source code editing control. It comes with complete source code and a license that permits
use in any free project or commercial product.
As well as features found in standard text editing components, Scintilla includes features especially useful when editing and debugging source code. These include support for syntax styling (highlighting), error indicators, code completion and call tips. The selection margin can contain markers like those used in debuggers to indicate breakpoints and the current line. Styling choices are more open than with many editors, allowing the use of proportional fonts, bold and italics, multiple foreground and background colours and multiple fonts.
|
Component |
Description |
TScintilla | This is the main component, full syntax highlighting etc..
Derives from the TScintillaMemo class.
Many languages can be syntaxed with the same lexer, if the languagestructure is the same, but the keywords/styles can be different. For example, C/C++ and Resources (.RC) files can use the same lexer.
You can define your own languages based on the lexers in SciLexer.dll, with your own styles and keywords for each language.
In the designer, right click on a Scintilla control placed on the form and rightclick Select predefined languages to get a dialog that allows you to select what predefined languages you'd like to use. Or you can add your own manually (you may need to know what style-/keylistnumber is for what, but that info is available in the SciLexer.h/.iface file
from the Scintilla Project).
0.20+:You can also load a different .styles file to select from other
predefined languages.
You can create a .styles file by adding and defining the languages
the normal way, and then
save them from the IDE, or in MyEdit..
These are the languages I've defined as a startingpoint:
C/C++, C#, Java, JavaScript, Resources (.RC), IDL/ODL, Delphi Pascal, Visual Basic, VBScript, Python,Ruby, CSS, Perl, HTML, XML, MYSQL/SQL, TCL/TK, Batch files, Ini/Properties files, Makefiles, Diffs, Apache Config, LUA, WML, ADA, Lisp, Scheme, MMixal, LaTeX, AutoIt 3, VHDL, ASN1 and more.
These definitions are available for selection in the designer only, i.e only the languages you
select/define becomes part of the executable. All styles are based on a black background, but it's easy to customize the styles.
Add new languages yourself if you wish (based on the lexers in the SciLexer.dll) easy, all work can be done within the Delphi/C++ Builder at designtime, or you can add them at runtime if you wish.
All languagestyles/keywords etc can also be modified at runtime if you want to.
Some has requested a Filter property in SciLanguageManager to define what language
has what extension.. This isn't added yet, but TExtensionMapper (not a component)
has a similar function. It can accept multiple extensions for each language by adding
something like this to your code:
ExtMapper.Add(".c;.cpp;.cxx;.hpp;.h","C++/C");
This assigns those extensions to the C++/C language.
Then use this to detect/assign the proper language when you need it:
Scintilla1.LanguageManager.SelectedLanguage:=ExtMapper.DetectLanguage(".cpp");
or for v0.50:
Scintilla1.SelectedLanguage:=ExtMapper.DetectLanguage(".cpp"); |
TScintillaMemo |
Derives from the TScintillaBase class (may be used to derive additional components).
This is the basic component, it exposes all scintillamessages as functions.
Exposes many as properties. In addition to that it adds additional selection/retrieval
functions etc.
This is a "basic" memo component, without syntax highlightning.
0.20+:
Save*/Load* functions creates the class specified in the property StreamClass,
and then calls it's loading/saving functions. This is to allow more flexibility in the saving/loading
of data if you have created a class which can load/save in a specific format, UCF-16
for example..
|
TSciLanguageManager
New in v0.50 |
This is the separated LanguageManager for TScintilla components, its purpose is to hold
"languages",
styledefinitions/keywordlists etc. |
TSciAutoComplete
|
Autocompletion from the current document, or from a list. Just drop this component on the form, and set the Editor property to the editor you want it to link to.
All/most autocompletion related properties are exposed.
|
TSciCallTips
|
Makes the use of calltips extremely easy.. Add the functionlist/whatever to the property ApiStrings and set the Editor property to the editor you want to link to. That's all that's needed. All calltip related properties are exposed.
|
TSciMacroRecorder
|
Record your macros easy. Set the Editor property to the editor you want to link to. Save/Load macros, execute it or whatever.Very basic.
|
TScintillaOptionsDlg | Extensive options dialog for the TScintilla derived components, define/change your languages, styles, keywords or whatever at runtime.
This is also available at designtime when you rightclick a TScintilla derived component and select Options.
|
TSciSearchReplace | Search and Replace dialogs for TScintilla derived components. (parts are MPL 1.1 licensed)
|
TSciDocumentTabControl | Add this and one of the TScintillaMemo derived components on the form, set the Editor property of the control, and viola, Tabbed TScintilla editor.
|
TSciPropertyLoader | Reads/writes predefined and custom properties to/from a stream or file.
Starting with version 0.17 the format of the data produced more resembles INI files, but
with the difference that a line can span more than one line with the use of the '\' on
the end of the line.
0.20+:
You can select which data to save/load, and saving
and loading of styles can be done with
separate functions.. (i.e the properties file can be
very small, and then just load the styles from
anywhere with LoadStylesFromStream. |
TSciAbbrevManager |
Manages abbrevations/templates a user can expand to whatever you want..
Starting with version 0.17 this supports TemplateMacros and inclusion of other templates
inside
another which in it's turn can include other templates.
i.e define the words like
this:
bracesinternal={\n\t|\n}
main=void main(int argc, char** argv)<^bracesinternal>
This will, when ExpandAbbrev is called, expand the word main to the template function
main, the main function in turn will expand the bracesinternal reference to:
{
}
so that the result will be:
void main(int argc, char** argv){
}
in the connected TScintillaMemo derived editor..
The predefined templatemacros is ^Prompt and ^Row for now, but a OnTemplateMacro
event is exposed to allow you to define more builtin templates, which in turn can be used
in the abbrevations/templates
.. |
TScintillaMemoDB
|
Database version of TScintillaMemo. | TScintillaDB |
Database version of TScintilla. |
TSciPrinter |
Easily print from the TScintillaBase derived control. Not very much tested yet, but
seems to work. |
TSciSearchReplaceTBX
ONLY Delphi |
TBX version of TSciSearchReplace.
This component requires correctly installed Toolbar 2000, TBX 2.1beta, and mbTBXLib and is in a package of its own.. i.e the requirements above is ONLY
for this one component, and not the others. |
TSciSearchReplaceSPTBX
New in v0.23
ONLY Delphi | SPTBX version of TSciSearchReplace.
This component requires correctly installed Toolbar 2000, TBX 2.1beta, TNTUnicode, SpTBXLib, and is in a package of its own.. i.e the requirements above is ONLY
for this one component, and not the others. |
And much more to come..
Parts of TScintillaBase are derived from the DelphiWrapper v1.4 (made by Simon Steele and Kiriakos Vlahos).
| Parts are translated to Delphi by myself from the sources of the SciTE editor demo (by Neil Hodgson). |
The TScintillaOptionsDlg component uses the TscFontComboBox by Stefan Cruysberghs, and the ConfirmReplaceDlg and ReplaceTextDlg dialogs are derived from the corresponding files in the SearchReplaceDemo from the SynEdit project.
|
The rest is Copyright © 2004-2008, Jan Martin Pettersen.
These components are released under the GNU Library or Lesser General Public License 2.1 license (LGPL).
|
To download these free components, documentation, or to read more,
go to the Delphi Scintilla Interface Components Project Page. |
|