Which lexers is available for me to use? |
All lexers specified in ScintillaLanguageManager.pas, morelexers.inc, null (i.e no highlighter), and container defined.
If you have a new version of SciLexer.Dll, and you know there is additional lexers which isn't among those
above, please add the new lexer in morelexers.inc like this:
Add('blitzbasic');
In the 1.71 version there are 50+ lexers.
There is no way to determine exactly which named lexers is in a given SciLexer.Dll without getting the scintilla
project source
and studying the LexXXX.cxx files for a LexerModule declaration.
The format of that is like this:
LexerModule lmAVE(SCLEX_AVE, ColouriseAveDoc, "ave", FoldAveDoc);
The string within the quotes is the lexer name. |
Does it support xxxxx function/Can it do xxxxx? |
You can use all message exposed in the Scintilla Project api as functions (the version DelphiSci was last refreshed
against),
and
additionally you can call all message exposed by any version by
calling
TScintillaBase.SPerform(msg,wparam, lparam).
If you get the new Scintilla.iface file from the Scintilla project, and you have Python, you can update it to the new
version
of Scintilla by doing this:
Make a backup of your current Source\SciLexer.pas and Source\SciSupport.pas
Copy the new .iface file to scintilla_codemaker\include\
Copy the current Source\SciLexer.pas and
Source\SciSupport.pas to scintilla_codemaker\Originals\
Run scintilla_codemaker\bin\PasFacer.py.
Copy the .pas files in scintilla_codemaker\pascal\ to source\
Additionally you can generate an extra file (SciFunctionStrings.Pas) by adding "-d" (without the quotes) to the
commandline. This file will then contain one single function which returns a stringlist with the functionnames, and
the parameters etc in the Objects[] property.
This could be used to make a macrogenerator which generates any type
of scripting, such as making a JavaScript macro.
An example of this can be found in MyEditor (NOTE TO SELF: TO BE ADDED). |
How to add predefined languages? |
Rightclick on the control, and select
"Select predefined languages..".
In the dialog that follows a list of languages are
available for selection.
If you previously have saved
a .styles file you can
fill the list of languages to select from that file instead of the builtin list by selecting
"Load.." (.Styles files are
created by TSciPropertyLoader or
TSciStyleLoader, when you call
SaveStyles*) or if you
have saved
the styles from inside the IDE or MyEditor, then those
files can also
be used).
This also changes the background color etc, if it
doesn't correspond to the styleset you have selected the
languages from.. |
Help, I don't like the default coloring of the predefined languages, what should I do? |
You can change all the settings manually by the Rightclick->Options, then store those by Rightclicking the
component when done, and select Save Styles, and select the filename to store the settings in (Make sure it ends
in .styles).
OR if you want a .styles file which already has white background etc, do this:
You can download the MyEditor binary, that one contains a file named Silver.styles in the Styles subdir.
Store the file somewhere on your disk, then go to the IDE.
Rightclick on the TScintilla(DB) component
and select 'Select predefined languages..'.
Click LOAD, select the file stored previously.
Now, when you open this dialog on any other occation, it uses those styles/languages as the ones presented to
you in the dialog by default.
To revert to the BuiltIns then click LOAD and then click Cancel. Answer YES to
the question.
Make note:
All .styles files also changes a lot of other color and marker values if properties for those is found in the
file specified. |
How to manually create/add languages? |
Rightclick the component, select "Options". Go to the "LanguageManager" page.
Click "Add" in the Languages
box.
A dialog will pop up to allow you to set the name of your language,
and which lexer it should use.
Now you can click "Add" in the "Styles" subpage. Set the stylenumber for the style you are defining
(which stylenumber who does what depends on the lexer, so ideally you should check the LexXXX.cxx
file for the lexer you are defining a language for. This is also the reason that many are predefined), and
then set the description to use.
Now you can click "Add" in the "Keywords" subpage, and do the same as above, then enter the keywords
for each list. Each keyword should be separated by a space, and lowercase (if the language isn't casesensitive
anyway).
Go to the "Other settings" subpage, and set some other settings for your language.
The StyleBits setting can mostly be ignored, unless you are using the hypertext or similar
lexer which requires 7 bits instead of the default 5.
Note: The :LexXXX.cxx files referred to are those found in the Scintilla Project which make up the
SciLexer.Dll and more.
|
How to activate code coloring? |
Rightclick the component, select "Options", and go to the page "LanguageManager". Select your language there, or change
the property LanguageManager.SelectedLanguage |
Does it support Borland ... compiler? |
Mostly it's just a matter of following this instruction:
Add a similar section to SciCommonDef.inc as the ones already defined (by copying the newest section, and
check for the new define, i.e VERxxx) if it isn't already there.
Load the project into Delphi/BDS/C++ Builder.
Change the LIB SUFFIX to reflect the compiler, i.e xxD10.
Compile. |
What does the exception 'No Class is assigned to StreamClass' mean when I try to Load/Save a file? |
This was introduced in 0.20 to allow you to change how the :Load*/Save* functions work without deriving a new
component or similar just to do it. This can be used to implement functions handling all your unicode files, store the
file in any other format you wish and load from any format.
To get the same behaviours as in earlier version you only need to add this to your uses clause:
SciStreamDefault
and this somewhere after the component is instantiated (you can check with HandleAllocated):
Delphi:
Scintilla1.StreamClass:=TSciStreamDefault;
C++ Builder
Scintilla1->StreamClass=__classid(TSciStreamDefault);
The reason for not setting this as the default in the component is if that had been done then the code for the
default streaming had been included if needed or not.
You can create a new class handling the saving/loading by deriving a class from TSciStreamBase,
and implementing the virtuals/abstracts. |
FastMM4 with FullDebugMode define reports 2 leaks of type TIntConst. What is this? |
There are 2 very small leaks (13-20 bytes, doesn't increase) of type
TIntConst known.
Classes.UnregisterIntegerConsts removes a registered const procedure from the list IntConstList by
deleting the corresponding item, reducing Count, without freeing the TIntConst object first
The private Classes.FreeIntConstList called in 'finalization' uses Count to walk the IntConstList
and frees each one, ergo leaks a TIntConst for each unregistered.
However, not unregistering might result in duplicate consts when inside the ide (messing up a form or something when
installing,uninstalling,then install again in the same session), or other places using them from a package which may
be loaded/unloaded then loaded again, as
experienced by
myself on occation.
Not using the unregister function removes the leak, but seems to have the undesired sideeffect above.
Not using the unregister also would be bad code practice from my standpoint, but you are free to remove
the UnregisterIntegerConst where called if you wish. Might cause undesired sideeffects in the IDE however.
Same thing is the case with both Delphi 7, Delphi 2005, and C++ Builder 6 Update #4 (all seems to use similar
procedures for Registering/Unregistering integer consts, without freeing the TIntConst object first).
Probably unlikely that the same thing is the case with BDS 2006 because they use FastMM4
as the standard
memory manager, and most likely would've discovered it when running such an app with FullDebugMode defined.
I have checked the JVCL library however, and there, more often than not, it only registers integer consts, no unregistering.
Now you know. It's up to you then. |
The compiler complains about not finding DBRTL.*? |
If you are using the standard/personal version then dont compile the DSCITDB/SCITDB packages as those cannot be compiled by those versions. The components will still work just fine, only the database versions of the components will be missing.
If not add this to your library path: Delphi: $(DELPHI)\Lib\Release or for C++ Builder: $(BCB)\Lib\Release then try to compile again. |
Compiler complains about 'cant create output file...' when using D7/C6/BDS |
If the directory specified in the errormessage doesn't exist where you extracted the archive, then create it yourself. This is the destination of compiled object/unit files is stored. You can also change the 'Unit output directory'/'Intermediate Output' yourself, just make sure you also change all occurances of the previous path too.
You can also copy all .hpp,.dfm,.res, here, then specify this directory in the search path of your projects instead of the source directory. |
I have BDS 2005,2006, RAD 2007, and when I click on TScintilla* it shows an 'Access Violation' error? |
Please upgrade to Delphisci 0.50 to cure this issue. |
How do I create scintilla by using only code (i.e not dropped on a form)? |
For 0.50+:
Create it as you normally would (make sure you include SciScintillaBase etc as neccesary).
Make sure you assign a parent to the Parent property:
Scintilla1.Parent:=Form1;
then call
Scintilla1.PerformLoaded;
For 0.23 and earlier:
Create it as you normally would (make sure you include SciLexer etc as neccesary).
Make sure you assign a parent to the Parent property:
Scintilla1.Parent:=Form1;
One problem might occur as it doesn't call Loaded when creating it dynamically, so do something like this:
type
TScintillaProt=class(TScintillaBase)
public
procedure Loaded;override;
end;
procedure TScintillaProt.Loaded;
begin
inherited;
end;
Then call Loaded like this: TScintillaProt(Scintilla1).Loaded;
|
When I type russian (or any other unicode only) characters I get strange symbols instead of what is expected? |
Delphi 2007's VCL and earlier apparently doesn't support true unicode to begin with, and I haven't had the time
(and I didn't
even know about the problem)
to work around this.
Somehow combining TNTUnicode
and TScintilla* components might achieve this, but as that code isn't my own
and is no longer free I guess it won't
happen soon.
|
I have a question not answered here? |
Regarding most questions you can probably get the answer in the Scintilla Documentation (The control which
TScintilla* is a wrapper/interface for).
When reading that documentation the usual rule is that a message named SCI_BEGINUNDOACTION
is the same as the
function/procedure named BeginUndoAction and so on.
You can also call them the same way they are specified in the documentation by adding SciSupport to the
uses clause, and then
calling it like this:
TScintillaBase.SPerform(SCI_BEGINUNDOACTION,0,0);
It might however interfere with the operation of the component/not do anything if it interferes with something the
component itself does.
If it is DelphiSci specific then please ask it in the appropriate forum found on my project pages at SourceForge.
Back to main page
|