]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/menu.cpp
more fixes to dllexport/import stuff for operator<<()s (still bug 1104372)
[wxWidgets.git] / src / univ / menu.cpp
index 730f6923c583fd0c5c1cb7da5961ea173b61dc2d..962d1549ed53af5b5509af1fdec3f3e21caac1ec 100644 (file)
@@ -136,7 +136,7 @@ public:
     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
@@ -358,7 +358,7 @@ void wxPopupMenuWindow::ChangeCurrent(wxMenuItemList::compatibility_iterator nod
             if ( item->IsSubMenu() && item->GetSubMenu()->IsShown() )
             {
                 item->GetSubMenu()->Dismiss();
-                OnSubmenuDismiss();
+                OnSubmenuDismiss( false );
             }
 
             RefreshItem(item);
@@ -463,7 +463,7 @@ void wxPopupMenuWindow::Dismiss()
         wxCHECK_RET( win, _T("opened submenu is not opened?") );
 
         win->Dismiss();
-        OnSubmenuDismiss();
+        OnSubmenuDismiss( false );
     }
 
     wxPopupTransientWindow::Dismiss();
@@ -476,6 +476,15 @@ void wxPopupMenuWindow::OnDismiss()
     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();
@@ -969,7 +978,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
                 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
@@ -1307,7 +1316,7 @@ void wxMenu::OnDismiss(bool dismissParent)
         wxPopupMenuWindow *win = m_menuParent->m_popupMenu;
         if ( win )
         {
-            win->OnSubmenuDismiss();
+            win->OnSubmenuDismiss( true );
         }
         else
         {
@@ -2295,7 +2304,7 @@ int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const
         *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;