Don't use owner drawn items under Win7 even when using larger bitmaps.

The check for menu bitmaps size added in r58557 was apparently only needed for
XP and earlier versions and doesn't seem to be necessary under Win7, so don't
use it there, if only because it allows to retrieve the menu item text which
is useful for automation/screen reader tools.

Closes #13544.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-10-14 15:08:13 +00:00
parent 824edf1528
commit 097ad8f1b0

View File

@@ -558,7 +558,13 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
pItem->GetBackgroundColour().IsOk() ||
pItem->GetFont().IsOk();
if ( !mustUseOwnerDrawn )
// Windows XP or earlier don't display menu bitmaps bigger than
// standard size correctly (they're truncated), 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
// actually tested but I assume it works as 7 rather than as XP).
if ( !mustUseOwnerDrawn && winver < wxWinVersion_Vista )
{
const wxBitmap& bmpUnchecked = pItem->GetBitmap(false),
bmpChecked = pItem->GetBitmap(true);