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
This commit is contained in:
parent
1370703e03
commit
1f752a2282
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user