simplifications of checks for themed-background sysopt and compilation fixes for wxUSE_UXTHEME == 0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-03-23 21:11:09 +00:00
parent de359565ae
commit 7dccdf8120

View File

@@ -313,15 +313,13 @@ bool wxNotebook::Create(wxWindow *parent,
if ( !MSWCreateControl(className, wxEmptyString, pos, size) ) if ( !MSWCreateControl(className, wxEmptyString, pos, size) )
return false; return false;
if (HasFlag(wxNB_NOPAGETHEME) || (wxSystemOptions::HasOption(wxT("msw.notebook.themed-background")) && #if wxUSE_UXTHEME
wxSystemOptions::GetOptionInt(wxT("msw.notebook.themed-background")) == 0)) if ( HasFlag(wxNB_NOPAGETHEME) ||
wxSystemOptions::IsFalse(wxT("msw.notebook.themed-background")) )
{ {
wxColour col = GetThemeBackgroundColour(); SetBackgroundColour(GetThemeBackgroundColour());
if (col.Ok())
{
SetBackgroundColour(col);
}
} }
#endif // wxUSE_UXTHEME
// Undocumented hack to get flat notebook style // Undocumented hack to get flat notebook style
// In fact, we should probably only do this in some // In fact, we should probably only do this in some
@@ -756,8 +754,8 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
void wxNotebook::OnSize(wxSizeEvent& event) void wxNotebook::OnSize(wxSizeEvent& event)
{ {
// update the background brush
#if wxUSE_UXTHEME #if wxUSE_UXTHEME
// background bitmap size has changed, update the brush using it too
UpdateBgBrush(); UpdateBgBrush();
#endif // wxUSE_UXTHEME #endif // wxUSE_UXTHEME
@@ -1060,12 +1058,8 @@ wxNotebook::MSWPrintChild(wxWindow *win,
WXLPARAM WXUNUSED(lParam)) WXLPARAM WXUNUSED(lParam))
{ {
// Don't paint the theme for the child if we have a solid background // Don't paint the theme for the child if we have a solid background
if ( m_hasBgCol || if ( m_hasBgCol )
wxSystemOptions::IsFalse(wxT("msw.notebook.themed-background")) ||
HasFlag(wxNB_NOPAGETHEME) )
{
return false; return false;
}
RECT rc; RECT rc;
@@ -1135,8 +1129,7 @@ wxColour wxNotebook::GetThemeBackgroundColour() const
&themeColor); &themeColor);
} }
wxColour colour(GetRValue(themeColor), GetGValue(themeColor), GetBValue(themeColor)); return wxRGBToColour(themeColor);
return colour;
} }
} }
#endif // wxUSE_UXTHEME #endif // wxUSE_UXTHEME