[Lazarus] clDefault for brushes and fonts

Paul Ishenin ip at kmiac.ru
Fri Nov 19 12:05:50 CET 2010

Hello, Lazarus mailing list.

I want to inform you that starting with r28344 all controls default 
fonts an brushes will have clDefault color instead of clBtnFace/clWindow 
as you had for years.

That was made because non windows widgetsets does not use clBtnFace 
color for forms, clWindow for edit controls and also have different 
ideas regards default font colors 

I believe that I can't foresee all the situations where your code 
depends on this. So I expect you will see some graphic glitches but hope 
not much. Please report them as unswer to this message and to the bug 

TCanvas mostly know how to handle clDefault color in different 
situations but not in all.

For example:

TControl.Color := clDefault - is ok - control knows how to handle it.
TControlCanvas.Brush.Color := clDefault - is ok too because 
TControlCanvas has TControl and get retrieve the correct representation 
of clDefault.

But TBitmap.Canvas.Brush.Color := clDefault will result in black color 
because TBitmap knows nothing about control and can't resolve clDefault 
to another color.

To obtain what clDefault color means for TControl use 
TControl.GetDefaultColor() method.

Best regards,
Paul Ishenin.

More information about the Lazarus mailing list