[Lazarus] TCoolBar improvements
Vojtěch Čihák
vojtech.cihak at atlas.cz
Thu May 22 12:36:20 CEST 2014
I've got one objection to AlignControls() method. It's implementation in LCL differs from Delphi.
While in Delphi it comes with parameter AControl: TControl - currently aligned control, in LCL
is this parameter always nil but method is triggered many times (as many controls container has).
Therefore I am careful with using it; it can easily lead to redundant calculations.
Vojtěch
______________________________________________________________
> Od: Juha Manninen <juha.manninen62 at gmail.com>
> Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> Datum: 22.05.2014 12:21
> Předmět: Re: [Lazarus] TCoolBar improvements
>
On Thu, May 22, 2014 at 12:50 PM, Vojtěch Čihák <vojtech.cihak at atlas.cz> wrote:
> I can also look for some optimalization,
> CalculateAndAlign is the most time consuming method, so I'll
> check if it's not called redundantly.
I don't think it is called redundantly but the calls to Invalidate and
ReAlign trigger LCL to call AlignControls and Resize excessively. The
right way is to move the logic from CalculateAndAlign to AlignControls
and CalculatePreferredSize. See my original component, IMO this part
of its design was good.
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/20140522/f42c86fe/attachment-0003.html>
More information about the Lazarus
mailing list