From 13aca5dd5df57d1793b080a9cfbe56ad65e5cc73 Mon Sep 17 00:00:00 2001 From: David Webster Date: Mon, 18 Jul 2005 15:27:31 +0000 Subject: [PATCH] Add upwards recursion to UpdateAccel method. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/os2/menu.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index c4567c4253..3e25f5f0d2 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -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 // -- 2.47.2