From b78a53aca02d92b3334b40a94a322d467c75372c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 22 Mar 2011 17:15:34 +0000 Subject: [PATCH] Use disabled version of normal bitmap for disabled one in wxMSW::wxButton. Initialize the disabled button bitmap with a greyed out version of the normal one instead of using the same normal bitmap for it. This is more consistent with the other ports and makes more sense. Closes #13070. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/button.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/msw/button.cpp b/src/msw/button.cpp index d92ea4da35..433a71e73d 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -157,6 +157,7 @@ public: wxODButtonImageData(wxButton *btn, const wxBitmap& bitmap) { SetBitmap(bitmap, wxButton::State_Normal); + SetBitmap(bitmap.ConvertToDisabled(), wxButton::State_Disabled); m_dir = wxLEFT; @@ -225,10 +226,11 @@ public: wxButton::State_Max), m_hwndBtn(GetHwndOf(btn)) { - // initialize all bitmaps to normal state + // initialize all bitmaps except for the disabled one to normal state for ( int n = 0; n < wxButton::State_Max; n++ ) { - m_iml.Add(bitmap); + m_iml.Add(n == wxButton::State_Disabled ? bitmap.ConvertToDisabled() + : bitmap); } m_data.himl = GetHimagelistOf(&m_iml); -- 2.45.2