Discussion:
New User to Scintilla
(too old to reply)
Ackbar " "
2002-01-29 23:52:25 UTC
Permalink
Hi. I'm rather new to scintilla (today). Anyway someone explained to me how
to configure a language but I notice that there are hardcoded lexers in the
scilexer.dll file. What is their point? Is there any way to take advantage
of these pre existing ones? Thanks :)


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
Neil Hodgson
2002-01-30 00:37:20 UTC
Permalink
Post by Ackbar " "
Hi. I'm rather new to scintilla (today). Anyway someone explained to me how
to configure a language but I notice that there are hardcoded lexers in the
scilexer.dll file. What is their point? Is there any way to take advantage
of these pre existing ones? Thanks :)
The point of the hardcoded lexers is to simplify development by allowing
reuse of existing code. You don't have to use them which is why there is
also a Scintilla.dll with no included lexers.

Send a SCI_SETLEXER message with one of the lexer IDs defined in
SciLexer.h such as SCLEX_LUA.

A simple C++ example:
http://www.scintilla.org/dmapp.zip

Neil
Ackbar " "
2002-01-30 03:18:30 UTC
Permalink
Ok. I'm using the scintilla wrapper for Delphi. It seems to work fairly well
but I'm still rather confused there. I was fairly certain thats what you
were gonna say was neccisary and here's what I got:

scMain.SetLexer(3);

As far as I can tell from the scintilla source 3 is the cpp lexer. Yet after
calling that there's nothing going on, no highlighting or anything. Thanks
for any help you can offer :)
Subject: Re: [scintilla] New User to Scintilla
Date: Wed, 30 Jan 2002 11:37:20 +1100
Post by Ackbar " "
Hi. I'm rather new to scintilla (today). Anyway someone explained to me
how
Post by Ackbar " "
to configure a language but I notice that there are hardcoded lexers in
the
Post by Ackbar " "
scilexer.dll file. What is their point? Is there any way to take
advantage
Post by Ackbar " "
of these pre existing ones? Thanks :)
The point of the hardcoded lexers is to simplify development by
allowing
reuse of existing code. You don't have to use them which is why there is
also a Scintilla.dll with no included lexers.
Send a SCI_SETLEXER message with one of the lexer IDs defined in
SciLexer.h such as SCLEX_LUA.
http://www.scintilla.org/dmapp.zip
Neil
_______________________________________________
Scintilla-interest mailing list
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
Neil Hodgson
2002-01-30 03:27:55 UTC
Permalink
Post by Ackbar " "
As far as I can tell from the scintilla source 3 is the cpp
lexer. Yet after calling that there's nothing going on,
no highlighting or anything. Thanks for any help you can
offer :)
You should examine the dmapp example, particularly the SetAStyle method
and its use.

Neil
Ackbar " "
2002-01-30 03:32:00 UTC
Permalink
Ok. I'll take a look. Unfortunatly c++ is not a strong language for me :)
Thanks for your help :)
Subject: Re: [scintilla] New User to Scintilla
Date: Wed, 30 Jan 2002 14:27:55 +1100
Post by Ackbar " "
As far as I can tell from the scintilla source 3 is the cpp
lexer. Yet after calling that there's nothing going on,
no highlighting or anything. Thanks for any help you can
offer :)
You should examine the dmapp example, particularly the SetAStyle method
and its use.
Neil
_______________________________________________
Scintilla-interest mailing list
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
Ackbar " "
2002-01-30 18:21:29 UTC
Permalink
So you still have to read a keyword set in and define color
schemes then?
Well that's best suited for a simple file I imagine.
I'm going to obviously be learning this since scintilla seems
by far the
most powerful for this purpose.

Ok I was experimenting with scite yesterday and noticed that it has
intelisense support, and what was showing up in the listbox
was functions
actually in the box. Is this default behavior for scintilla?
If so how do
you get access to that?

And last question, how do you make use of folding? I know
some languages
support it and some don't, but I can't figure out how to use
it period.

I wish I could find detailed documentation on using some of
these features
:) But if it exists I havn't seen it. The documentation that
scintilla
includes seems kind of sparse.
Anyway thanks for your continued help.


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
Simon Steele
2002-01-30 21:41:32 UTC
Permalink
on Wed, 30 Jan 2002 18:21:29 +0000, Ackbar may have written:

