From: Vadim Zeitlin Date: Sun, 14 Jan 2007 20:59:17 +0000 (+0000) Subject: corrected drawing of the bitmaps for the disabled menu items (replaces patch 1632891... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0d3997fd6d10c1fa80611eaff1c64b6b51cacb74?ds=inline corrected drawing of the bitmaps for the disabled menu items (replaces patch 1632891, closes bug 1632888) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 5f8a6e27db..1025cc9c4c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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 ----- diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index ffda6982b5..8d45820d74 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -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() )