Sign in Join

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

Mailing lists / lazarus / 2009-01

Colors and Themes

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Hans-Peter Diettrich

When I wanted to add dock headers to the docking manager, I stumbled across several problems with colors.

For Windows e.g. clActiveCaption or clBtnFace can be used for the header and button background, but these color constants are marked deprecated. How should I select the most appropriate colors, for different platforms and themes?

DoDi

Reply by email

Paul Ishenin
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote
For Windows e.g. clActiveCaption or clBtnFace can be used for the header and button background, but these color constants are marked deprecated. How should I select the most appropriate colors, for different platforms and themes?

Where have you found that they are deprecated? Only CLX colors are deprecated and will be removed maybe before lazarus 1.0. Both clActiveCaption and clBtnFace can be used without any warry.

Best regards,
Paul Ishenin.

Reply by email

Hans-Peter Diettrich
to Paul Ishenin
Show quoted text 8 lines
> For Windows e.g. clActiveCaption or clBtnFace can be used for the header > and button background, but these color constants are marked deprecated. > How should I select the most appropriate colors, for different platforms > and themes? Where have you found that they are deprecated? Only CLX colors are deprecated and will be removed maybe before lazarus 1.0. Both clActiveCaption and clBtnFace can be used without any warry.

You're right, it are other cl... colors that are deprecated. The lack of documentation sucks :-(

Are the system colors always mapped to the current standards, including themes?

DoDi

Reply by email

Paul Ishenin
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 5 lines
You're right, it are other cl... colors that are deprecated. The lack of documentation sucks :-( Are the system colors always mapped to the current standards, including themes?

Well, with themes some controls are often painted using bitmaps instead of colors and clBtnFace (for example) is not a correct color to draw a button on themed XP or vista. But if you turn themes off all standard buttons will be painted using clBtnFace.

To draw using themes we have a class TThemeServices though only a small set of controls and their parts is implemented at moment for qt, gtk and carbon. But it is possible to implement more if needed.

Best regards,
Paul Ishenin.

Reply by email

Graeme Geldenhuys
to Paul Ishenin
Paul Ishenin wrote
button on themed XP or vista. But if you turn themes off all standard buttons will be painted using clBtnFace.

Does clBtnFace update to the correct colour if you apply a new windows colour scheme (without quitting the application)?

eg:
* using default colour scheme in windows (usual grey colours).
* start my app and button is painted in grey (clBtnFace).
* I change the colour scheme to pink/purple (I wouldn't really do that. <wink.)
* All windows apps adjust their colours as well. Does LCL apps do the same?

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Paul Ishenin
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
Does clBtnFace update to the correct colour if you apply a new windows colour scheme (without quitting the application)? eg: * using default colour scheme in windows (usual grey colours). * start my app and button is painted in grey (clBtnFace). * I change the colour scheme to pink/purple (I wouldn't really do that. <wink.) * All windows apps adjust their colours as well. Does LCL apps do the same?

If you are about lcl-win32 then yes. When LCL process clBtnFace it calls winapi function GetSysColor. Ofcource there can be problems with already created brushes, pens and fonts which was created before theme change.

Best regards,
Paul Ishenin.

Reply by email

Graeme Geldenhuys
to Paul Ishenin
Paul Ishenin wrote
If you are about lcl-win32 then yes. When LCL process clBtnFace it calls winapi function GetSysColor. Ofcource there can be problems with already created brushes, pens and fonts which was created before theme change.

OK, thanks Paul.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email