Hi Ackbar,
Post by Ackbar " "
So you still have to read a keyword set in and define color
schemes then?
Well that's best suited for a simple file I imagine.
I'm going to obviously be learning this since scintilla seems
by far the
most powerful for this purpose.
Scintilla is powerful but many (including myself) find it has an
initially high learning curve. However, I've found it very rewarding
to work with compared to my experience with other controls which seem
intially easy and then cause problems later.
Post by Ackbar " "
Ok I was experimenting with scite yesterday and noticed that it has
intelisense support, and what was showing up in the listbox
was functions
actually in the box. Is this default behavior for scintilla?
If so how do
you get access to that?
As far as I'm aware, the drop-down list behaviour with some
intelligence is available in scintilla, but the "intellisense" support
is application specific. See the Autocomplete and User list sections
of the documentation. You may also want to check the calltips
information which is also related to "intellisense" style behaviour.
Post by Ackbar " "
And last question, how do you make use of folding? I know
some languages
support it and some don't, but I can't figure out how to use
it period.
Ok, this is best demonstrated in SciTE at the moment (or in my C++
class wrapper for scintilla - code taken from SciTE) but basically you
must do something like this:

1) Define the folding markers.

2) Show a margin tagged for folding information, and set some fold
flags. Example:

scintilla.SetProperty("fold", "1");
scintilla.SetProperty("fold.compact", "1");
scintilla.SetFoldFlags(16);
scintilla.SetMarginTypeN(2, SC_MARGIN_SYMBOL);
SC_MASK_FOLDERS := ((1 shl SC_MARKNUM_FOLDER) or
(1 shl SC_MARKNUM_FOLDEROPEN));
scintilla.SetMarginMaskN(2, SC_MASK_FOLDERS);
scintilla.SetMarginSensitiveN(2, True);
scintilla.SetMarginWidthN(2, 14);

3) Handle the SCN_MARGINCLICK notification message (In the delphi
control provide a handler for OnMarginClick). In this message you'll
need to toggle the fold state of the relevant line.

4) You'll also probably want to handle SCN_MODIFIED - this may change
the fold state of the document.

The functions you'll need to use to control the folding are all shown
in the folding section of the documentation.

Looking at my C++ control, it shouldn't be too difficult to port the
code to the delphi version of the control. You'll need to translate
the following functions:

MarginClick
FoldChanged
FoldAll
Expand

My C++ wrapper class is available from the same location as my Delphi
control:
http://www.pnotepad.org/scintilla/

If you're not sure about how to do this, I may find time next week to
do it.
Post by Ackbar " "
I wish I could find detailed documentation on using some of
these features
:) But if it exists I havn't seen it. The documentation that
scintilla
includes seems kind of sparse.
Anyway thanks for your continued help.
The best documentation is the SciTE source code. I'll try and knock up
a demo app in Delphi at some point as well - but it's unlikely to be
anywhere as featureful as SciTE - my main concern is my own C++
editor.
Neil Hodgson
2002-02-02 11:40:45 UTC
Permalink
Post by Simon Steele
Post by Ackbar " "
And last question, how do you make use of folding? I know
some languages
support it and some don't, but I can't figure out how to use
it period.
Ok, this is best demonstrated in SciTE at the moment (or in my C++
class wrapper for scintilla - code taken from SciTE) but basically you
There should be an easy default folding mode in Scintilla to suit people
who just want SciTE's current behaviour. The reason for the current scheme
with the container being so inolved is to allow a lot of customisation for
those who want features like being able to hide user defined sections.

Neil

