]> git.saurik.com Git - wxWidgets.git/commitdiff
corrected drawing of the bitmaps for the disabled menu items (replaces patch 1632891...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 14 Jan 2007 20:59:17 +0000 (20:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 14 Jan 2007 20:59:17 +0000 (20:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/ownerdrw.cpp

index 5f8a6e27db0ffc5425bfd7ea625003fc3f6a97d7..1025cc9c4c2f39c245cb9b233a0028faa19d6005 100644 (file)
@@ -98,6 +98,8 @@ All:
 wxMSW
 
 - Fix lack of spin control update event when control lost focus
+- Corrected drawing of bitmaps for disabled menu items
+
 
 2.8.1
 -----
index ffda6982b54a2d1c1969daea225b976828ff3188..8d45820d74ac8239469423a10256b5292a191963 100644 (file)
@@ -421,9 +421,20 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
 
         if ( !bmp.Ok() )
         {
-            // for not checkable bitmaps we should always use unchecked one because
-            // their checked bitmap is not set
+            // for not checkable bitmaps we should always use unchecked one
+            // because their checked bitmap is not set
             bmp = GetBitmap(!IsCheckable() || (st & wxODChecked));
+
+#if wxUSE_IMAGE
+            if ( bmp.Ok() && st & wxODDisabled )
+            {
+                // we need to grey out the bitmap as we don't have any specific
+                // disabled bitmap
+                wxImage imgGrey = bmp.ConvertToImage().ConvertToGreyscale();
+                if ( imgGrey.Ok() )
+                    bmp = wxBitmap(imgGrey);
+            }
+#endif // wxUSE_IMAGE
         }
 
         if ( bmp.Ok() )