From 9e657d82f90cc456bb2c0a1e5d40143bc29352a9 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 12 Dec 2015 21:12:35 +0100 Subject: [PATCH] Fixed creating menu item which is disabled before being attached to the menu. Menu item should be created in disabled state if wxMenuItem is flagged as disabled. Closes #17282. --- src/msw/menu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index b963165ce9..b079933db3 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -556,6 +556,12 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) mii.wID = id; } + if ( flags & MF_GRAYED ) + { + mii.fMask |= MIIM_STATE; + mii.fState = MFS_GRAYED; + } + if ( flags & MF_CHECKED ) { mii.fMask |= MIIM_STATE;