]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/xpmhand.cpp
New frame class
[wxWidgets.git] / src / msw / xpmhand.cpp
index 1974d381f24c7e6d9cb22bf9c01ffbe5d50d978d..7b0a898a5954e1f7ffbfdd07e603fd77f8b77a8a 100644 (file)
 
 #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 <xpm.h>
+    #endif
 #endif
 
 #include "wx/xpmhand.h"
@@ -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);
     }
 }