]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/gdiimage.cpp
erase separators shown behind the controls added to the toolbar
[wxWidgets.git] / src / msw / gdiimage.cpp
index 3ead2479d1d150bc10f7df5accefc8037c70a6f8..87fb6add432aae0c5ae1e855270b56d469bc48c9 100644 (file)
@@ -175,10 +175,10 @@ private:
 // wxWin macros
 // ----------------------------------------------------------------------------
 
-    IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler)
-    IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
-    IMPLEMENT_DYNAMIC_CLASS(wxICOFileHandler, wxGDIImageHandler)
-    IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxGDIImageHandler)
+IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler)
+IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
+IMPLEMENT_DYNAMIC_CLASS(wxICOFileHandler, wxObject)
+IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxObject)
 
 // ----------------------------------------------------------------------------
 // private functions
@@ -511,6 +511,9 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
     // try to load the icon from this program first to allow overriding the
     // standard icons (although why one would want to do it considering that
     // we already have wxApp::GetStdIcon() is unclear)
+
+    // note that we can't just always call LoadImage() because it seems to do
+    // some icon rescaling internally which results in very ugly 16x16 icons
 #if defined(__WIN32__) && !defined(__SC__)
     if ( hasSize )
     {
@@ -519,7 +522,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
                                     LR_DEFAULTCOLOR);
     }
     else
-#endif // Win32
+#endif // Win32/!Win32
     {
         hicon = ::LoadIcon(wxGetInstance(), name);
     }
@@ -551,12 +554,6 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
     wxSize size = GetHiconSize(hicon);
     icon->SetSize(size.x, size.y);
 
-    // Override the found values with desired values
-    if ( desiredWidth > -1 && desiredHeight > -1 )
-    {
-        icon->SetSize(desiredWidth, desiredHeight);
-    }
-
     icon->SetHICON((WXHICON)hicon);
 
     return icon->Ok();