From 9b7d2b81ccaab2709c66d0214d3027d95b24f3ac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 19 Nov 2004 20:50:25 +0000 Subject: [PATCH] added another DoEraseBackground overload (no real changes) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/notebook.h | 3 +++ src/msw/notebook.cpp | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/notebook.h b/include/wx/msw/notebook.h index f732ce9da5..c085883714 100644 --- a/include/wx/msw/notebook.h +++ b/include/wx/msw/notebook.h @@ -165,6 +165,9 @@ public: // handler for child pages erase background event void DoEraseBackground(wxEraseEvent& event); + // real implementation of the above method + void DoEraseBackground(wxWindow *win, WXHDC hDC); + // get the brush to be used for painting the background for the controls // which need it in their MSWControlColor() // diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 3741960c93..ca44a56618 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -909,19 +909,23 @@ WXHBRUSH wxNotebook::GetThemeBackgroundBrush(WXHDC hDC, wxWindow *win) const } void wxNotebook::DoEraseBackground(wxEraseEvent& event) +{ + DoEraseBackground((wxWindow *)event.GetEventObject(), + (WXHDC)GetHdcOf(*event.GetDC())); +} + +void wxNotebook::DoEraseBackground(wxWindow *win, WXHDC hDC) { // we can either draw the background ourselves or let DrawThemeBackground() // do it, but as we already have the correct brush, let's do it ourselves // (note that we use the same code in wxControl::MSWControlColor(), so if // it breaks, it should at least break in consistent way) - wxWindow *win = (wxWindow *)event.GetEventObject(); - HDC hdc = GetHdcOf(*event.GetDC()); - WXHBRUSH hbr = GetThemeBackgroundBrush((WXHDC)hdc, win); + WXHBRUSH hbr = GetThemeBackgroundBrush(hDC, win); if ( hbr ) { RECT rectClient; ::GetClientRect(GetHwndOf(win), &rectClient); - ::FillRect(hdc, &rectClient, (HBRUSH)hbr); + ::FillRect((HDC)hDC, &rectClient, (HBRUSH)hbr); } }