Ackbar " "
2002-01-31 03:28:59 UTC
Permalink
Yeah I agree with that. If you'd like when I manage to get some basics
working your more than welcome to the delphi source cause it is using your
control :) Thanks again for the help.
Subject: Re: [scintilla] New User to Scintilla
Date: Wed, 30 Jan 2002 21:41:32 GMT
Hi Ackbar,
Post by Ackbar " "
So you still have to read a keyword set in and define color
schemes then?
Well that's best suited for a simple file I imagine.
I'm going to obviously be learning this since scintilla seems
by far the
most powerful for this purpose.
Scintilla is powerful but many (including myself) find it has an
initially high learning curve. However, I've found it very rewarding
to work with compared to my experience with other controls which seem
intially easy and then cause problems later.
Post by Ackbar " "
Ok I was experimenting with scite yesterday and noticed that it has
intelisense support, and what was showing up in the listbox
was functions
actually in the box. Is this default behavior for scintilla?
If so how do
you get access to that?
As far as I'm aware, the drop-down list behaviour with some
intelligence is available in scintilla, but the "intellisense" support
is application specific. See the Autocomplete and User list sections
of the documentation. You may also want to check the calltips
information which is also related to "intellisense" style behaviour.
Post by Ackbar " "
And last question, how do you make use of folding? I know
some languages
support it and some don't, but I can't figure out how to use
it period.
Ok, this is best demonstrated in SciTE at the moment (or in my C++
class wrapper for scintilla - code taken from SciTE) but basically you
1) Define the folding markers.
2) Show a margin tagged for folding information, and set some fold
scintilla.SetProperty("fold", "1");
scintilla.SetProperty("fold.compact", "1");
scintilla.SetFoldFlags(16);
scintilla.SetMarginTypeN(2, SC_MARGIN_SYMBOL);
SC_MASK_FOLDERS := ((1 shl SC_MARKNUM_FOLDER) or
(1 shl SC_MARKNUM_FOLDEROPEN));
scintilla.SetMarginMaskN(2, SC_MASK_FOLDERS);
scintilla.SetMarginSensitiveN(2, True);
scintilla.SetMarginWidthN(2, 14);
3) Handle the SCN_MARGINCLICK notification message (In the delphi
control provide a handler for OnMarginClick). In this message you'll
need to toggle the fold state of the relevant line.
4) You'll also probably want to handle SCN_MODIFIED - this may change
the fold state of the document.
The functions you'll need to use to control the folding are all shown
in the folding section of the documentation.
Looking at my C++ control, it shouldn't be too difficult to port the
code to the delphi version of the control. You'll need to translate
MarginClick
FoldChanged
FoldAll
Expand
My C++ wrapper class is available from the same location as my Delphi
http://www.pnotepad.org/scintilla/
If you're not sure about how to do this, I may find time next week to
do it.
Post by Ackbar " "
I wish I could find detailed documentation on using some of
these features
:) But if it exists I havn't seen it. The documentation that
scintilla
includes seems kind of sparse.
Anyway thanks for your continued help.
The best documentation is the SciTE source code. I'll try and knock up
a demo app in Delphi at some point as well - but it's unlikely to be
anywhere as featureful as SciTE - my main concern is my own C++
editor.
_______________________________________________
Scintilla-interest mailing list
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
Ackbar " "
2002-01-31 03:55:40 UTC
Permalink
Ok I setup the folding code as suggested and then in the marginclick event I
put this:

if margin = 2 then scMain.ToggleFold(position);

