diff --git a/docs/changes.txt b/docs/changes.txt index 5b0838e5c0..f007465473 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -115,6 +115,7 @@ wxMSW: - Fix keyboard support in wxSpinCtrl broken in 2.8.8. - Compile fix for WinCE in window.cpp (no VkKeyScan in Windows CE). - Fix quoting of arguments passed to wxExecute(char **) (Brian Ravnsgaard Riis). +- Support disabling items before adding them to the menu (Christian Walther). wxGTK: diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 9005fb4514..3230373c9b 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -354,7 +354,8 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) UpdateAccel(pItem); #endif // wxUSE_ACCEL - UINT flags = 0; + // we should support disabling the item even prior to adding it to the menu + UINT flags = pItem->IsEnabled() ? MF_ENABLED : MF_GRAYED; // if "Break" has just been called, insert a menu break before this item // (and don't forget to reset the flag)