[Lazarus] Matching gutter width on two synedits

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Sun Feb 12 21:06:54 CET 2012


Martin wrote:
> 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

Thanks Martin, that allows me to fudge it to look OK (although my code 
is somewhat inelegant).

-- 
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