[Lazarus] TEditButton alignment

Vojtěch Čihák vojtech.cihak at atlas.cz
Mon Mar 18 22:46:39 CET 2013


Hello,
 
I already tried to extend "examples/groupedcontrols" make it 100% compatible with current implementation.
Note that instead of TTransparentPanel I used a pure TWinControl. AFAIR the difference is that TTransparentPanel
has Canvas (which we don't need here) + some flags of TComponentState.
It works well as a grid cell editor and also all descendant components works (TDirectoryEdit, TFileNameEdit, ...).
The only remaining problem is property ButtonOnlyWhenFocus. This property was probably NOT implemented for Delphi compatibility.
It is difficult to reach the same behaviour with the new approach.
Let's say Edit is 100px wide and Button 20px (i.e. 120px total).
Currently only Button visibility changes.
New grouped approach requires enlarge on SetFocus and shrink on KillFocus. I tried several hacks and reached ~90% success but the code is not very staightforward and KISS.
It should be better to change behaviour: focused: 80 + 20 px; not focused: 100px Edit. This is more native since LCL anchoring automatically skips invisible components.
Or leave this property (mark it as "deprecated").
 
So I would like to know if there were some special reason to use TransparentPanel and what to do with property ButtonOnlyWhenFocus.
 
Thanks.
 
Vojtech Cihak a.k.a. Blaazen
 
______________________________________________________________
> Od: "Juha Manninen" <juha.manninen62 at gmail.com>
> Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> Datum: 18.03.2013 21:48
> Předmět: [Lazarus] TEditButton alignment
>
It is a well known issue that TEditButton aligns wrong.

In the last note of issue
  http://bugs.freepascal.org/view.php?id=12155 <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 <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

--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus <http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130318/596f8d8f/attachment-0003.html>


More information about the Lazarus mailing list