From 4bd6ae0fad71f7653fb3c78063bfe8e18a46d308 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Feb 2005 19:24:46 +0000 Subject: [PATCH] extracted check for wxListCtrl in WM_PRINT handler to wxListCtrl itself, base class shouldn't have to worry about its derived classes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/listctrl.h | 5 +++++ src/msw/listctrl.cpp | 15 +++++++++++++++ src/msw/window.cpp | 10 ++-------- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index 8f6278e592..711e1f93c6 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -375,6 +375,11 @@ protected: // convert our styles to Windows virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + // special Windows message handling + virtual WXLRESULT MSWWindowProc(WXUINT nMsg, + WXWPARAM wParam, + WXLPARAM lParam); + wxTextCtrl* m_textCtrl; // The control used for editing a label wxImageList * m_imageListNormal; // The image list for normal icons diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 49c6d04c04..b3894f1461 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2385,6 +2385,21 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) } } +WXLRESULT +wxListCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) +{ +#ifdef WM_PRINT + if ( nMsg == WM_PRINT ) + { + // we should bypass our own WM_PRINT handling as we don't handle + // PRF_CHILDREN flag, so leave it to the native control itself + return MSWDefWindowProc(nMsg, wParam, lParam); + } +#endif // WM_PRINT + + return wxControl::MSWWindowProc(nMsg, wParam, lParam); +} + // ---------------------------------------------------------------------------- // virtual list controls // ---------------------------------------------------------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index e3beb318c5..105459f34c 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2311,15 +2311,9 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l break; } -#ifndef __WXWINCE__ +#ifdef WM_PRINT case WM_PRINT: { -#if wxUSE_LISTCTRL - // Don't call the wx handlers in this case - if ( wxIsKindOf(this, wxListCtrl) ) - break; -#endif - if ( lParam & PRF_ERASEBKGND ) HandleEraseBkgnd((WXHDC)(HDC)wParam); @@ -2327,7 +2321,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l processed = HandlePaint(); } break; -#endif +#endif // WM_PRINT case WM_CLOSE: #ifdef __WXUNIVERSAL__ -- 2.45.2