Recent

Author Topic: Gutter Width  (Read 2122 times)

BubikolRamios

  • Sr. Member
  • ****
  • Posts: 305
Gutter Width
« on: July 15, 2022, 03:29:55 pm »
If I type foo, and execute this, on top of that, it overlaps fine, no change visible
Any logic in +2 ?
Code: Pascal  [Select][+][-]
  1.   with synedit1() do
  2.   begin
  3.           //canvas does not have same font as synedit itself
  4.           //so make it  same
  5.           Canvas.Font := Font;
  6.           Canvas.Brush.Color := clNone;
  7.  
  8.           Canvas.TextOut (Gutter.Width+2,0, 'foo');
  9.   end;  
  10.  
  11.  
« Last Edit: July 15, 2022, 03:34:23 pm by BubikolRamios »
lazarus 3.2-fpc-3.2.2-win32/win64

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10546
  • Debugger - SynEdit - and more
    • wiki
Re: Gutter Width
« Reply #1 on: July 15, 2022, 04:40:33 pm »
Probably
Code: Pascal  [Select][+][-]
  1. const
  2.   GutterTextDist = 2; //Pixel
  3. ...
  4. procedure TCustomSynEdit.RecalcCharsAndLinesInWin(CheckCaret: Boolean);
  5. ...
  6.     if FLeftGutter.Visible
  7.     then FPaintArea.Padding[bsLeft] := GutterTextDist
  8.     else FPaintArea.Padding[bsLeft] := 1;
  9.  



For all else: By painting yourself on the canvas, I guess you invite a lot of pain and trouble...

Whatever you try to do.

 

TinyPortal © 2005-2018