From: Vadim Zeitlin Date: Mon, 15 Nov 2004 14:43:51 +0000 (+0000) Subject: don't always erase the background ourselves as this is incompatible with XP themed... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e2c49e5cd2b7092e946fd97d76f3cca07916c91c don't always erase the background ourselves as this is incompatible with XP themed appearance (replaces patch 1046164) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index d582c1b941..56d65c055b 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -165,7 +165,6 @@ public: // event handlers // -------------- - void OnEraseBackground(wxEraseEvent& event); void OnPaint(wxPaintEvent& event); #ifdef __WXWINCE__ void OnInitDialog( wxInitDialogEvent& event ); diff --git a/src/msw/window.cpp b/src/msw/window.cpp index f5a6693112..8c7b93ca62 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -332,7 +332,6 @@ wxCONSTRUCTOR_DUMMY(wxWindow) #endif // __WXUNIVERSAL__/__WXMSW__ BEGIN_EVENT_TABLE(wxWindowMSW, wxWindowBase) - EVT_ERASE_BACKGROUND(wxWindowMSW::OnEraseBackground) EVT_SYS_COLOUR_CHANGED(wxWindowMSW::OnSysColourChanged) #ifdef __WXWINCE__ EVT_INIT_DIALOG(wxWindowMSW::OnInitDialog) @@ -4050,29 +4049,6 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc) if ( ::IsIconic(GetHwnd()) ) return true; -#if 0 - if (GetParent() && GetParent()->GetExtraStyle() & wxWS_EX_THEMED_BACKGROUND) - { - return false; - } - - if (GetExtraStyle() & wxWS_EX_THEMED_BACKGROUND) - { - if (wxUxThemeEngine::Get()) - { - WXHTHEME hTheme = wxUxThemeEngine::Get()->m_pfnOpenThemeData(GetHWND(), L"TAB"); - if (hTheme) - { - WXURECT rect; - ::GetClientRect((HWND) GetHWND(), (RECT*) & rect); - wxUxThemeEngine::Get()->m_pfnDrawThemeBackground(hTheme, hdc, 10 /* TABP_BODY */, 0, &rect, &rect); - wxUxThemeEngine::Get()->m_pfnCloseThemeData(hTheme); - return true; - } - } - } -#endif - wxDCTemp dc(hdc); dc.SetHDC(hdc); @@ -4091,33 +4067,6 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc) return rc; } -void wxWindowMSW::OnEraseBackground(wxEraseEvent& event) -{ - RECT rect; - ::GetClientRect(GetHwnd(), &rect); - - wxColour backgroundColour( GetBackgroundColour()); - COLORREF ref = PALETTERGB(backgroundColour.Red(), - backgroundColour.Green(), - backgroundColour.Blue()); - HBRUSH hBrush = ::CreateSolidBrush(ref); - if ( !hBrush ) - wxLogLastError(wxT("CreateSolidBrush")); - - HDC hdc = (HDC)event.GetDC()->GetHDC(); - -#ifndef __WXWINCE__ - int mode = ::SetMapMode(hdc, MM_TEXT); -#endif - - ::FillRect(hdc, &rect, hBrush); - ::DeleteObject(hBrush); - -#ifndef __WXWINCE__ - ::SetMapMode(hdc, mode); -#endif -} - // --------------------------------------------------------------------------- // moving and resizing // ---------------------------------------------------------------------------