scMain is the name of the scintilla control. Anyway I ran it and everything
worked till I colapsed it then I got repeating floating point operation
errors. Any ideas?
Subject: Re: [scintilla] New User to Scintilla
Date: Wed, 30 Jan 2002 21:41:32 GMT
Hi Ackbar,
Post by Ackbar " "
So you still have to read a keyword set in and define color
schemes then?
Well that's best suited for a simple file I imagine.
I'm going to obviously be learning this since scintilla seems
by far the
most powerful for this purpose.
Scintilla is powerful but many (including myself) find it has an
initially high learning curve. However, I've found it very rewarding
to work with compared to my experience with other controls which seem
intially easy and then cause problems later.
Post by Ackbar " "
Ok I was experimenting with scite yesterday and noticed that it has
intelisense support, and what was showing up in the listbox
was functions
actually in the box. Is this default behavior for scintilla?
If so how do
you get access to that?
As far as I'm aware, the drop-down list behaviour with some
intelligence is available in scintilla, but the "intellisense" support
is application specific. See the Autocomplete and User list sections
of the documentation. You may also want to check the calltips
information which is also related to "intellisense" style behaviour.
Post by Ackbar " "
And last question, how do you make use of folding? I know
some languages
support it and some don't, but I can't figure out how to use
it period.
Ok, this is best demonstrated in SciTE at the moment (or in my C++
class wrapper for scintilla - code taken from SciTE) but basically you
1) Define the folding markers.
2) Show a margin tagged for folding information, and set some fold
scintilla.SetProperty("fold", "1");
scintilla.SetProperty("fold.compact", "1");
scintilla.SetFoldFlags(16);
scintilla.SetMarginTypeN(2, SC_MARGIN_SYMBOL);
SC_MASK_FOLDERS := ((1 shl SC_MARKNUM_FOLDER) or
(1 shl SC_MARKNUM_FOLDEROPEN));
scintilla.SetMarginMaskN(2, SC_MASK_FOLDERS);
scintilla.SetMarginSensitiveN(2, True);
scintilla.SetMarginWidthN(2, 14);
3) Handle the SCN_MARGINCLICK notification message (In the delphi
control provide a handler for OnMarginClick). In this message you'll
need to toggle the fold state of the relevant line.
4) You'll also probably want to handle SCN_MODIFIED - this may change
the fold state of the document.
The functions you'll need to use to control the folding are all shown
in the folding section of the documentation.
Looking at my C++ control, it shouldn't be too difficult to port the
code to the delphi version of the control. You'll need to translate
MarginClick
FoldChanged
FoldAll
Expand
My C++ wrapper class is available from the same location as my Delphi
http://www.pnotepad.org/scintilla/
If you're not sure about how to do this, I may find time next week to
do it.
Post by Ackbar " "
I wish I could find detailed documentation on using some of
these features
:) But if it exists I havn't seen it. The documentation that
scintilla
includes seems kind of sparse.
Anyway thanks for your continued help.
The best documentation is the SciTE source code. I'll try and knock up
a demo app in Delphi at some point as well - but it's unlikely to be
anywhere as featureful as SciTE - my main concern is my own C++
editor.
_______________________________________________
Scintilla-interest mailing list
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
Neil Hodgson
2002-01-31 05:13:27 UTC
Permalink
Post by Ackbar " "
Ok I setup the folding code as suggested and then in the marginclick event I
if margin = 2 then scMain.ToggleFold(position);
scMain is the name of the scintilla control. Anyway I ran it and everything
worked till I colapsed it then I got repeating floating point operation
errors. Any ideas?
This may be a bug in 1.43, but fixed since in CVS or in the development
sources at
http://www.scintilla.org/scite.zip
Post by Ackbar " "
Also it only seems to happen if there's nothing in the box but
...
I can't reproduce this with 1.43 or current code.

Neil
Simon Steele
2002-01-31 09:10:01 UTC
Permalink
on Thu, 31 Jan 2002 03:55:40 +0000, Ackbar may have written:

Hi Ackbar,
Post by Ackbar " "
Ok I setup the folding code as suggested and then in the marginclick event I
if margin = 2 then scMain.ToggleFold(position);
scMain is the name of the scintilla control. Anyway I ran it and everything
worked till I colapsed it then I got repeating floating point operation
errors. Any ideas?
I believe this is related to the other floating point errors you were
experiencing. I managed to reproduce these using a 1.43 build of
SciLexer (I think) but by building the most recent DLL from cvs the
errors are gone again. I believe you will be able to cause a floating
point error simply by doing this:

1. Right click in the scintilla window.
2. Left click away from the popup menu.

Placing the new dll in the directory fixes this and the floating
toolbar problem we discussed.

hope that helps,
--
Simon Steele
Programmers Notepad - http://www.pnotepad.org/
Neil Hodgson
2002-01-31 09:28:47 UTC
Permalink
Post by Simon Steele
I believe this is related to the other floating point errors you were
experiencing. I managed to reproduce these using a 1.43 build of
SciLexer (I think) but by building the most recent DLL from cvs the
errors are gone again.
Looks like I should make a 1.44 release tomorrow to fix this problem.

Neil
Ackbar " "
2002-01-31 04:23:32 UTC
Permalink
Also it only seems to happen if there's nothing in the box but whats
colapsed. if I had say:

void blah(){
}

blah

