[Lazarus] Column ruler on TSynEdit

Martin lazarus at mfriebe.de
Tue Oct 22 13:46:28 CEST 2013


On 22/10/2013 12:40, 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).

Just a note, about optimizing painting. purely optional.

On some widgetset, invalidate always is the minimum enclosure rectangle 
for all invalidated parts.

So invalidating a bit of text at the visible bottom of the editor paints 
this bit of text (actually the full line)

But invalidating a bit of text at the visible bottom AND a bit of text 
(or gutter) on the top, will paint ALL lines inbetween too.

-------------
For that reason the overview gutter (which often invalidates on a 
different Y pos, than the rest of synEdit) creates a wincontrol of its 
own. This is a child to the SynEdit.






More information about the Lazarus mailing list