From 5368c72d37b2e71f9c0d7ff542a3ad63d5dd1b82 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 7 Apr 2016 22:01:58 +0200 Subject: [PATCH] Fix wxMSW build with wxUSE_DEFERRED_SIZING==0 Don't define BeginRepositioningChildren() and EndRepositioningChildren() at all in this case instead of defining them as "do nothing" functions because BeginRepositioningChildren() still needs to return a bool, so the old code didn't compile and we would need to add another "#else" to fix this -- instead make it simpler by just not compiling at all in this case. --- include/wx/msw/window.h | 2 ++ src/msw/window.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 9647e080b2..067cad4056 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -61,8 +61,10 @@ public: virtual void Raise(); virtual void Lower(); +#if wxUSE_DEFERRED_SIZING virtual bool BeginRepositioningChildren(); virtual void EndRepositioningChildren(); +#endif // wxUSE_DEFERRED_SIZING virtual bool Show(bool show = true); virtual bool ShowWithEffect(wxShowEffect effect, diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 01c9d59584..3cc19e0965 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -5034,9 +5034,10 @@ bool wxWindowMSW::HandleExitSizeMove() return HandleWindowEvent(event); } +#if wxUSE_DEFERRED_SIZING + bool wxWindowMSW::BeginRepositioningChildren() { -#if wxUSE_DEFERRED_SIZING int numChildren = 0; for ( HWND child = ::GetWindow(GetHwndOf(this), GW_CHILD); child; @@ -5062,12 +5063,10 @@ bool wxWindowMSW::BeginRepositioningChildren() // Return true to indicate that EndDeferWindowPos() should be called. return true; -#endif // wxUSE_DEFERRED_SIZING } void wxWindowMSW::EndRepositioningChildren() { -#if wxUSE_DEFERRED_SIZING wxASSERT_MSG( m_hDWP, wxS("Shouldn't be called") ); // reset m_hDWP to NULL so that child windows don't try to use our @@ -5091,9 +5090,10 @@ void wxWindowMSW::EndRepositioningChildren() wxWindowMSW * const child = node->GetData(); child->MSWEndDeferWindowPos(); } -#endif // wxUSE_DEFERRED_SIZING } +#endif // wxUSE_DEFERRED_SIZING + bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) { // when we resize this window, its children are probably going to be