#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
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(),