Make disabling submenus work in wxMSW.
As submenu items don't have a valid ID, we need to address them by their position when calling EnableMenuItem() -- and for simplicity do it for all the items. Closes #16747. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -599,6 +599,7 @@ wxMSW:
|
||||
- Fix size of the icon returned from wxFSVolume::GetIcon() (troelsk).
|
||||
- Fix autosize after expanding/collapsing items in wxDataViewCtrl (ciglesias).
|
||||
- Fix inserting tools removed from wxToolBar back into it (sbrowne).
|
||||
- Fix disabling submenu items in the menus (Artur Wieczorek).
|
||||
|
||||
|
||||
3.0.2: (released 2014-10-06)
|
||||
|
@@ -557,11 +557,12 @@ void wxMenuItem::Enable(bool enable)
|
||||
if ( m_isEnabled == enable )
|
||||
return;
|
||||
|
||||
if ( m_parentMenu )
|
||||
const int itemPos = MSGetMenuItemPos();
|
||||
if ( itemPos != -1 )
|
||||
{
|
||||
long rc = EnableMenuItem(GetHMenuOf(m_parentMenu),
|
||||
GetMSWId(),
|
||||
MF_BYCOMMAND |
|
||||
itemPos,
|
||||
MF_BYPOSITION |
|
||||
(enable ? MF_ENABLED : MF_GRAYED));
|
||||
|
||||
if ( rc == -1 )
|
||||
|
Reference in New Issue
Block a user