+ //
+ // 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
+ //
+ wxAcceleratorEntry* pAccel = wxAcceleratorEntry::Create(pItem->GetItemLabel());
+
+ if (pAccel)
+ pAccel->m_command = pItem->GetId();
+
+ //
+ // Find the old one
+ //
+ size_t n = FindAccel(pItem->GetId());
+
+ if (n == (size_t)wxNOT_FOUND)
+ {
+ //
+ // No old, add new if any
+ //
+ if (pAccel)
+ m_vAccels.Add(pAccel);
+ else
+ return;
+ }