[Lazarus] Matching gutter width on two synedits

Martin lazarus at mfriebe.de
Sun Feb 12 19:36:09 CET 2012


On 12/02/2012 18:19, Mark Morgan Lloyd wrote:
> Continuing with my exercise of recompiling programs with (fairly) a 
> recent version of Lazarus, I've got one here with two synedits: the 
> bottom one is used to display and possibly edit a file, the top one is 
> populated with numbers and used as a ruler.
>
> Compiled with 0.9.24 the gutter of the two synedits is the same width, 
> but compiled with 0.9.30 the (left) gutter width varies- possibly in 
> response to how many digits would be needed to express the line 
> number. I'm having difficulty working through the structures: can I 
> force the gutter width of one of them so that it matches with the other?
>

SynEdit.Gutter.AutoSize
SynEdit.Gutter.Width

SynEdit.Gutter.Parts.Count
SynEdit.Gutter.Parts[n].AutoSize
SynEdit.Gutter.Parts[n].Width

SynEdit.Gutter.Parts.ByClass[TSynGutterLineNumber, 0]

All of that also in object inspector. So you can also fine tune, what 
should be in the gutter


If you want to keep the lower one autosized. There is also
SynEdit.Gutter.OnResize

BUT it is currently used by SynEdit. That needs to be fixed.
If you use it, store the existing value and call it when triggered







More information about the Lazarus mailing list