From: Julian Smart Date: Thu, 5 Jul 2001 15:49:18 +0000 (+0000) Subject: Released menubar capture before menu popup was captured. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1f752a2282fb36bb5e429c8c83e589b9ac66d7cb Released menubar capture before menu popup was captured. Process menu command AFTER menu is dismissed (or it stays there). Still some problems but menus and message box beginning to work in MicroWindows. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 001380d7f2..1d819ad0fe 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -601,10 +601,12 @@ void wxPopupMenuWindow::ClickItem(wxMenuItem *item) wxASSERT_MSG( !item->IsSeparator() && !item->IsSubMenu(), _T("can't click this item") ); - m_menu->ClickItem(item); + wxMenu* menu = m_menu; // close all menus DismissAndNotify(); + + menu->ClickItem(item); } void wxPopupMenuWindow::OpenSubmenu(wxMenuItem *item, InputMethod how) @@ -2223,6 +2225,11 @@ void wxMenuBar::PopupCurrentMenu(bool selectFirst) // that we pass 0 as width to position the menu exactly below the // item, not to the right of it wxRect rectItem = GetItemRect(m_current); + + // Release mouse, because the menu will get the capture. + if (HasCapture()) + ReleaseMouse(); + m_menuShown->Popup(ClientToScreen(rectItem.GetPosition()), wxSize(0, rectItem.GetHeight()), selectFirst);