[Lazarus] TEditButton alignment

Flávio Etrusco flavio.etrusco at gmail.com
Mon Mar 18 22:41:31 CET 2013


On Mon, Mar 18, 2013 at 5:48 PM, Juha Manninen
<juha.manninen62 at gmail.com> wrote:
> It is a well known issue that TEditButton aligns wrong.
>
> In the last note of issue
>   http://bugs.freepascal.org/view.php?id=12155
> Mattias writes :
> "The best solution is to redesign TEditButton as an edit and a button
> in a panel. I started it as proof of concept in
> examples/groupedcontrols.
> This will break all current workarounds, so it will not be done for 1.0. "
>
> It was discussed at forum:
>   http://lazarus.freepascal.org/index.php/topic,19496.msg115847.html#msg115847
>
> I would like to know if this "edit and button in a panel" strategy is
> still valid or does it have some hidden traps?
> I don't see any problem with it myself.
> Then it could be implemented in trunk.
>
> The only philosophical problem might be that it doesn't use the
> corresponding native widgetset control even if there was one.
> Not all widgetsets have it.
>
> Juha

I had a patch which fixed alignment problems (I know of) by making the
margin calculation virtual and placing the button inside/over the edit
bounds (increasing the margin accordingly). I don't think I have it
around anymore but the approach was quite simple anyway.

That said, maybe using a panel is the way to go (even if it needs some
work-arounds to make it behave more like a single control to the
developer and incurs a little overhead).

Best regards,
Flávio




More information about the Lazarus mailing list