and colapsed that function it's fine but if I got rid of the blah I get the
errors.
Subject: Re: [scintilla] New User to Scintilla
Date: Thu, 31 Jan 2002 03:55:40 +0000
Ok I setup the folding code as suggested and then in the marginclick event
I
if margin = 2 then scMain.ToggleFold(position);
scMain is the name of the scintilla control. Anyway I ran it and everything
worked till I colapsed it then I got repeating floating point operation
errors. Any ideas?
Subject: Re: [scintilla] New User to Scintilla
Date: Wed, 30 Jan 2002 21:41:32 GMT
Hi Ackbar,
Post by Ackbar " "
So you still have to read a keyword set in and define color
schemes then?
Well that's best suited for a simple file I imagine.
I'm going to obviously be learning this since scintilla seems
by far the
most powerful for this purpose.
Scintilla is powerful but many (including myself) find it has an
initially high learning curve. However, I've found it very rewarding
to work with compared to my experience with other controls which seem
intially easy and then cause problems later.
Post by Ackbar " "
Ok I was experimenting with scite yesterday and noticed that it has
intelisense support, and what was showing up in the listbox
was functions
actually in the box. Is this default behavior for scintilla?
If so how do
you get access to that?
As far as I'm aware, the drop-down list behaviour with some
intelligence is available in scintilla, but the "intellisense" support
is application specific. See the Autocomplete and User list sections
of the documentation. You may also want to check the calltips
information which is also related to "intellisense" style behaviour.
Post by Ackbar " "
And last question, how do you make use of folding? I know
some languages
support it and some don't, but I can't figure out how to use
it period.
Ok, this is best demonstrated in SciTE at the moment (or in my C++
class wrapper for scintilla - code taken from SciTE) but basically you
1) Define the folding markers.
2) Show a margin tagged for folding information, and set some fold
scintilla.SetProperty("fold", "1");
scintilla.SetProperty("fold.compact", "1");
scintilla.SetFoldFlags(16);
scintilla.SetMarginTypeN(2, SC_MARGIN_SYMBOL);
SC_MASK_FOLDERS := ((1 shl SC_MARKNUM_FOLDER) or
(1 shl SC_MARKNUM_FOLDEROPEN));
scintilla.SetMarginMaskN(2, SC_MASK_FOLDERS);
scintilla.SetMarginSensitiveN(2, True);
scintilla.SetMarginWidthN(2, 14);
3) Handle the SCN_MARGINCLICK notification message (In the delphi
control provide a handler for OnMarginClick). In this message you'll
need to toggle the fold state of the relevant line.
4) You'll also probably want to handle SCN_MODIFIED - this may change
the fold state of the document.
The functions you'll need to use to control the folding are all shown
in the folding section of the documentation.
Looking at my C++ control, it shouldn't be too difficult to port the
code to the delphi version of the control. You'll need to translate
MarginClick
FoldChanged
FoldAll
Expand
My C++ wrapper class is available from the same location as my Delphi
http://www.pnotepad.org/scintilla/
If you're not sure about how to do this, I may find time next week to
do it.
Post by Ackbar " "
I wish I could find detailed documentation on using some of
these features
:) But if it exists I havn't seen it. The documentation that
scintilla
includes seems kind of sparse.
Anyway thanks for your continued help.
The best documentation is the SciTE source code. I'll try and knock up
a demo app in Delphi at some point as well - but it's unlikely to be
anywhere as featureful as SciTE - my main concern is my own C++
editor.
_______________________________________________
Scintilla-interest mailing list
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
_______________________________________________
Scintilla-interest mailing list
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
Ackbar " "
2002-01-31 05:42:16 UTC
Permalink
Nope that one didn't work.
Subject: Re: [scintilla] New User to Scintilla
Date: Thu, 31 Jan 2002 16:13:27 +1100
Post by Ackbar " "
Ok I setup the folding code as suggested and then in the marginclick
event
I
Post by Ackbar " "
if margin = 2 then scMain.ToggleFold(position);
scMain is the name of the scintilla control. Anyway I ran it and
everything
Post by Ackbar " "
worked till I colapsed it then I got repeating floating point operation
errors. Any ideas?
This may be a bug in 1.43, but fixed since in CVS or in the development
sources at
http://www.scintilla.org/scite.zip
Post by Ackbar " "
Also it only seems to happen if there's nothing in the box but
...
I can't reproduce this with 1.43 or current code.
Neil
_______________________________________________
Scintilla-interest mailing list
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
Continue reading on narkive:
Loading...