From 097ad8f1b0e5ca177b5edabbb10a6981f1d867c8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 14 Oct 2013 15:08:13 +0000 Subject: [PATCH] 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 --- src/msw/menu.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 5f461854e2..8a257768f9 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -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);