X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..a45d2855c6882edc830777de2cec9ac21caced61:/src/msw/imaglist.cpp diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index 39c071e1fd..5b5e3541af 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -24,8 +24,6 @@ #pragma hdrstop #endif -#if defined(__WIN95__) - #ifndef WX_PRECOMP #include "wx/window.h" #include "wx/icon.h" @@ -43,9 +41,8 @@ #include "wx/msw/imaglist.h" #include "wx/msw/private.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) - #include -#endif +// include "properly" +#include "wx/msw/wrapcctl.h" // ---------------------------------------------------------------------------- // wxWin macros @@ -210,7 +207,7 @@ bool wxImageList::Replace(int index, // Replaces a bitmap and mask from an icon. bool wxImageList::Replace(int i, const wxIcon& icon) { - bool ok = ImageList_ReplaceIcon(GetHImageList(), i, GetHiconOf(icon)) != 0; + bool ok = ImageList_ReplaceIcon(GetHImageList(), i, GetHiconOf(icon)) != -1; if ( !ok ) { wxLogLastError(wxT("ImageList_ReplaceIcon()")); @@ -293,6 +290,7 @@ bool wxImageList::Draw(int index, // Get the bitmap wxBitmap wxImageList::GetBitmap(int index) const { +#if wxUSE_WXDIB int bmp_width = 0, bmp_height = 0; GetSize(index, bmp_width, bmp_height); @@ -323,7 +321,9 @@ wxBitmap wxImageList::GetBitmap(int index) const image = bitmap.ConvertToImage(); image.SetMaskColour(r, g, b); bitmap = wxBitmap(image); - +#else + wxBitmap bitmap; +#endif return bitmap; } @@ -335,14 +335,14 @@ wxIcon wxImageList::GetIcon(int index) const { wxIcon icon; icon.SetHICON((WXHICON)hIcon); - + int iconW, iconH; GetSize(index, iconW, iconH); icon.SetSize(iconW, iconH); - + return icon; } - else + else return wxNullIcon; } @@ -391,6 +391,3 @@ static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask) return hbmpMaskInv; } - -#endif // Win95 -