reset the old disabled image list even if there is no new one (bug 1604374)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2006-12-02 12:50:58 +00:00
parent 869c999938
commit 24bc71f48b

View File

@ -784,17 +784,21 @@ bool wxToolBar::Realize()
}
}
if ( m_disabledImgList )
// disable image lists are only supported in comctl32.dll 4.70+
if ( wxApp::GetComCtl32Version() >= 470 )
{
HIMAGELIST hil = m_disabledImgList
? GetHimagelistOf(m_disabledImgList)
: 0;
// notice that we set the image list even if don't have one right
// now as we could have it before and need to reset it in this case
HIMAGELIST oldImageList = (HIMAGELIST)
::SendMessage(GetHwnd(),
TB_SETDISABLEDIMAGELIST,
0,
(LPARAM)GetHimagelistOf(m_disabledImgList));
::SendMessage(GetHwnd(), TB_SETDISABLEDIMAGELIST, 0, (LPARAM)hil);
// delete previous image list if any
if ( oldImageList )
::DeleteObject( oldImageList );
::DeleteObject(oldImageList);
}
}