]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ownerdrw.cpp
include wx/thread.h in debug build which is needed after last change
[wxWidgets.git] / src / msw / ownerdrw.cpp
index ffda6982b54a2d1c1969daea225b976828ff3188..d772273b13c1a885446a852f7b029db5cebdad6a 100644 (file)
@@ -21,6 +21,7 @@
     #include "wx/msw/private.h"
     #include "wx/font.h"
     #include "wx/bitmap.h"
+    #include "wx/image.h"
     #include "wx/dcmemory.h"
     #include "wx/menu.h"
     #include "wx/utils.h"
@@ -421,9 +422,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() )