From 5420f96a9c30300ce7bcd5ced8d003502e96c5e2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Aug 2015 20:31:16 +0200 Subject: [PATCH] Fix compilation of wxNativeWindow sample for old compilers. Define BS_SPLITBUTTON ourselves if it's not defined in the headers to at least create the control even then. Skip the code handling BCN_DROPDOWN as it's too much trouble to make it compile with the old headers however. This should fix the build with VC8 currently failing on buildbot. --- samples/widgets/native.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/widgets/native.cpp b/samples/widgets/native.cpp index f4c257fa46..6f23ceea16 100644 --- a/samples/widgets/native.cpp +++ b/samples/widgets/native.cpp @@ -63,6 +63,10 @@ void BuildTestMenu(wxMenu *menu) #include "wx/msw/wrapcctl.h" // for BS_SPLITBUTTON +#ifndef BS_SPLITBUTTON + #define BS_SPLITBUTTON 0x000c +#endif // BS_SPLITBUTTON + class NativeWindow : public wxNativeWindow { public: @@ -92,6 +96,9 @@ public: } protected: + // This code requires NMBCDROPDOWN to work, we don't really want to + // reproduce its definition here for very old compilers not having it. +#ifdef BCN_DROPDOWN // Split buttons under MSW don't show the menu on their own, unlike their // equivalents under the other platforms, so do it manually here. This also // shows how to handle a native event in MSW (for the specific case of @@ -111,6 +118,7 @@ protected: return true; } +#endif // defined(BCN_DROPDOWN) }; #elif defined(__WXGTK__)