]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/icon.cpp
Added $(NEW_WXLIBNAME) to allow changing the library or DLL name
[wxWidgets.git] / src / msw / icon.cpp
index bd69394f9a21e85d5b88ecbce64dce13e4d0fa56..36ce69004300a8e49226c925dfabf21249095253 100644 (file)
 #include "wx/msw/private.h"
 #include "assert.h"
 
 #include "wx/msw/private.h"
 #include "assert.h"
 
-#if wxUSE_XPM_IN_MSW
-#define FOR_MSW 1
-#include "../src/xpm/xpm34.h"
-#endif
-
 #if wxUSE_RESOURCE_LOADING_IN_MSW
 #include "wx/msw/curico.h"
 #include "wx/msw/curicop.h"
 #if wxUSE_RESOURCE_LOADING_IN_MSW
 #include "wx/msw/curico.h"
 #include "wx/msw/curicop.h"
@@ -142,7 +137,7 @@ bool wxICOResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long
 {
   if ( bitmap->IsKindOf(CLASSINFO(wxIcon)) )
   {
 {
   if ( bitmap->IsKindOf(CLASSINFO(wxIcon)) )
   {
-#if defined(__WIN32__)
+#if defined(__WIN32__) && !defined(__SC__)
     if (desiredWidth > -1 && desiredHeight > -1)
     {
         M_ICONHANDLERDATA->m_hIcon = (WXHICON) ::LoadImage(wxGetInstance(), name, IMAGE_ICON, desiredWidth, desiredHeight, LR_DEFAULTCOLOR);
     if (desiredWidth > -1 && desiredHeight > -1)
     {
         M_ICONHANDLERDATA->m_hIcon = (WXHICON) ::LoadImage(wxGetInstance(), name, IMAGE_ICON, desiredWidth, desiredHeight, LR_DEFAULTCOLOR);
@@ -178,6 +173,13 @@ bool wxICOResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long
       M_ICONHANDLERDATA->m_width = 32;
       M_ICONHANDLERDATA->m_height = 32;
 #endif
       M_ICONHANDLERDATA->m_width = 32;
       M_ICONHANDLERDATA->m_height = 32;
 #endif
+      // Override the found values with desired values
+      if (desiredWidth > -1 && desiredHeight > -1)
+      {
+          M_ICONHANDLERDATA->m_width = desiredWidth;
+          M_ICONHANDLERDATA->m_height = desiredHeight;
+      }
+
       M_ICONHANDLERDATA->m_ok = (M_ICONHANDLERDATA->m_hIcon != 0);
       return M_ICONHANDLERDATA->m_ok;
   }
       M_ICONHANDLERDATA->m_ok = (M_ICONHANDLERDATA->m_hIcon != 0);
       return M_ICONHANDLERDATA->m_ok;
   }