]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxIconBundle::GetIconOfExactSize() instead of duplicating its code
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Apr 2007 23:54:12 +0000 (23:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Apr 2007 23:54:12 +0000 (23:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/toplevel.cpp
src/os2/toplevel.cpp

index 3704dcf8a8890524c8e8e46abbe0cea2a1ad3dfd..1d50568724b46cdf3b77c4a61d5b6f37ac0c7bf1 100644 (file)
@@ -982,15 +982,15 @@ void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons)
     wxTopLevelWindowBase::SetIcons(icons);
 
 #if !defined(__WXMICROWIN__)
-    const wxIcon& sml = icons.GetIcon(16);
-    if( sml.Ok() && sml.GetWidth() == 16 && sml.GetHeight() == 16 )
+    const wxIcon& sml = icons.GetIconOfExactSize(16);
+    if( sml.Ok() )
     {
         ::SendMessage( GetHwndOf( this ), WM_SETICON, ICON_SMALL,
                        (LPARAM)GetHiconOf(sml) );
     }
 
-    const wxIcon& big = icons.GetIcon(32);
-    if( big.Ok() && big.GetWidth() == 32 && big.GetHeight() == 32 )
+    const wxIcon& big = icons.GetIconOfExactSize(32);
+    if( big.Ok() )
     {
         ::SendMessage( GetHwndOf( this ), WM_SETICON, ICON_BIG,
                        (LPARAM)GetHiconOf(big) );
index b231df5bff132b39f6ae596b0771ebd517478302..e076e5019770769b0bef482b373e40476e673031 100644 (file)
@@ -1004,9 +1004,9 @@ void wxTopLevelWindowOS2::SetIcons(
     //
     wxTopLevelWindowBase::SetIcons(rIcons);
 
-    const wxIcon& vIcon = rIcons.GetIcon(32);
+    const wxIcon& vIcon = rIcons.GetIconOfExactSize(32);
 
-    if (vIcon.Ok() && vIcon.GetWidth() == 32 && vIcon.GetHeight() == 32)
+    if (vIcon.Ok())
     {
         ::WinSendMsg( m_hFrame
                      ,WM_SETICON