From 954fd05108895d26b0d3f7a298673179a1dcdbaa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 17 Jun 2012 21:35:10 +0000 Subject: [PATCH] Disable creation of wxDIB from wxBitmap in non-wxMSW ports. wxDIB can now be used with wxGTK under Windows, i.e. when not using wxMSW version of wxBitmap but it can't be created from wxBitmap then as it doesn't have a corresponding HBITMAP. Simply disable this functionality when not using wxMSW. Closes #14414. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/dib.h | 4 ++++ src/msw/dib.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/wx/msw/dib.h b/include/wx/msw/dib.h index 58061449f1..9ae349ba19 100644 --- a/include/wx/msw/dib.h +++ b/include/wx/msw/dib.h @@ -37,9 +37,11 @@ public: wxDIB(int width, int height, int depth) { Init(); (void)Create(width, height, depth); } +#ifdef __WXMSW__ // create a DIB from the DDB wxDIB(const wxBitmap& bmp) { Init(); (void)Create(bmp); } +#endif // __WXMSW__ // create a DIB from the Windows DDB wxDIB(HBITMAP hbmp) @@ -53,7 +55,9 @@ public: // same as the corresponding ctors but with return value bool Create(int width, int height, int depth); +#ifdef __WXMSW__ bool Create(const wxBitmap& bmp) { return Create(GetHbitmapOf(bmp)); } +#endif bool Create(HBITMAP hbmp); bool Load(const wxString& filename); diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 00faac6a4e..b12baf0f83 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -575,7 +575,7 @@ HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp) wxPalette *wxDIB::CreatePalette() const { // GetDIBColorTable not available in eVC3 -#if defined(_WIN32_WCE) && _WIN32_WCE < 400 +#if !defined(__WXMSW__) || defined(_WIN32_WCE) && _WIN32_WCE < 400 return NULL; #else wxCHECK_MSG( m_handle, NULL, wxT("wxDIB::CreatePalette(): invalid object") ); -- 2.45.2