Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-02

Matching gutter width on two synedits

9 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

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?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Martin
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 11 lines
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

Reply by email

Martin
to Martin
Martin wrote 31 lines
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.

FIXED

Show quoted text 10 lines
If you use it, store the existing value and call it when triggered -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mark Morgan Lloyd
to Martin: SynEdit.Gutter.AutoSize SynEdit.Gutter.Width SynEdit.Gutter.Parts.Count…
Martin wrote 31 lines
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]

Reply by email

Martin
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 37 lines
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).

you got my 2nd mail? In trunk you can use Gutter.OnResize It is no longer internally used.

The future willl bring an alternative to do this in one edit (but currently it does ignore many settings, including font). $DEFIN WithSynInfoView splits one synedit...

Reply by email

Mark Morgan Lloyd
to Martin
Martin wrote 15 lines
>> 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). > you got my 2nd mail? In trunk you can use Gutter.OnResize It is no longer internally used.

Yes, but I'd spent the last few days scratching my head over a project that had been "polluted" by the trunk IDE, and for the moment at least am trying to ("fixed").

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mark Morgan Lloyd
Martin wrote 16 lines
On 13/02/2012 08:18, Mark Morgan Lloyd wrote: > Martin wrote: > >> you got my 2nd mail? In trunk you can use Gutter.OnResize >> It is no longer internally used. > > Yes, but I'd spent the last few days scratching my head over a project > that had been "polluted" by the trunk IDE, and for the moment at least > am trying to ("fixed"). > Ok, then don't forget to test if OnResize was assigned before forwarding the call or it will break again in future...

I've added an explicit note to the code to migrate to that once I start compiling for trunk again.

But be warned that before I go anywhere near that I'm going to be investigating injecting APL-style characters into Synedit. You might prefer to keep your head down :-)

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Martin
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 5 lines
But be warned that before I go anywhere near that I'm going to be investigating injecting APL-style characters into Synedit. You might prefer to keep your head down :-)

Let me know how it goes. As long as they are represented in utf8

There is one known issue in synedit (but easy to fix). Combined chars (2 codepoints for one char).
eg representing an "?" as <double dot> + <o>

All I need are the unicode ranges of those ...

Reply by email

Mark Morgan Lloyd
to Martin
Martin wrote 8 lines
On 13/02/2012 18:50, Mark Morgan Lloyd wrote: > > But be warned that before I go anywhere near that I'm going to be > investigating injecting APL-style characters into Synedit. You might > prefer to keep your head down :-) > Let me know how it goes. As long as they are represented in utf8

Will do, I'm aiming for something like http://www.aplusdev.org/keyboard.html

I'm assuming (for the moment at least) that getting these sort of characters into dialog(ue) boxes would be an entirely different issue.

Show quoted text 5 lines
There is one known issue in synedit (but easy to fix). Combined chars (2 codepoints for one char). eg representing an "?" as <double dot> + <o> All I need are the unicode ranges of those ...

My expertise as far as these is concerned is negligible, since there are very few cases where this sort of thing appears in English. An interesting point here is that Sun keyboards (i.e. directly connected to the computer, possibly not via xterm etc.) have a compose key, I'm not promising immediate activity but it would be interesting to look at this on both Linux and Solaris... although so far Solaris 10's UTF-8 handling appears poor.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email