[Lazarus] TCoolBar improvements
Juha Manninen
juha.manninen62 at gmail.com
Sat May 10 17:35:24 CEST 2014
I move a note from issue #26096 here.
>Vojtech Cihak:
> ... LCL triggers 6-12 AlignControls on one CalculateAndAlign (just uncomment DebugLn() in these methods).
Naturally AlignControls and Resize are called often because you call
CalculateAndAlign and Invalidate from around your code.
CalculateAndAlign even calls ReAlign.
I have a feeling you did not study my original component design
enough. It was very much based on AlignControls and
CalculatePreferredSize.
After that no hacks were needed for the positioning. No ReAlign, no
Invalidate (except for few special places)...
It followed the design of LCL and the intended usage of those functions.
I also implemented BiDiMode after lots of trial and error and
scratching my head. Your version does not support it at all.
I tried to change the code to use AlignControls and
CalculatePreferredSize better but it requires many changes now. I will
look at it later again (unless you do it).
On the other hand, the Drag'n'Drop and images in your version are
_cool_ features, so the component is getting to hold up to its name.
:)
> I already observed TControlBar in Delphi7. It has no (published) bands. Components can be in multiple rows
> and height of higher controls is always rounded to integer-multiple of the first row. Control are movable at design time.
> I think it is not so hard task. I try to move common code of TCoolBar and TControlBar to some TCustomBar
> (or TBaseBar - if there'll be some abstract methods) - as you wrote on ML.
Yes. I don't know how much code can be shared. Having bands and not
having bands is a big difference after all.
Juha
More information about the Lazarus
mailing list