Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-10

Marking columns in synedit

7 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

Is there an easy way of setting columns to a different background and/or foreground colour?

I've got two synedits, one in a main window with "music ruled" coloured lines and a small one above it numbered for columns, provided that the fount etc. is the same the relative positioning is correct. I'd like to be able to highlight header columns to mark tab positions, it's safe to assume that all visible character positions will contain a digit or a space.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Martin
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 10 lines
Is there an easy way of setting columns to a different background and/or foreground colour? I've got two synedits, one in a main window with "music ruled" coloured lines and a small one above it numbered for columns, provided that the fount etc. is the same the relative positioning is correct. I'd like to be able to highlight header columns to mark tab positions, it's safe to assume that all visible character positions will contain a digit or a space.
If you want to highlight headers (that is in the one line SynEdit) then
look at the position highlighter (lazarus:  examples/synedit/

If you want to highlight the same column(s) in every line, and there may be any number of lines, you would have to add the highlight for *every* line (lot of adding). You may rather try to modify the highlighter. ( http://wiki.lazarus.freepascal.org/SynEdit_Highlighter )

You can also inherit your own SynEdit, and add multiply SynMarkupSelection modules, which you can easily change to highlight boundaries given by you (in your color) rather than the current selection.

Reply by email

Mark Morgan Lloyd
to Martin
Martin wrote 24 lines
On 29/10/2011 11:30, Mark Morgan Lloyd wrote: > Is there an easy way of setting columns to a different background > and/or foreground colour? > > I've got two synedits, one in a main window with "music ruled" > coloured lines and a small one above it numbered for columns, provided > that the fount etc. is the same the relative positioning is correct. > I'd like to be able to highlight header columns to mark tab positions, > it's safe to assume that all visible character positions will contain > a digit or a space. > If you want to highlight headers (that is in the one line SynEdit) then look at the position highlighter (lazarus: examples/synedit/ If you want to highlight the same column(s) in every line, and there may be any number of lines, you would have to add the highlight for *every* line (lot of adding). You may rather try to modify the highlighter. ( http://wiki.lazarus.freepascal.org/SynEdit_Highlighter ) You can also inherit your own SynEdit, and add multiply SynMarkupSelection modules, which you can easily change to highlight boundaries given by you (in your color) rather than the current selection.

Thanks Martin, now looking at the example. The header pane is typically only a couple of lines and is rarely updated so I don't think it's going to be a problem.

I'm looking at some badly-OCRed Pascal, and anything that helps keep the indents straight is going to be a big help.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Martin
to Mark Morgan Lloyd: Thanks Martin, now looking at the example. The header pane is typically only a couple of…

Try the attached => type some text into the edit

Mark Morgan Lloyd wrote 34 lines
Martin wrote: > On 29/10/2011 11:30, Mark Morgan Lloyd wrote: >> Is there an easy way of setting columns to a different background >> and/or foreground colour? >> >> I've got two synedits, one in a main window with "music ruled" >> coloured lines and a small one above it numbered for columns, >> provided that the fount etc. is the same the relative positioning is >> correct. I'd like to be able to highlight header columns to mark tab >> positions, it's safe to assume that all visible character positions >> will contain a digit or a space. >> > > > If you want to highlight headers (that is in the one line SynEdit) > then look at the position highlighter (lazarus: examples/synedit/ > > If you want to highlight the same column(s) in every line, and there > may be any number of lines, you would have to add the highlight for > *every* line (lot of adding). You may rather try to modify the > highlighter. ( http://wiki.lazarus.freepascal.org/SynEdit_Highlighter ) > > You can also inherit your own SynEdit, and add multiply > SynMarkupSelection modules, which you can easily change to highlight > boundaries given by you (in your color) rather than the current > selection. Thanks Martin, now looking at the example. The header pane is typically only a couple of lines and is rarely updated so I don't think it's going to be a problem. I'm looking at some badly-OCRed Pascal, and anything that helps keep the indents straight is going to be a big help.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: synHL.rar
Type: application/octet-stream
Size: 64504 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111029/e637f91a/attachment-0001.obj>

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner: On Sat, 29 Oct 2011 11:35:25 +0000 I'm curious, why do OCR Pascal? Mattias
Mattias Gaertner wrote 7 lines
On Sat, 29 Oct 2011 11:35:25 +0000 Mark Morgan Lloyd wrote: > [...] > I'm looking at some badly-OCRed Pascal, I'm curious, why do OCR Pascal?

I think it was you who said that you've got a particular dislike of Perl? Well I've found sources for a parser/interpreter for the one language you are guaranteed to like even less- written in CDC Pascal in a PDF scanned from a printed newsletter.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email