Don't generate wxEVT_MENU_{OPEN,CLOSE} for disabled top menus in wxMSW.
Windows still sends these messages even if a top level menu is disabled, for some reason, so filter them out manually. Closes #2168. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1629,6 +1629,18 @@ void wxMenuBar::Detach()
|
||||
wxMenuBarBase::Detach();
|
||||
}
|
||||
|
||||
int wxMenuBar::MSWGetTopMenuPos(WXHMENU hMenu) const
|
||||
{
|
||||
for ( size_t n = 0 ; n < GetMenuCount(); ++n )
|
||||
{
|
||||
wxMenu* menu = GetMenu(n)->MSWGetMenu(hMenu);
|
||||
if ( menu )
|
||||
return n;
|
||||
}
|
||||
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
wxMenu* wxMenuBar::MSWGetMenu(WXHMENU hMenu) const
|
||||
{
|
||||
// If we're called with the handle of the menu bar itself, we can return
|
||||
|
||||
Reference in New Issue
Block a user