]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/menu.cpp
Missing includes.
[wxWidgets.git] / src / msw / menu.cpp
index ddc8094612af2662ea4585d690e04e943d4996ed..23644015602f13cc7abc03879ad852d3279c3759 100644 (file)
@@ -305,6 +305,16 @@ void wxMenu::UpdateAccel(wxMenuItem *item)
     }
     else if ( !item->IsSeparator() )
     {
+        // recurse upwards: we should only modify m_accels of the top level
+        // menus, not of the submenus as wxMenuBar doesn't look at them
+        // (alternative and arguable cleaner solution would be to recurse
+        // downwards in GetAccelCount() and CopyAccels())
+        if ( GetParent() )
+        {
+            GetParent()->UpdateAccel(item);
+            return;
+        }
+
         // find the (new) accel for this item
         wxAcceleratorEntry *accel = wxGetAccelFromString(item->GetText());
         if ( accel )