virtual void OnDismiss();
// called when a submenu is dismissed
- void OnSubmenuDismiss() { m_hasOpenSubMenu = false; }
+ void OnSubmenuDismiss(bool dismissParent);
// get the currently selected item (may be NULL)
wxMenuItem *GetCurrentItem() const
if ( item->IsSubMenu() && item->GetSubMenu()->IsShown() )
{
item->GetSubMenu()->Dismiss();
- OnSubmenuDismiss();
+ OnSubmenuDismiss( false );
}
RefreshItem(item);
wxCHECK_RET( win, _T("opened submenu is not opened?") );
win->Dismiss();
- OnSubmenuDismiss();
+ OnSubmenuDismiss( false );
}
wxPopupTransientWindow::Dismiss();
HandleDismiss(true);
}
+void wxPopupMenuWindow::OnSubmenuDismiss(bool dismissParent)
+{
+ m_hasOpenSubMenu = false;
+
+ // we are closing whole menu so remove current highlight
+ if ( dismissParent )
+ ResetCurrent();
+}
+
void wxPopupMenuWindow::HandleDismiss(bool dismissParent)
{
ResetCurrent();
bool notUnique = false;
// translate everything to lower case before comparing
- wxChar chAccel = wxTolower(key);
+ wxChar chAccel = (wxChar)wxTolower(key);
// loop through all items searching for the item with this
// accel
wxPopupMenuWindow *win = m_menuParent->m_popupMenu;
if ( win )
{
- win->OnSubmenuDismiss();
+ win->OnSubmenuDismiss( true );
}
else
{
*unique = true;
// translate everything to lower case before comparing
- wxChar chAccel = wxTolower(key);
+ wxChar chAccel = (wxChar)wxTolower(key);
// the index of the item with this accel
int idxFound = -1;