[Lazarus] Column ruler above a synedit

Martin Frb lazarus at mfriebe.de
Tue Feb 10 21:49:14 CET 2015


You should be able to copy  the entire class TSourceLazSynSurfaceManager 
= class(TLazSynSurfaceManager)
(It is in the IDE, but check the svn logs / blame, if no one else but me 
changed it then consider it lgpl+except)

TopLineCount sets how much space you get on top.

TSourceLazSynSurfaceManager(FPaintArea).ExtraManager.DisplayView

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.



On 10/02/2015 20:19, Mark Morgan Lloyd wrote:
> Martin Frb wrote:
>> On 10/02/2015 19:12, Mark Morgan Lloyd wrote:
>>> Is there a preferred way of putting a column ruler above the text in 
>>> a synedit, either (two lines) marking columns or (one line) marking 
>>> tab positions?
>>>
>>> I've previously done this for a file viewer oriented towards large 
>>> files with columnar text (e.g. database query output) by having two 
>>> synedits on the same form, but since the ruler doesn't really want 
>>> line numbers keeping the two lined up was not entirely reliable.
>>>
>>
>> Look at  ide/SourceSynEditor.pp
>>
>> constructor TIDESynEditor.Create(AOwner: TComponent);
>> ....
>>   FPaintArea := TSourceLazSynSurfaceManager.Create(Self, FPaintArea);
>>
>> It wraps the original paint area object, and reduces its size, then 
>> placing a new paintarea for its own purpose on top.
>>
>> In this example the size is variable. For your case it would be 
>> fixed, so it should be easier.
>
> Thanks Martin, I'll investigate.
>





More information about the Lazarus mailing list