From 38c58c778d8f8b0abf889e787e0364d42c1c445f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 18 Nov 2004 23:20:10 +0000 Subject: [PATCH] don't erase background in wxControl neither git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/control.h | 3 --- src/msw/control.cpp | 29 ----------------------------- 2 files changed, 32 deletions(-) diff --git a/include/wx/msw/control.h b/include/wx/msw/control.h index 6f36753b4d..5862700b8b 100644 --- a/include/wx/msw/control.h +++ b/include/wx/msw/control.h @@ -70,8 +70,6 @@ public: const wxArrayLong& GetSubcontrols() const { return m_subControls; } - void OnEraseBackground(wxEraseEvent& event); - virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); @@ -134,7 +132,6 @@ protected: private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxControl) - DECLARE_EVENT_TABLE() }; #endif // _WX_CONTROL_H_ diff --git a/src/msw/control.cpp b/src/msw/control.cpp index ef6dfe5b98..d268cc6a5d 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -52,10 +52,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) -BEGIN_EVENT_TABLE(wxControl, wxWindow) - EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground) -END_EVENT_TABLE() - // ============================================================================ // wxControl implementation // ============================================================================ @@ -326,31 +322,6 @@ bool wxControl::MSWOnNotify(int idCtrl, } #endif // Win95 -void wxControl::OnEraseBackground(wxEraseEvent& event) -{ - // notice that this 'dumb' implementation may cause flicker for some of the - // controls in which case they should intercept wxEraseEvent and process it - // themselves somehow - - RECT rect; - ::GetClientRect(GetHwnd(), &rect); - - HBRUSH hBrush = ::CreateSolidBrush(wxColourToRGB(GetBackgroundColour())); - - HDC hdc = GetHdcOf((*event.GetDC())); - -#ifndef __WXWINCE__ - int mode = ::SetMapMode(hdc, MM_TEXT); -#endif - - ::FillRect(hdc, &rect, hBrush); - ::DeleteObject(hBrush); - -#ifndef __WXWINCE__ - ::SetMapMode(hdc, mode); -#endif -} - WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), #if wxUSE_CTL3D WXUINT message, -- 2.45.2