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.
This commit is contained in:
Vadim Zeitlin
2015-08-11 20:31:16 +02:00
parent d9e2761ed4
commit 5420f96a9c

View File

@@ -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__)