[Lazarus] How to obtain the color of a component?
Paul Ishenin
ip at kmiac.ru
Fri Oct 21 10:33:40 CEST 2011
21.10.2011 16:21, Felipe Monteiro de Carvalho пишет:
> On Fri, Oct 21, 2011 at 10:14 AM, Paul Ishenin<ip at kmiac.ru> wrote:
>> How ParentColor property will work in this case?
>
> I think that it would work like this:
>
> function TWinControl.GetColor: TColor
> begin
> if ParentColor and (Parent<> nil) then Result := Parent.Color
> else Result := FColor;
> end;
Yes. You have a TButton with ParentColor = True. Have 2 special colors:
one for form, one for button. With your proposal button will show in
form color.
Also think how to implement that colors on widgetset side. How widgetset
should handle a situation when you set clDefaultPageControl color to
TButton?
Best regards,
Paul Ishenin.
More information about the Lazarus
mailing list