Add upwards recursion to UpdateAccel method.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster 2005-07-18 15:27:31 +00:00
parent fde0548028
commit 13aca5dd5d

View File

@ -189,6 +189,18 @@ void wxMenu::UpdateAccel(
} }
else if (!pItem->IsSeparator()) 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 // Find the (new) accel for this item
// //