X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/25057abaacf5ccf30bf136ec2ac430eb61664c3b..5e0526df034ebceefc8e6ab813e32e38a9ac90ff:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 3f2390950c..e738530676 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -296,6 +296,15 @@ 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)) + { + wxColour col = GetThemeBackgroundColour(); + if (col.Ok()) + { + SetBackgroundColour(col); + } + } return true; } @@ -471,7 +480,7 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const wxSize sizeTotal = sizePage; // We need to make getting tab size part of the wxWidgets API. - wxSize tabSize(0, 0); + wxSize tabSize; if (GetPageCount() > 0) { RECT rect; @@ -618,7 +627,7 @@ bool wxNotebook::InsertPage(size_t nPage, } // and the text - if ( !strText.IsEmpty() ) + if ( !strText.empty() ) { tcItem.mask |= TCIF_TEXT; tcItem.pszText = (wxChar *)strText.c_str(); // const_cast @@ -683,16 +692,6 @@ bool wxNotebook::InsertPage(size_t nPage, InvalidateBestSize(); - if (HasFlag(wxNB_NOPAGETHEME) || (wxSystemOptions::HasOption(wxT("msw.notebook.themed-background")) && - wxSystemOptions::GetOptionInt(wxT("msw.notebook.themed-background")) == 0)) - { - wxColour col = GetThemeBackgroundColour(); - if (col.Ok()) - { - pPage->SetBackgroundColour(col); - } - } - return true; } @@ -1003,6 +1002,33 @@ wxColour wxNotebook::MSWGetBgColourForChild(wxWindow *win) return c == CLR_INVALID ? wxNullColour : wxRGBToColour(c); } +bool +wxNotebook::MSWPrintChild(wxWindow *win, + WXWPARAM wParam, + WXLPARAM WXUNUSED(lParam)) +{ + RECT rc; + ::GetClientRect(GetHwnd(), &rc); + TabCtrl_AdjustRect(GetHwnd(), true, &rc); + ::MapWindowPoints(GetHwnd(), GetHwndOf(win), (POINT *)&rc, 2); + + wxUxThemeHandle theme(win, L"TAB"); + if ( theme ) + { + wxUxThemeEngine::Get()->DrawThemeBackground + ( + theme, + (WXHDC)wParam, + 9 /* TABP_PANE */, + 0, + &rc, + NULL + ); + } + + return true; +} + #endif // wxUSE_UXTHEME // Windows only: attempts to get colour for UX theme page background