// when the cursor is inside the popup, which dsables the menu tracking
// so override it to do nothing
#ifdef __WXMSW__
- void OnIdle(wxIdleEvent& event) { }
+ void OnIdle(wxIdleEvent& WXUNUSED(event)) { }
#endif
// get the currently selected item (may be NULL)
}
wxPopupTransientWindow::Dismiss();
+
+ ResetCurrent();
}
void wxPopupMenuWindow::OnDismiss()
HandleDismiss(true);
}
-void wxPopupMenuWindow::OnSubmenuDismiss(bool dismissParent)
+void wxPopupMenuWindow::OnSubmenuDismiss(bool WXUNUSED(dismissParent))
{
m_hasOpenSubMenu = false;
-
- // we are closing whole menu so remove current highlight
- if ( dismissParent )
- ResetCurrent();
}
void wxPopupMenuWindow::HandleDismiss(bool dismissParent)
{
- ResetCurrent();
-
m_menu->OnDismiss(dismissParent);
}
void wxPopupMenuWindow::OnKeyDown(wxKeyEvent& event)
{
- if ( !ProcessKeyDown(event.GetKeyCode()) )
+ wxMenuBar *menubar = m_menu->GetMenuBar();
+
+ if ( menubar )
+ {
+ menubar->ProcessEvent(event);
+ }
+ else if ( !ProcessKeyDown(event.GetKeyCode()) )
{
event.Skip();
}
{
if ( ReleaseMouseCapture() )
wxLogTrace(_T("mousecapture"), _T("Releasing mouse from wxMenuBar::OnDismiss"));
-
+
if ( m_current != -1 )
{
size_t current = m_current;
if ( had )
ReleaseMouse();
-
+
capture->CaptureMouse();
return had;