X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e702ff0f08a54622a6b0f1e2ec39537b082c3a8e..11c7d5b6d1cb54d5ffdc11d8ff092b41e225bfb6:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 163b00a160..af39670bd7 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -19,36 +19,32 @@ #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(); - - // Process events starting with the window with the focus, if any. - wxWindow* focusWin = wxFindFocusDescendant(this); + wxMenuBar* bar = GetMenuBar(); - if ( bar != NULL ) { - int nCount = bar->GetMenuCount(); - for (int n = 0; n < nCount; n++) - DoMenuUpdates(bar->GetMenu(n), focusWin); - } + 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, wxWindow* focusWin) +void wxFrame::DoMenuUpdates(wxMenu* menu, wxWindow* WXUNUSED(focusWin)) { - wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler(); - 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(); @@ -66,8 +62,8 @@ void wxFrame::DoMenuUpdates(wxMenu* menu, wxWindow* focusWin) } if (item->GetSubMenu()) - DoMenuUpdates(item->GetSubMenu(), focusWin); + DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL); } - node = node->Next(); + node = node->GetNext(); } }