From 1697a45b1f9e996a6984c1ff679f05311357ce51 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Mon, 23 Jun 2014 20:01:57 +0000 Subject: [PATCH] Make checkable menu item with bitmap owner drawn. Since r44192 a checkable menu item with bitmap on pre-Vista assigns HBMMENU_CALLBACK to hbmpChecked and hbmpUnchecked members of MENUITEMINFO. However this value is only valid for hbmpItem and for other bitmaps InsertMenuItem will fail (with "the parameter is incorrect") resulting in making the menu owner drawn later. Instead check earlier on in MSWMustUseOwnerDrawn if we're dealing with a checkable menu item with a bitmap and if so make it owner drawn explicitly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/menuitem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 65ffdb6a16..a6593f35ed 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -1352,7 +1352,8 @@ bool wxMenuItem::MSWMustUseOwnerDrawn() GetFont().IsOk(); // Windows XP or earlier don't display menu bitmaps bigger than - // standard size correctly (they're truncated), so we must use + // standard size correctly (they're truncated) nor can + // checked bitmaps use HBMMENU_CALLBACK, so we must use // owner-drawn items to show them correctly there. OTOH Win7 // doesn't seem to have any problems with even very large bitmaps // so don't use owner-drawn items unnecessarily there (Vista wasn't @@ -1363,7 +1364,8 @@ bool wxMenuItem::MSWMustUseOwnerDrawn() bmpChecked = GetBitmap(true); if ( (bmpUnchecked.IsOk() && IsGreaterThanStdSize(bmpUnchecked)) || - (bmpChecked.IsOk() && IsGreaterThanStdSize(bmpChecked)) ) + (bmpChecked.IsOk() && IsGreaterThanStdSize(bmpChecked)) || + (bmpChecked.IsOk() && IsCheckable()) ) { mustUseOwnerDrawn = true; }