X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8ed57d9312ecf5ad792f011e2384a86b92001c55..a3ef5bf5045991260005634272633717c0a26174:/src/msw/icon.cpp diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index 587bf7b4c4..ed875403a2 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -32,12 +32,12 @@ #include "wx/msw/private.h" #include "assert.h" -#if USE_XPM_IN_MSW +#if wxUSE_XPM_IN_MSW #define FOR_MSW 1 -#include "..\..\contrib\wxxpm\libxpm.34b\lib\xpm34.h" +#include "../src/xpm/xpm34.h" #endif -#if USE_RESOURCE_LOADING_IN_MSW +#if wxUSE_RESOURCE_LOADING_IN_MSW #include "wx/msw/curico.h" #include "wx/msw/curicop.h" #endif @@ -119,7 +119,7 @@ void wxIcon::SetHICON(WXHICON ico) bool wxICOFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, int desiredWidth, int desiredHeight) { -#if USE_RESOURCE_LOADING_IN_MSW +#if wxUSE_RESOURCE_LOADING_IN_MSW if ( bitmap->IsKindOf(CLASSINFO(wxIcon)) ) { wxIcon *icon = (wxIcon *)bitmap; @@ -142,7 +142,7 @@ bool wxICOResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long { 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); @@ -178,6 +178,13 @@ bool wxICOResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long 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; }