Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

clDefault for brushes and fonts

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul Ishenin

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
(http://bugs.freepascal.org/view.php?id=13577,
http://bugs.freepascal.org/view.php?id=14571,
http://bugs.freepascal.org/view.php?id=12550).

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 tracker.

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.

Reply by email

Luiz Americo Pereira Camara
to Paul Ishenin
Paul Ishenin wrote 17 lines
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 (http://bugs.freepascal.org/view.php?id=13577, http://bugs.freepascal.org/view.php?id=14571, http://bugs.freepascal.org/view.php?id=12550). 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 tracker.

VirtualTreeView paints the background in black. This occurs because it assigns the TControl.Color to a temp bitmap brush.

Not big deal since i can change Color to clWindow (or check for clDefault)

Luiz

Reply by email

Paul Ishenin
to Luiz Americo Pereira Camara
Luiz Americo Pereira Camara wrote 5 lines
VirtualTreeView paints the background in black. This occurs because it assigns the TControl.Color to a temp bitmap brush. Not big deal since i can change Color to clWindow (or check for clDefault)

Can you assign Brush.Color to bitmap brush instead of Color?

Best regards,
Paul Ishenin.

Reply by email

Luiz Americo Pereira Camara
to Paul Ishenin
Paul Ishenin wrote 7 lines
20.11.2010 8:49, Luiz Americo Pereira Camara wrote: > VirtualTreeView paints the background in black. This occurs because > it assigns the TControl.Color to a temp bitmap brush. > > Not big deal since i can change Color to clWindow (or check for > clDefault) Can you assign Brush.Color to bitmap brush instead of Color?

Thanks.

This worked

Luiz

Reply by email

Vincent Snijders
to Luiz Americo Pereira Camara

2010/11/20 Luiz Americo Pereira Camara :

Show quoted text 15 lines
Paul Ishenin escreveu: > > 20.11.2010 8:49, Luiz Americo Pereira Camara wrote: >> >> VirtualTreeView paints the background in black. This occurs because it >> assigns the TControl.Color to a temp bitmap brush. >> >> Not big deal since i can change Color to clWindow (or check for >> clDefault) > > Can you assign Brush.Color to bitmap brush instead of Color? Thanks. This worked

Maybe this information can be added to the release notes.

Vincent

Reply by email

Paul Ishenin
to Vincent Snijders
Vincent Snijders wrote
Maybe this information can be added to the release notes.

Yes and probably more.

If we want clDefault to be the default color we need to write a document with clean instructions.

Best regards,
Paul Ishenin.

Reply by email