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
This commit is contained in:
Dimitri Schoolwerth
2014-06-23 20:01:57 +00:00
parent 1c49a2e1ba
commit 1697a45b1f

View File

@@ -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;
}