[Lazarus] Column ruler on TSynEdit

Martin lazarus at mfriebe.de
Tue Oct 22 13:40:25 CEST 2013


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.




More information about the Lazarus mailing list