Fix HMENU to wxMenu translation in wxMSW code.

We didn't find the menus corresponding to the submenu handles. This resulted
in incorrect processing of EVT_UPDATE_UI events for the submenus and probably
other problems.

Fix this by searching for the HMENU recursively in all menus.

Closes #13080.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-03-31 09:28:38 +00:00
parent 40cb56e248
commit a99a3029c8
4 changed files with 50 additions and 9 deletions

View File

@@ -864,15 +864,7 @@ bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu)
wxMenu* menu = NULL;
if (GetMenuBar())
{
int nCount = GetMenuBar()->GetMenuCount();
for (int n = 0; n < nCount; n++)
{
if (GetMenuBar()->GetMenu(n)->GetHMenu() == hMenu)
{
menu = GetMenuBar()->GetMenu(n);
break;
}
}
menu = GetMenuBar()->MSWGetMenu(hMenu);
}
wxMenuEvent event(wxEVT_MENU_OPEN, 0, menu);