- wxMenuItem *item = wxFrame::FindItemInMenuBar(menuId);
- if ( !item && GetActiveChild() )
- {
- item = GetActiveChild()->FindItemInMenuBar(menuId);
- }
+ // We must look in the child menu first: if it has an item with the same ID
+ // as in our own menu bar, the child item should be used to determine
+ // whether it's currently enabled.
+ wxMenuItem *item = GetActiveChild()
+ ? GetActiveChild()->FindItemInMenuBar(menuId)
+ : NULL;
+ if ( !item )
+ item = wxFrame::FindItemInMenuBar(menuId);