[Lazarus] Column ruler on TSynEdit

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Tue Oct 22 15:03:26 CEST 2013

Martin wrote:
> On 22/10/2013 12:28, Mark Morgan Lloyd wrote:
>> Is there a painless way to get a column ruler at the top of a 
>> TSynEdit, without having to do something like having multiple controls 
>> in a frame and forcing sideways scrolling to track?
> You can write a subclass of SynEdit, similar (but smaller than) to 
> TIDESynEditor (in ide SourceSynEditor.pas)
> using something like (this displays the procedure top hint)
>     FTopInfoDisplay: TSourceLazSynTopInfoView;
> That is reserving one line of the display for whatever you want it to be.
> It is some work though....
> Or go the full 9 yards: Implement a top/bottom gutter (and submit it as 
> patch).
> In synedit, you have
>     FPaintArea: TLazSynSurfaceManager;
>   FPaintArea := TLazSynSurfaceManager.Create(Self);
>   FPaintArea.TextArea := FTextArea;
>   FPaintArea.LeftGutterArea := FLeftGutterArea;
>   FPaintArea.RightGutterArea := FRightGutterArea;
>   FPaintArea.DisplayView := FDisplayView;
> So that allows to add top/bottom gutter, and reserve the space needed 
> (set correct boundaries for all other elements.
> Note there must be no gaps between them. Gaps will not be painted at all.

Thanks, I'll give that some thought. In practice it's only to show where 
e.g. column 7 is on a punched card image.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the Lazarus mailing list