[Lazarus] IDE-SynEdit Caret Color

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
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





--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
Caret should paint via pmNotXor (or pmXor) pen mode. MacOS WS bug - it
paints it always black. Win32 should paint Ok.

Alexey
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 18/07/2017 14:53, Dmitry Boyarintsev via Lazarus wrote:

> 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.

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Tue, Jul 18, 2017 at 11:38 AM, Alexey via Lazarus <[hidden email]> 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.


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
On Tue, Jul 18, 2017 at 12:33 PM, Dmitry Boyarintsev <[hidden email]> wrote:
A stand-alone project with SynEdit, draws the caret as expected (with internal colors)

* (with inverted colors)

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Tue, Jul 18, 2017 at 12:33 PM, Dmitry Boyarintsev <[hidden email]> wrote:
On Tue, Jul 18, 2017 at 11:38 AM, Alexey via Lazarus <[hidden email]> 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
 


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
 >The code of the internal caret painter sets pmNotXor mode when drawing
lines. The value seems to be ignored by WS

Yes, it is ignored in Mac WSes.

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 18/07/2017 17:41, Dmitry Boyarintsev via Lazarus wrote:
On Tue, Jul 18, 2017 at 12:33 PM, Dmitry Boyarintsev <[hidden email]> 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.


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.

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IDE-SynEdit Caret Color

Free Pascal - Lazarus mailing list
Alexey, Martin, 
thank you for pointing to the right direction.

it's now fixed for carbon.

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Loading...