X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c99602b795292c52aafd12c71cac668ffdbf08f..659af826726fea66d2476d3a0ead2fb00e34ad23:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 925dee0c9a..8eb710fbe4 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -1045,7 +1045,7 @@ bool wxNotebook::DoDrawBackground(WXHDC hDC, wxWindow *child) wxUxThemeEngine::Get()->DrawThemeBackground ( theme, - hDC, + (HDC) hDC, 9 /* TABP_PANE */, 0, &rc, @@ -1116,6 +1116,29 @@ bool wxNotebook::MSWPrintChild(WXHDC hDC, wxWindow *child) if ( !UseBgCol() && DoDrawBackground(hDC, child) ) return true; + // If we're using a solid colour (for example if we've switched off + // theming for this notebook), paint it + if (UseBgCol()) + { + wxRect r = GetPageSize(); + if ( r.IsEmpty() ) + return false; + + RECT rc; + wxCopyRectToRECT(r, rc); + + // map rect to the coords of the window we're drawing in + if ( child ) + ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2); + + wxBrush brush(GetBackgroundColour()); + HBRUSH hbr = GetHbrushOf(brush); + + ::FillRect((HDC) hDC, &rc, hbr); + + return true; + } + return wxNotebookBase::MSWPrintChild(hDC, child); }