]> git.saurik.com Git - wxWidgets.git/commitdiff
Use disabled version of normal bitmap for disabled one in wxMSW::wxButton.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 22 Mar 2011 17:15:34 +0000 (17:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 22 Mar 2011 17:15:34 +0000 (17:15 +0000)
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

index d92ea4da35b2669f365b5aaef861883f894c2465..433a71e73dbac01e21cb905fc353b49ab0eee2d3 100644 (file)
@@ -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);