From f87ddf1834c677a33f0c8d243d580d6d105447ef Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Feb 2011 12:45:19 +0000 Subject: [PATCH] Specify correct size for disabled image list in wxMSW wxToolBar. Use the real bitmap size instead of the default tool size when creating the disabled image list as the actual bitmap size could be less than the default one and in this case adding images to the image list later would fail (as could be seen by using custom bitmaps in the toolbar sample). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/toolbar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 44f08bffb8..5ab71b53b5 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -620,10 +620,11 @@ void wxToolBar::CreateDisabledImageList() wxBitmap bmpDisabled = tool->GetDisabledBitmap(); if ( bmpDisabled.Ok() ) { + const wxSize sizeBitmap = bmpDisabled.GetSize(); m_disabledImgList = new wxImageList ( - m_defaultWidth, - m_defaultHeight, + sizeBitmap.x, + sizeBitmap.y, bmpDisabled.GetMask() != NULL, GetToolsCount() ); -- 2.50.0