[Lazarus] TEditButton alignment
Vojtěch Čihák
vojtech.cihak at atlas.cz
Tue Mar 19 13:12:51 CET 2013
Hello,
I tested the patch from Flávio + correction from Juha in Linux+Qt.
Anchoring now works well (especially right anchoring).
I tested it also as a grid cell editor:
procedure TForm1.StringGrid1SelectEditor(Sender: TObject; aCol, aRow: Integer; var Editor: TWinControl);
var aRect: TRect;
begin
EditButton1.Parent:=StringGrid1;
aRect:=StringGrid1.CellRect(aCol, aRow);
dec(aRect.Right, EditButton1.ButtonWidth); //correction that it will fit to a cell
EditButton1.BoundsRect:=aRect;
Editor:=EditButton1;
end;
There only one issue:
If I click button of stand-alone EditButton then the Edit part keeps focus.
If I click button of cell-editor EditButton then the Edit part losts focus.
Thanks
Vojtech aka Blaazen
______________________________________________________________
> Od: "Juha Manninen" <juha.manninen62 at gmail.com>
> Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> Datum: 19.03.2013 11:00
> Předmět: Re: [Lazarus] TEditButton alignment
>
On Tue, Mar 19, 2013 at 9:48 AM, Juha Manninen
<juha.manninen62 at gmail.com> wrote:
> It does not compile here. It complains about BiDiMode in
> TEditButtonSpacing.GetSpaceAround.
Ok, I changed it as below and it works. I don't know how you tested
the broken code but it looks very nice.
No widgetset code and the component inherits from TCustomEdit.
The code is also clean, no ugly hacks. Why didn't you show it earlier?
Regards
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/20130319/ee533adb/attachment-0003.html>
More information about the Lazarus
mailing list