X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6688c3fd28581a9f438cb2c56030e107593bb5e..c17bcb844883451b564446bf7843e7b3f862fe48:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index e76404c9c9..591382e187 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -17,32 +17,31 @@ #include "wx/frame.h" #include "wx/menu.h" +#include "wx/menuitem.h" -// wxGTK is a special case because it doesn't use the generic wxMenuItem -// class, but it's own (already defined in wx/menu.h) one #ifndef __WXGTK__ - #include "wx/menuitem.h" -#endif //WXGTK - void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) ) { DoMenuUpdates(); } +#endif // update all menus void wxFrame::DoMenuUpdates() { wxMenuBar* bar = GetMenuBar(); + if ( bar != NULL ) { int nCount = bar->GetMenuCount(); for (int n = 0; n < nCount; n++) - DoMenuUpdates(bar->GetMenu(n)); + DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL); } } // update a menu and all submenus recursively -void wxFrame::DoMenuUpdates(wxMenu* menu) +void wxFrame::DoMenuUpdates(wxMenu* menu, wxWindow* WXUNUSED(focusWin)) { + wxEvtHandler* evtHandler = GetEventHandler(); wxNode* node = menu->GetItems().First(); while (node) { @@ -53,7 +52,7 @@ void wxFrame::DoMenuUpdates(wxMenu* menu) wxUpdateUIEvent event(id); event.SetEventObject( this ); - if (GetEventHandler()->ProcessEvent(event)) + if (evtHandler->ProcessEvent(event)) { if (event.GetSetText()) menu->SetLabel(id, event.GetText()); @@ -64,7 +63,7 @@ void wxFrame::DoMenuUpdates(wxMenu* menu) } if (item->GetSubMenu()) - DoMenuUpdates(item->GetSubMenu()); + DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL); } node = node->Next(); }