X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e52f60e65236befe1a509cc3c1823607be0d2b3c..7beba2fc73283f5b750227459da57e66bcd475f5:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index aa326ecdf8..af39670bd7 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -19,38 +19,39 @@ #include "wx/menu.h" #include "wx/menuitem.h" -#ifndef __WXGTK__ void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) ) { - DoMenuUpdates(); + 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)); - } + wxMenuBar* bar = GetMenuBar(); + + if ( bar != NULL ) + { + int nCount = bar->GetMenuCount(); + for (int n = 0; n < nCount; 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)) { - wxNode* node = menu->GetItems().First(); + wxEvtHandler* evtHandler = GetEventHandler(); + wxMenuItemList::Node* node = menu->GetMenuItems().GetFirst(); while (node) { - wxMenuItem* item = (wxMenuItem*) node->Data(); + wxMenuItem* item = node->GetData(); if ( !item->IsSeparator() ) { wxWindowID id = item->GetId(); wxUpdateUIEvent event(id); event.SetEventObject( this ); - if (GetEventHandler()->ProcessEvent(event)) + if (evtHandler->ProcessEvent(event)) { if (event.GetSetText()) menu->SetLabel(id, event.GetText()); @@ -61,8 +62,8 @@ void wxFrame::DoMenuUpdates(wxMenu* menu) } if (item->GetSubMenu()) - DoMenuUpdates(item->GetSubMenu()); + DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL); } - node = node->Next(); + node = node->GetNext(); } }