]> git.saurik.com Git - wxWidgets.git/commitdiff
Released menubar capture before menu popup was captured.
authorJulian Smart <julian@anthemion.co.uk>
Thu, 5 Jul 2001 15:49:18 +0000 (15:49 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 5 Jul 2001 15:49:18 +0000 (15:49 +0000)
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

src/univ/menu.cpp

index 001380d7f25dbf2da7c1b67add78670968f6418a..1d819ad0fecbf2da21dc492c360fc268efe9f980 100644 (file)
@@ -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);