]> 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 7711d8113e240060f6584f9370b8049229c43827..d772273b13c1a885446a852f7b029db5cebdad6a 100644 (file)
     #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"
+    #include "wx/settings.h"
+    #include "wx/menuitem.h"
+    #include "wx/module.h"
 #endif
 
-#include "wx/settings.h"
 #include "wx/ownerdrw.h"
-#include "wx/menuitem.h"
 #include "wx/fontutil.h"
-#include "wx/module.h"
 
 #if wxUSE_OWNER_DRAWN
 
@@ -421,15 +422,26 @@ 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() )
         {
             wxMemoryDC dcMem(&dc);
-            dcMem.SelectObject(bmp);
+            dcMem.SelectObjectAsSource(bmp);
 
             // center bitmap
             int nBmpWidth = bmp.GetWidth(),