<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 10/02/2015 22:18, Mark Morgan Lloyd
      wrote:<br>
    </div>
    <blockquote cite="mid:mbe04d$ohq$1@pye-srv-01.telemetry.co.uk"
      type="cite">Martin Frb wrote:
      <br>
      <blockquote type="cite">You should be able to copy  the entire
        class TSourceLazSynSurfaceManager = class(TLazSynSurfaceManager)
        <br>
        (It is in the IDE, but check the svn logs / blame, if no one
        else but me changed it then consider it lgpl+except)
        <br>
        <br>
        TopLineCount sets how much space you get on top.
        <br>
        <br>
        TSourceLazSynSurfaceManager(FPaintArea).ExtraManager.DisplayView
        <br>
        <br>
        set a source for the text you want to paint.  If you do NOT
        forward to the textbuffer, then it will not come via the
        highlighter, and be highlightfree. But you can add your own.
        <br>
      </blockquote>
      <br>
      Is my understanding of what you're saying correct that there would
      be dead space to the left of the extra top line stuff if line
      numbers were displayed (which is what I want)?
      <br>
      <br>
      I'll take a look at the logs presently to work out what went in
      when. My older code, relying on stacked synedits, is good for the
      GTKv1 era.
      <br>
      <br>
    </blockquote>
    <br>
    Same as for the top-hint in the ide.<br>
    Yes the gutter stays empty. At least it can, and work like that in
    the IDE. All the code should be in SourceSynEditor.<br>
    See image<br>
    <br>
    SynEdit delegates all painting to the TextArea, which also returns
    how much space it can offer.<br>
    <br>
    Normal SynEdit:<br>
      FTextArea := TLazSynTextArea.Create<br>
    TLazSynTextArea  splits the space 3 ways (see the creator of SyNedit
    and/or TSourceLazSynSurfaceManager<br>
    Left/Right Gutter and Text<br>
    <br>
    TSourceLazSynSurfaceManager splits it 2 ways: upper/lower<br>
    - The lower is known to SynEdit, and contains and provides SynEdit
    with info on the boundaries.<br>
    - The upper is in your control. It also has 2 gutter, but unless you
    feed them they stay empty (in the IDE even changes to the gutter
    setting appear to be forwarded, not sure how)<br>
    <br>
    From SourceSynEditor<br>
      TSourceLazSynSurfaceManager(FPaintArea).ExtraManager.DisplayView
    := FTopInfoDisplay;<br>
    <br>
    FTopInfoDisplay provides the info what to paint. You need to do your
    own<br>
    From my memory....<br>
    <br>
    <blockquote type="cite">    procedure
      InitHighlighterTokens(AHighlighter: TSynCustomHighlighter);
      virtual;<br>
    </blockquote>
    nothing<br>
    <blockquote type="cite">    procedure
      SetHighlighterTokensLine(ALine: TLineIdx; out ARealLine:
      TLineIdx); virtual;<br>
    </blockquote>
     will be called with 0, and gives "out" 0 // sets the line (index)
    that needs to be painted.<br>
    Since your area is the height of 1 line, and GetLinesCount retunrs 1
    there is no scrolling (Also nothing  (except you) will change the
    topline for this)<br>
    <blockquote type="cite">    procedure FinishHighlighterTokens;
      virtual;<br>
    </blockquote>
    nothing<br>
    <blockquote type="cite">    function  GetNextHighlighterToken(out
      ATokenInfo: TLazSynDisplayTokenInfo): Boolean; virtual;<br>
    </blockquote>
     your text<br>
        TokenStart: PChar;<br>
        TokenLength: integer;<br>
        TokenAttr: TSynHighlighterAttributes;<br>
    you may need a TSynHighlighterAttributes; (color)  but try nil, or
    create an empty one<br>
    <br>
    <blockquote type="cite">    function GetLinesCount: Integer;
      virtual;<br>
    </blockquote>
     always ONE (1)
    <blockquote type="cite">    function GetDrawDividerInfo:
      TSynDividerDrawConfigSetting; virtual;<br>
    </blockquote>
        Result.Color := clNone;<br>
    <blockquote type="cite"><br>
          function TextToViewIndex(AIndex: TLineIdx): TLineRange;
      virtual;<br>
          function ViewToTextIndex(AIndex: TLineIdx): TLineIdx; virtual;<br>
    </blockquote>
    return same as input // used by folding<br>
    <br>
    <br>
    <br>
    <br>
    <br>
    In your case to prevent the gutter<br>
    -  Inherit TLazSynGutterArea<br>
    - in TSourceLazSynSurfaceManager.Create use your class for the
    gutter<br>
    - in YOUR_TLazSynGutterArea.DoPaint(ACanvas: TCanvas; AClip: TRect);<br>
     call<br>
      FGutter.Paint(ACanvas, Self, AClip, 0, -1);<br>
    <br>
    that should keep it empty<br>
    <br>
    <br>
    For your case you need to add handling of LeftChar for horizontal
    scroll.<br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <img src="cid:part1.07030407.06080809@mfriebe.de" alt=""><br>
  </body>
</html>