X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..8af56e082726e68f3056722bbc2d9837393afa5d:/src/msw/gdiimage.cpp diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 2e6ae1b7f5..f2e84134d0 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -49,6 +49,8 @@ #include #endif +#include "wx/file.h" + #include "wx/listimpl.cpp" WX_DEFINE_LIST(wxGDIImageHandlerList); @@ -149,6 +151,7 @@ public: { } +protected: virtual bool LoadIcon(wxIcon *icon, const wxString& name, long flags, int desiredWidth = -1, int desiredHeight = -1); @@ -166,6 +169,7 @@ public: { } +protected: virtual bool LoadIcon(wxIcon *icon, const wxString& name, long flags, int desiredWidth = -1, int desiredHeight = -1); @@ -263,7 +267,7 @@ wxGDIImageHandler *wxGDIImage::FindHandler(const wxString& extension, while ( node ) { wxGDIImageHandler *handler = node->GetData(); - if ( (handler->GetExtension() = extension) && + if ( (handler->GetExtension() == extension) && (type == -1 || handler->GetType() == type) ) { return handler; @@ -345,6 +349,9 @@ bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, bitmap->SetHeight(bm.bmHeight); bitmap->SetDepth(bm.bmBitsPixel); + // use 0xc0c0c0 as transparent colour by default + bitmap->SetMask(new wxMask(*bitmap, *wxLIGHT_GREY)); + return true; } @@ -360,7 +367,7 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, return dib.IsOk() && bitmap->CopyFromDIB(dib); #else - return FALSE; + return false; #endif } @@ -376,7 +383,7 @@ bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, return dib.Save(name); #else - return FALSE; + return false; #endif } @@ -565,7 +572,10 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, wxSize wxGetHiconSize(HICON hicon) { - wxSize size(32, 32); // default + // default icon size on this hardware + // usually 32x32 but can be other (smaller) on pocket devices + wxSize size(::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + #ifndef __WXWINCE__ if ( hicon && wxGetOsVersion() != wxWIN32S ) { @@ -591,6 +601,8 @@ wxSize wxGetHiconSize(HICON hicon) ::DeleteObject(info.hbmColor); } } +#else + wxUnusedVar(hicon); #endif return size; }