Sign in Join

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

Mailing lists / lazarus / 2017-07

IDE-SynEdit Caret Color

9 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Dmitry Boyarintsev

Hello

Is there an option to control caret color of IDE editor?

I typically use classic color scheme, that means blue background with yellow text.
However, the OS caret still draws the caret in black.

On SynEdit internals, there's a way to use an internal caret painter TSynEditScreenCaret.Create(.., TSynEditScreenCaretPainterInternal) and that provides a precise control over how caret looks.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170718/75e44036/attachment.html>

Reply by email

Martin Frb
to Dmitry Boyarintsev: Hello Is there an option to control caret color of IDE editor? I typically use classic…
Dmitry Boyarintsev wrote 12 lines
Hello Is there an option to control caret color of IDE editor? I typically use classic color scheme, that means blue background with yellow text. However, the OS caret still draws the caret in black. On SynEdit internals, there's a way to use an internal caret painter TSynEditScreenCaret.Create(.., TSynEditScreenCaretPainterInternal) and that provides a precise control over how caret looks.

No, the IDE does not (yet) have that options (patches welcome / maybe also a not focused color?)

SynEdit has 2 different caret handlers: System / Internal

The default for SynEdit is system, but if multi caret is added, it changes to internal (the IDE has multi caret)

System can not be modified (well may depend on OS). System (at least on win) allows only one caret per app (so an app with 2 SynEdit can still only have one caret)

Internal can be modified, or at least that can be added. Internal does not (yet) follow the system blink rate.

Reply by email

Dmitry Boyarintsev
to Alexey: Caret should paint via pmNotXor (or pmXor) pen mode. MacOS WS bug - it paints it always…

On Tue, Jul 18, 2017 at 11:38 AM, Alexey via Lazarus <

wrote: Caret should paint via pmNotXor (or pmXor) pen mode. MacOS WS bug - it paints it always black. Win32 should paint Ok.

A stand-alone project with SynEdit, draws the caret as expected (with internal colors)
However, IDE caret always appears to be black. Drawing of the caret doesn't seem to be happening via WS.

So I'm wondering is multi-caret / Internal synedit drawing is enabled at all time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170718/bb9de324/attachment.html>

Reply by email

Dmitry Boyarintsev
to Dmitry Boyarintsev: On Tue, Jul 18, 2017 at 11:38 AM, Alexey via Lazarus < A stand-alone project with…

On Tue, Jul 18, 2017 at 12:33 PM, Dmitry Boyarintsev <

Show quoted text 17 lines
wrote: On Tue, Jul 18, 2017 at 11:38 AM, Alexey via Lazarus < > wrote: > Caret should paint via pmNotXor (or pmXor) pen mode. MacOS WS bug - it > paints it always black. Win32 should paint Ok. A stand-alone project with SynEdit, draws the caret as expected (with internal colors) However, IDE caret always appears to be black. Drawing of the caret doesn't seem to be happening via WS. So I'm wondering is multi-caret / Internal synedit drawing is enabled at all time.

Just like Martin said - the internal painter is used.

The code of the internal caret painter sets pmNotXor mode when drawing lines.
The value seems to be ignored by WS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170718/d320ddf9/attachment-0001.html>

Reply by email

Martin Frb
to Dmitry Boyarintsev: On Tue, Jul 18, 2017 at 12:33 PM, Dmitry Boyarintsev < Just like Martin said - the…
Dmitry Boyarintsev wrote 7 lines
On Tue, Jul 18, 2017 at 12:33 PM, Dmitry Boyarintsev < <mailto:>> wrote: So I'm wondering is multi-caret / Internal synedit drawing is enabled at all time.

In the IDE yes. It becomes active when the multi caret plugin is added. Independent of the amount of carets used.

Show quoted text 7 lines
Just like Martin said - the internal painter is used. The code of the internal caret painter sets pmNotXor mode when drawing lines. The value seems to be ignored by WS

Yes must be WS.

Tested on w32
white BG => black caret
black BG => white caret

However since the current color for pmNotXor inverts all bits, there is one case:
If your BG is grey 7F 7F 7F, the the caret is 80 80 80. Not really helpful. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170718/eb24b135/attachment.html>

Reply by email