Sign in Join

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

Mailing lists / lazarus / 2015-01

Is it posibble change cursor in source editor

20 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

FreeMan

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?

Reply by email

Martin Frb
to FreeMan
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.

Reply by email

FreeMan
to Martin Frb

Thank you,
This problem in just 64 bit QT on osx on corbon is okey short way is change background color, or change color set. https://code.google.com/p/delphi-ide-theme-editor/ 2300 color themes for lazarus :)

Martin Frb wrote 10 lines
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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150130/8219ba1a/attachment.html>

Reply by email

Martin Frb
to Martin Frb: Not that I know. The caret is drawn by the OS. At least on windows. Apparently GTK does…
Martin Frb wrote 15 lines
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

Reply by email

FreeMan
to Martin Frb

thank you Martin, I can look next week.

Martin Frb wrote 25 lines
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

Reply by email

FreeMan
to FreeMan

Hello Martin,
After this message, syneditpointclasses.pas file is changed, create codes etc. If its possible sent new suggestion please?

FreeMan wrote 37 lines
thank you Martin, I can look next week. On 31.01.2015 21:24, Martin Frb wrote: > > 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 -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Martin Frb
to FreeMan

Still the same, just line numbers are changed. Search for TSynEditScreenCaret.Create(

Or go to ide/SourceSynEditor and
in  line 1610
   constructor TIDESynEditor.Create(AOwner: TComponent);
add
ScreenCaret.ChangePainter(TSynEditScreenCaretPainterInternal);
TSynEditScreenCaretPainterInternal(ScreenCaret.Painter).Color :=
FreeMan wrote 49 lines
Hello Martin, After this message, syneditpointclasses.pas file is changed, create codes etc. If its possible sent new suggestion please? On 31.01.2015 21:50, FreeMan wrote: > thank you Martin, I can look next week. > > On 31.01.2015 21:24, Martin Frb wrote: >> >> 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 > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

FreeMan
to Martin Frb
Show quoted text 16 lines
On 31.01.2015 21:24, Martin Frb wrote: 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);

Something wrong but what is wrong :)
I got svn version fpc & lazarus I added lines from source. I wrote create code is different in your message, I told about that.

/opt/lazarus/components/synedit/syneditpointclasses.pas .....
2644:{ TSynEditScreenCaret }

constructor TSynEditScreenCaret.Create(AHandleOwner: TWinControl);
begin
   Create(AHandleOwner, TSynEditScreenCaretPainterSystem);
end;
constructor TSynEditScreenCaret.Create(AHandleOwner: TWinControl;
   APainterClass: TSynEditScreenCaretPainterClass);
begin
   inherited Create;
   FCaretPainter := APainterClass.Create(AHandleOwner, Self);
   FLockCount := -1;
   ResetCaretTypeSizes;
   FHandleOwner := AHandleOwner;
   FVisible := False;
   FCurrentVisible := False;
   FCurrentCreated := False;
   FCurrentPosX := -1;
   FCurrentPosY := -1;
   FClipExtraPixel := 0;
   FLockCount := 0;
end;

Reply by email

Martin Frb
to FreeMan
FreeMan wrote 30 lines
> On 31.01.2015 21:24, Martin Frb wrote: > > 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); Something wrong but what is wrong :) I got svn version fpc & lazarus I added lines from source. I wrote create code is different in your message, I told about that. /opt/lazarus/components/synedit/syneditpointclasses.pas ..... 2644:{ TSynEditScreenCaret } constructor TSynEditScreenCaret.Create(AHandleOwner: TWinControl); begin Create(AHandleOwner, TSynEditScreenCaretPainterSystem);
Replace this with
     Create(AHandleOwner, TSynEditScreenCaretPainterInternal);

and then

procedure TSynEditScreenCaretPainterInternal.Init;
begin
   FSavePen := TPen.Create;
   FColor := clBlack;
   inherited Init;
end;

replace clBlack with your choice

Reply by email

Martin Frb
to FreeMan
FreeMan wrote 8 lines
I did before, when start IDE, IDE give Access violation, and terminate On 6.02.2015 19:21, Martin Frb wrote: > Replace this with > Create(AHandleOwner, TSynEditScreenCaretPainterInternal); > > and then

I just tried this myself (under win32), no error. IDE started just fine. Make sure you have todays SVN. And this, and the color are the 2 only changes in the file.

Otherwise try the 2 lines in SourcSynEditor I sent 2 mails before.

If it still happens maybe it is a mac only bug, could you try and get a stacktrace?

Reply by email

FreeMan
to Martin Frb

I tryed all, but same result, "Access violation." and IDE terminate. source editor is opening, but default colors, popup error message and click ok or cancel IDE terminate.
I'm still not use to osx, how can I get stacktrace?

Martin Frb wrote 5 lines
Otherwise try the 2 lines in SourcSynEditor I sent 2 mails before. If it still happens maybe it is a mac only bug, could you try and get a stacktrace?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150208/ab5b11ed/attachment.html>

Reply by email

Martin Frb
to FreeMan
FreeMan wrote 11 lines
I tryed all, but same result, "Access violation." and IDE terminate. source editor is opening, but default colors, popup error message and click ok or cancel IDE terminate. I'm still not use to osx, how can I get stacktrace? On 6.02.2015 22:32, Martin Frb wrote: > > Otherwise try the 2 lines in SourcSynEditor I sent 2 mails before. > > If it still happens maybe it is a mac only bug, could you try and get > a stacktrace?

