From 2163b00b935a10804da08e8bd0f85d327f162343 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 13 Jan 2018 22:44:44 +0100 Subject: [PATCH] Move wxHAS_NATIVE_ENABLED_MANAGEMENT definition to the source file There doesn't seem to be any need to have this symbol in the header, when it's only used in NotifyWindowOnEnableChange() in wincmn.cpp. No real changes. --- include/wx/window.h | 16 ---------------- src/common/wincmn.cpp | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/wx/window.h b/include/wx/window.h index 38d70ab7a8..8046223a4a 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -48,22 +48,6 @@ #define wxUSE_MENUS_NATIVE wxUSE_MENUS #endif // __WXUNIVERSAL__/!__WXUNIVERSAL__ - -// Define this macro if the corresponding operating system handles the state -// of children windows automatically when the parent is enabled/disabled. -// Otherwise wx itself must ensure that when the parent is disabled its -// children are disabled too, and their initial state is restored when the -// parent is enabled back. -#if defined(__WXMSW__) - // must do everything ourselves - #undef wxHAS_NATIVE_ENABLED_MANAGEMENT -#elif defined(__WXOSX__) - // must do everything ourselves - #undef wxHAS_NATIVE_ENABLED_MANAGEMENT -#else - #define wxHAS_NATIVE_ENABLED_MANAGEMENT -#endif - // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index f07acd465d..d398f1f7b0 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1166,6 +1166,21 @@ bool wxWindowBase::IsEnabled() const return IsThisEnabled() && (IsTopLevel() || !GetParent() || GetParent()->IsEnabled()); } +// Define this macro if the corresponding operating system handles the state +// of children windows automatically when the parent is enabled/disabled. +// Otherwise wx itself must ensure that when the parent is disabled its +// children are disabled too, and their initial state is restored when the +// parent is enabled back. +#if defined(__WXMSW__) + // must do everything ourselves + #undef wxHAS_NATIVE_ENABLED_MANAGEMENT +#elif defined(__WXOSX__) + // must do everything ourselves + #undef wxHAS_NATIVE_ENABLED_MANAGEMENT +#else + #define wxHAS_NATIVE_ENABLED_MANAGEMENT +#endif + void wxWindowBase::NotifyWindowOnEnableChange(bool enabled) { // Under some platforms there is no need to update the window state