What is the RIGHT approach to a Themed Background ? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
davebee
Earned some good credits
Earned some good credits
Posts: 106
Joined: Fri Oct 06, 2006 1:39 am

What is the RIGHT approach to a Themed Background ?

Post by davebee »

I know about the wxWindow::SetBackgroundColour() method which is available to all derived classes and thus allows changing the background color of each widget.

It seems to me however that there must be a less tedious way of setting a themed background to all wizard pages, message boxes, etc. (similar to the way CSS works in HTML).

A pointer/link to an article that provides an introduction to the "right method" (or a hint/tip) would be highly appreciated.

Thanks.
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2

(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

Hi,

I believe you should be able to only set the background color of the base panel, and then all widgets added in it should, by their transparent borders, not override that background color. Is it not the case? (on wxMac I believe it is; maybe Windows does not behave the same though)
"Keyboard not detected. Press F1 to continue"
-- Windows
davebee
Earned some good credits
Earned some good credits
Posts: 106
Joined: Fri Oct 06, 2006 1:39 am

Post by davebee »

Auria wrote:Hi,
I believe you should be able to only set the background color of the base panel, and then all widgets added in it should, by their transparent borders, not override that background color. Is it not the case? (on wxMac I believe it is; maybe Windows does not behave the same though)
I am not sure I understand your answer. What is "the base panel"?

Thanks.
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2

(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

I mean, add a wxPanel inside your frame, then add all other widgets inside this panel
"Keyboard not detected. Press F1 to continue"
-- Windows
davebee
Earned some good credits
Earned some good credits
Posts: 106
Joined: Fri Oct 06, 2006 1:39 am

Post by davebee »

Auria wrote:I mean, add a wxPanel inside your frame, then add all other widgets inside this panel
But in there is no place for wxPanel in wxWizard... perhaps we are talking about two different things?
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2

(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

Quoting the docs :
wxWizardPage is just a panel
so in this case it would be the wxWizardPage. Or was your question about changing the color of the wxWizard, including parts that are not "yours"?
"Keyboard not detected. Press F1 to continue"
-- Windows
davebee
Earned some good credits
Earned some good credits
Posts: 106
Joined: Fri Oct 06, 2006 1:39 am

Post by davebee »

Auria wrote:so in this case it would be the wxWizardPage.
Oops. You are correct. wxWizardPage is derived from wxPanel.
Auria wrote: Or was your question about changing the color of the wxWizard, including parts that are not "yours"?
Embarrassingly, that's exactly the question I was trying to ask (not very successfully):

wxWizard is also derived from wxPanel. What happens if I change the background color of wxWizard? Will all wxWizardPage pages inherit that new color?

I am basically trying to learn whether there is a method that would give the same theme to all pages with minimal amount of code & cod maintenance.

Perhaps something similar to XP manifest files?

Thanks.
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2

(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
davebee
Earned some good credits
Earned some good credits
Posts: 106
Joined: Fri Oct 06, 2006 1:39 am

Post by davebee »

OK. After experimenting a little more, I realized that wxWizard (and its pages) inherit by default the color of the "Message Box" as defined in the Appearance tab of "Display Properties" in Windows XP (SP2).

That's the ugliest color of all. :)

Yes, it can be changed by selecting one of the available "Color Schemes" but if you want to keep the color scheme and change only the color of the "Message Box", you can't. :(

Using the Advanced Appearance button you can change the color of any component in Windows -- except for the Message Box. Interesting.
wxMSW-2.6.3 / Visual C++ 2005 EE / Windows XP SP2

(was: wxMSW-2.6.3 / Visual C++ 6.0 SP6 / Windows 2000 SP5)
Post Reply