X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de359565aea29f94464d6c93eee8ed9fdfa5de4a..730d336601a3ece761b56e7c05d1099352670a25:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 8e25f3895b..dcf8118edc 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -184,6 +184,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent) // local functions // ---------------------------------------------------------------------------- +#ifndef __WXWINCE__ // apparently DrawThemeBackground() modifies the rect passed to it and if we // don't call this function there are some drawing artifacts which are only // visible with some non default themes; so modify the rect here so that it @@ -196,6 +197,7 @@ static void AdjustRectForThemeBg(RECT& rc) rc.right += 4; rc.bottom += 5; } +#endif // ============================================================================ // implementation @@ -256,6 +258,13 @@ bool wxNotebook::Create(wxWindow *parent, long style, const wxString& name) { +#ifdef __WXWINCE__ + // Not sure why, but without this style, there is no border + // around the notebook tabs. + if (style & wxNB_FLAT) + style |= wxBORDER_SUNKEN; +#endif + // comctl32.dll 6.0 doesn't support non-top tabs with visual styles (the // control is simply not rendered correctly), so disable them in this case const int verComCtl32 = wxApp::GetComCtl32Version(); @@ -313,15 +322,13 @@ bool wxNotebook::Create(wxWindow *parent, if ( !MSWCreateControl(className, wxEmptyString, pos, size) ) return false; - if (HasFlag(wxNB_NOPAGETHEME) || (wxSystemOptions::HasOption(wxT("msw.notebook.themed-background")) && - wxSystemOptions::GetOptionInt(wxT("msw.notebook.themed-background")) == 0)) +#if wxUSE_UXTHEME + if ( HasFlag(wxNB_NOPAGETHEME) || + wxSystemOptions::IsFalse(wxT("msw.notebook.themed-background")) ) { - wxColour col = GetThemeBackgroundColour(); - if (col.Ok()) - { - SetBackgroundColour(col); - } + SetBackgroundColour(GetThemeBackgroundColour()); } +#endif // wxUSE_UXTHEME // Undocumented hack to get flat notebook style // In fact, we should probably only do this in some @@ -756,12 +763,12 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const void wxNotebook::OnSize(wxSizeEvent& event) { - // update the background brush #if wxUSE_UXTHEME + // background bitmap size has changed, update the brush using it too UpdateBgBrush(); #endif // wxUSE_UXTHEME - if (GetPageCount() == 0) + if ( GetPageCount() == 0 ) { // Prevents droppings on resize, but does cause some flicker // when there are no pages. @@ -1060,12 +1067,8 @@ wxNotebook::MSWPrintChild(wxWindow *win, WXLPARAM WXUNUSED(lParam)) { // Don't paint the theme for the child if we have a solid background - if ( m_hasBgCol || - wxSystemOptions::IsFalse(wxT("msw.notebook.themed-background")) || - HasFlag(wxNB_NOPAGETHEME) ) - { + if ( m_hasBgCol ) return false; - } RECT rc; @@ -1135,8 +1138,7 @@ wxColour wxNotebook::GetThemeBackgroundColour() const &themeColor); } - wxColour colour(GetRValue(themeColor), GetGValue(themeColor), GetBValue(themeColor)); - return colour; + return wxRGBToColour(themeColor); } } #endif // wxUSE_UXTHEME