]> git.saurik.com Git - wxWidgets.git/commitdiff
Add upwards recursion to UpdateAccel method.
authorDavid Webster <Dave.Webster@bhmi.com>
Mon, 18 Jul 2005 15:27:31 +0000 (15:27 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Mon, 18 Jul 2005 15:27:31 +0000 (15:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/menu.cpp

index c4567c4253d4ba0cd5e65c0e6befda30c6e2c0f6..3e25f5f0d2500c18730b8cdf58411aa1fd80dc51 100644 (file)
@@ -189,6 +189,18 @@ void wxMenu::UpdateAccel(
     }
     else if (!pItem->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(pItem);
+            return;
+        }
+
         //
         // Find the (new) accel for this item
         //