You will need gdb. (codesigned)
See the wiki. Unfortunately, I can not advice myself on how to codesign gdb.

You can debug the IDE inside the IDE, by opening ide/lazarus.lpi

Or you may run in a shell (there is a lazarus somewhere inside the lazarus.app folder, find it , and use that path below) gdb /path/to/laz/lazarus.app/......./lazarus
then in gdb, enter "r" and return and when the error happen (lazarus will freeze, gdb will print something), enter "bt" and return.

I am doing further changes to the code, so maybe just use the old version, until I commit again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150208/4677e8c0/attachment-0001.html>

Reply by email

FreeMan
to Martin Frb

Okey, I'm waiting your commit

Martin Frb wrote 14 lines
You will need gdb. (codesigned) See the wiki. Unfortunately, I can not advice myself on how to codesign gdb. You can debug the IDE inside the IDE, by opening ide/lazarus.lpi Or you may run in a shell (there is a lazarus somewhere inside the lazarus.app folder, find it , and use that path below) gdb /path/to/laz/lazarus.app/......./lazarus then in gdb, enter "r" and return and when the error happen (lazarus will freeze, gdb will print something), enter "bt" and return. I am doing further changes to the code, so maybe just use the old version, until I commit again.

Reply by email

FreeMan
to Martin Frb

r47714:
insource editor,
i386 carbon:
cursor (or carret) color is blank but now its not blink x64 qt cursor (or carret) color is blank but now its not blink. And in the same line, position set first time but, if click other column, later or before, cursor not move. not move left or right via keyboard as well. this is urgent :)

Martin Frb wrote 11 lines
On 08/02/2015 13:45, FreeMan wrote: > Okey, I'm waiting your commit Done, if you test please let me know how it goes. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

FreeMan
to FreeMan

may be give more info, I forget add before, sorry. osx -QT- x64

FreeMan wrote 14 lines
r47714: insource editor, i386 carbon: cursor (or carret) color is blank but now its not blink x64 qt cursor (or carret) color is blank but now its not blink. And in the same line, position set first time but, if click other column, later or before, cursor not move. not move left or right via keyboard as well. this is urgent :) On 12.02.2015 05:49, Martin Frb wrote: > On 08/02/2015 13:45, FreeMan wrote: >> Okey, I'm waiting your commit > > Done, if you test please let me know how it goes.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/4f1122a7/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: cgahfjfi.
Type: image/jpeg
Size: 15756 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/4f1122a7/attachment-0001.jpe>

Reply by email

FreeMan

lazarus r47718:
on qt x64:

   {$IFDEF LCLCarbon}
     FForcePaintEvents := True;
   {$ELSE}
     FForcePaintEvents := True; --> this is work normal now, carret is

showing and blinking, in carbon work too

   {$ENDIF}

I attached 2 screenshots. How to view carret in widgetset. qt little bit thin and down I think.
this is in carbon :
this is in QT :

I think now can try change colour for visibility in dark(black) background.

Martin Frb wrote 15 lines
Please try again. It should be handled by IFDEF, but if not, ensure (line 2822) FForcePaintEvents := True; is set and in the active ifdef (or make both ifdef/else ":= true") I tested it win, gtk, and a very old carbon. No idea about Cocoa. Also not checked QT (you may have to set the above value yourself, as the define in carbon only). Also if it fails, run the IDE with --debug-log=/path/log_file and check for any errors

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/9a7fe72d/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: aiiffcbf.
Type: image/jpeg
Size: 15708 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/9a7fe72d/attachment-0002.jpe> -------------- next part --------------
A non-text attachment was scrubbed...
Name: jdiffdci.
Type: image/jpeg
Size: 15708 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/9a7fe72d/attachment-0003.jpe>

Reply by email

FreeMan
to FreeMan
FColor := $CCD148;// Medium Turquoise
//todo- for me maybe change shape caret too

will you add this caret color property to lazarus IDE options -> Editor -> Display -> Colors ?
Thank you.

FreeMan wrote 17 lines
lazarus r47718: on qt x64: {$IFDEF LCLCarbon} FForcePaintEvents := True; {$ELSE} FForcePaintEvents := True; --> this is work normal now, carret is showing and blinking, in carbon work too {$ENDIF} I attached 2 screenshots. How to view carret in widgetset. qt little bit thin and down I think. this is in carbon : this is in QT : I think now can try change colour for visibility in dark(black) background.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/88745230/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: idccjjac.
Type: image/jpeg
Size: 15673 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/88745230/attachment-0003.jpe> -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 15708 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/88745230/attachment-0004.jpe> -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 15708 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/88745230/attachment-0005.jpe>

Reply by email

Martin Frb
to FreeMan
FreeMan wrote 7 lines
FColor := $CCD148;// Medium Turquoise //todo- for me maybe change shape caret too will you add this caret color property to lazarus IDE options -> Editor -> Display -> Colors ? Thank you.

Maybe, ... (if I find time).
I am working on other stuff, that I want to do first.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/02383173/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 15673 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150212/02383173/attachment.jpe>

Reply by email