On Fri, Oct 21, 2011 at 10:35 AM, Paul Ishenin <[email protected]> wrote:
> GetColor should return the color assigned to a control. In other case you
> will have many problems with object inspector and form saving.
Indeed ... In this case I propose something like this:
function TControl.GetColorResolvingParent: TColor;
begin
if Color = clDefault then
Result := GetDefaultColor(dctBrush)
else
Result := Color;
end;
function TControl.GetRGBColor: TColor;
begin
Result := ColorToRGB(GetColorResolvingParent);
end;
What do you think? Using the if ... else everywhere that wants to
obtain the color is really not great. Proposals for naming this?
--
Felipe Monteiro de Carvalho
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus