support disabling items before adding them to the menu (#3423)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -115,6 +115,7 @@ wxMSW:
|
|||||||
- Fix keyboard support in wxSpinCtrl broken in 2.8.8.
|
- Fix keyboard support in wxSpinCtrl broken in 2.8.8.
|
||||||
- Compile fix for WinCE in window.cpp (no VkKeyScan in Windows CE).
|
- Compile fix for WinCE in window.cpp (no VkKeyScan in Windows CE).
|
||||||
- Fix quoting of arguments passed to wxExecute(char **) (Brian Ravnsgaard Riis).
|
- Fix quoting of arguments passed to wxExecute(char **) (Brian Ravnsgaard Riis).
|
||||||
|
- Support disabling items before adding them to the menu (Christian Walther).
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -354,7 +354,8 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
|||||||
UpdateAccel(pItem);
|
UpdateAccel(pItem);
|
||||||
#endif // wxUSE_ACCEL
|
#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
|
// if "Break" has just been called, insert a menu break before this item
|
||||||
// (and don't forget to reset the flag)
|
// (and don't forget to reset the flag)
|
||||||
|
Reference in New Issue
Block a user