[Lazarus] Is it posibble change cursor in source editor

Martin Frb lazarus at mfriebe.de
Sat Jan 31 20:24:44 CET 2015


On 29/01/2015 14:59, Martin Frb wrote:
> On 29/01/2015 14:41, FreeMan wrote:
>> On osx,
>> color set twilight, in source editor cursor not viewing, system color 
>> is black for cursor too. Can it be colored in source editor?
>
> Not that I know.
>
> The caret is drawn by the OS. At least on windows. Apparently GTK does 
> not have it, and the code in the Lcl/widgetset emulates it (but has no 
> property for color).
> On Mac, I do not know what happens.
>
> SynEdit can influence the shape of the caret. But the IDE has no 
> setting to influence this, you would have to add your own change in 
> the IDE code.

It might be now, but you need to do a couple of code changes, since no 
options exist.

unit:
components\synedit\syneditpointclasses.pas

line 2410
constructor TSynEditScreenCaret.Create(AHandleOwner: TWinControl);

change (old)
   FCaretPainter := TSynEditScreenCaretPainterSystem.Create(AHandleOwner);
into (new)
   FCaretPainter := TSynEditScreenCaretPainterInternal.Create(AHandleOwner);


Then find  (same unit),
procedure TSynEditScreenCaretPainterInternal.Paint;

and change the color
- black inverts
- white does nothing
- red inverts the blue and green, but leaves red untouched.
if you have some medium grey as background, try $808080







More information about the Lazarus mailing list