X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9853e3b7d4e2f949d4ce310f95d5f70e0ce73900..6c34d0ede9d6f7086896a1e4467091f0360846de:/src/msw/xpmhand.cpp diff --git a/src/msw/xpmhand.cpp b/src/msw/xpmhand.cpp index 064e9fc34a..7b0a898a59 100644 --- a/src/msw/xpmhand.cpp +++ b/src/msw/xpmhand.cpp @@ -35,7 +35,16 @@ #if wxUSE_XPM_IN_MSW #define FOR_MSW 1 - #include "../xpm/xpm.h" + + // allow the user to use the system-wide xpm.h by defining + // wxUSE_XPM_H_IN_PATH (and always use xpm.h in path if __WX_SETUP_H__ is + // defined which means that we use configure as it always add -I../xpm to + // the include path if needed) + #if !defined(__WX_SETUP_H__) && !defined(wxUSE_XPM_H_IN_PATH) + #include "../xpm/xpm.h" + #else + #include + #endif #endif #include "wx/xpmhand.h" @@ -55,7 +64,7 @@ static void XpmToBitmap(wxBitmap *bitmap, BITMAP bm; if ( !::GetObject(GetHbitmapOf(*bitmap), sizeof(bm), (LPSTR) & bm) ) { - wxLogLastError("GetObject(bitmap)"); + wxLogLastError(wxT("GetObject(bitmap)")); } refData->m_width = bm.bmWidth; @@ -67,7 +76,8 @@ static void XpmToBitmap(wxBitmap *bitmap, if (xmask) { wxMask *mask = new wxMask(); - mask->SetMaskBitmap((WXHBITMAP) wxInvertMask(xmask->bitmap)); + mask->SetMaskBitmap((WXHBITMAP) wxInvertMask(xmask->bitmap, + bm.bmWidth, bm.bmHeight)); bitmap->SetMask(mask); } }