]> git.saurik.com Git - wxWidgets.git/commitdiff
Icons fetched from wxMimeTypesManager did not get the width/height of
authorRobin Dunn <robin@alldunn.com>
Mon, 15 Jul 2002 18:29:52 +0000 (18:29 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 15 Jul 2002 18:29:52 +0000 (18:29 +0000)
the icon, now they do.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16184 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/private.h
src/msw/gdiimage.cpp
src/msw/mimetype.cpp

index ab9b6714555a4d4f6f7f95ff166be15e00be3c98..7dc72333fe43298ae7e8a96cd52c111cd2cb5577 100644 (file)
@@ -478,6 +478,11 @@ inline bool wxStyleHasBorder(long style)
 // may return NULL
 extern wxWindow *wxGetWindowFromHWND(WXHWND hwnd);
 
 // may return NULL
 extern wxWindow *wxGetWindowFromHWND(WXHWND hwnd);
 
+
+// Get the size of an icon
+wxSize wxGetHiconSize(HICON hicon);
+
+
 #endif // wxUSE_GUI
 
 #endif
 #endif // wxUSE_GUI
 
 #endif
index 26e92921109019ac763d12375cd9c4a30fab4549..b34abfe24742870c735d1fda5cada43f50248a67 100644 (file)
@@ -184,7 +184,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxObject)
 // private functions
 // ----------------------------------------------------------------------------
 
 // private functions
 // ----------------------------------------------------------------------------
 
-static wxSize GetHiconSize(HICON hicon);
 #endif
     // __MICROWIN__
 
 #endif
     // __MICROWIN__
 
@@ -466,7 +465,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
         return FALSE;
     }
 
         return FALSE;
     }
 
-    size = GetHiconSize(hicon);
+    size = wxGetHiconSize(hicon);
 #else // Win16
     HICON hicon = ReadIconFile((wxChar *)name.c_str(),
                                wxGetInstance(),
 #else // Win16
     HICON hicon = ReadIconFile((wxChar *)name.c_str(),
                                wxGetInstance(),
@@ -551,7 +550,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
         }
     }
 
         }
     }
 
-    wxSize size = GetHiconSize(hicon);
+    wxSize size = wxGetHiconSize(hicon);
     icon->SetSize(size.x, size.y);
 
     icon->SetHICON((WXHICON)hicon);
     icon->SetSize(size.x, size.y);
 
     icon->SetHICON((WXHICON)hicon);
@@ -563,7 +562,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
 // private functions
 // ----------------------------------------------------------------------------
 
 // private functions
 // ----------------------------------------------------------------------------
 
-static wxSize GetHiconSize(HICON hicon)
+wxSize wxGetHiconSize(HICON hicon)
 {
     wxSize size(32, 32);    // default
 
 {
     wxSize size(32, 32);    // default
 
index 53a0551e81464ef09a9482d966ff07778ff8778a..c5d50392128f1f54584c63055cfdcfc9e449d0eb 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifdef __WXMSW__
     #include "wx/msw/registry.h"
 
 #ifdef __WXMSW__
     #include "wx/msw/registry.h"
-    #include "windows.h"
+    #include "wx/msw/private.h"
 #endif // OS
 
 #include "wx/msw/mimetype.h"
 #endif // OS
 
 #include "wx/msw/mimetype.h"
@@ -374,6 +374,8 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon,
 
                 default:
                     icon->SetHICON((WXHICON)hIcon);
 
                 default:
                     icon->SetHICON((WXHICON)hIcon);
+                    wxSize size = wxGetHiconSize(hIcon);
+                    icon->SetSize(size);
                     if ( iconIndex )
                         *iconIndex = nIndex;
                     if ( iconFile )
                     if ( iconIndex )
                         *iconIndex = nIndex;
                     if ( iconFile )