This project is read-only.

Margins

Jul 24, 2007 at 6:22 PM
Hi,

sorry for my questions, but what can be done with the margins (and how to do something with them) ?
Jul 25, 2007 at 12:31 AM
These are the defaults:
Margin 0 shows line numbers
Margin 1 shows Markers
Margin 2 shows folding Indicators

Margin 1 is shown be default, you can show the other margins by using MarginWidthN() For instance this call shows the line numbers
scintilla.MarginWidthN(0, 25);

You'll have to dig further into the scintilla documentation in order to do Markers or folding as again, it's complicated.

I've actually been working in an alternate code line that has a much easier to use API. Look in the Chris Folder of the latest source. (If it doesn't work for you you may need to upgrade your scilexer.dll to 1.7.4).

I'd say within a week this code will be ready to replace the main code line. Why don't you give this one a try, the Forms designer lets you do a lot of the work.
Jul 25, 2007 at 8:34 AM
Thank you, I understood.
You do nice work with ScintillaNET.

I thought, the margins can be user drawn in some way.
Jul 25, 2007 at 4:08 PM
That is one of my goals, but I ran into problems with the Paint Events. .NET seems to only give you paint events when you have ControlStyle.UserPaint set to true. However this has to be turned off in order to get Scintilla to paint.
Jul 25, 2007 at 5:47 PM
Do you already have an idea how to solve that problem?
Jul 25, 2007 at 8:18 PM
Yeah I was thinking that I might be able to get it to work by turning on ControlStyle.UserPaint but also intercepting WM_PAINT messages and giving them straight to Scintilla's WndProc so that it knows to paint itself. This in theory can give us both behaviors.
Aug 1, 2007 at 7:24 AM
With the latest code: Changeset 25246 you can handle paint events. Also the Margin Class now has a GetClientRectangle method. Lastly there is a VisibleLines property on the Lines class.

It should be pretty easy now to do your own margin painting.
Aug 1, 2007 at 2:02 PM
Wow. Nice programming.
Thank you.