Lazarus

Programming => Packages and Libraries => SynEdit => Topic started by: BubikolRamios on July 15, 2022, 03:29:55 pm

Title: Gutter Width
Post by: BubikolRamios 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.  
Title: Re: Gutter Width
Post by: Martin_fr 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