From 392e119bbedb1b840d0de2aef7b8b4b636f7d164 Mon Sep 17 00:00:00 2001 From: catalinr Date: Fri, 6 Dec 2019 22:21:42 +0200 Subject: [PATCH] Fix dragimag sample compilation with modern compiler under MSW Don't "override" UpdateBackingFromWindow() method of the base class unless it really exists, which is only the case for the generic wxDragImage implementation but not the native MSW one. See https://github.com/wxWidgets/wxWidgets/pull/1671 --- samples/dragimag/dragimag.cpp | 3 ++- samples/dragimag/dragimag.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/dragimag/dragimag.cpp b/samples/dragimag/dragimag.cpp index 14d0227f79..da6d30451d 100644 --- a/samples/dragimag/dragimag.cpp +++ b/samples/dragimag/dragimag.cpp @@ -488,6 +488,7 @@ bool DragShape::Draw(wxDC& dc, bool highlight) return false; } +#if wxUSE_GENERIC_DRAGIMAGE // MyDragImage // On some platforms, notably Mac OS X with Core Graphics, we can't blit from @@ -503,4 +504,4 @@ bool MyDragImage::UpdateBackingFromWindow(wxDC& WXUNUSED(windowDC), wxMemoryDC& m_canvas->DrawShapes(destDC); return true; } - +#endif diff --git a/samples/dragimag/dragimag.h b/samples/dragimag/dragimag.h index ca4034a996..c3ec6aef6b 100644 --- a/samples/dragimag/dragimag.h +++ b/samples/dragimag/dragimag.h @@ -177,10 +177,12 @@ public: { } +#if wxUSE_GENERIC_DRAGIMAGE // On some platforms, notably Mac OS X with Core Graphics, we can't blit from // a window, so we need to draw the background explicitly. virtual bool UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC, const wxRect& sourceRect, const wxRect& destRect) const wxOVERRIDE; +#endif protected: MyCanvas* m_canvas;