X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/46dc76ba3573649a9ed7c7aff6dc677f533eee11..aef82f12c833f22b22d4a1ffb09261569d1fe1e8:/src/common/framecmn.cpp?ds=inline diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 4acd32c428..591382e187 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -8,27 +8,40 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + #include "wx/frame.h" +#include "wx/menu.h" +#include "wx/menuitem.h" +#ifndef __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) { @@ -39,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()); @@ -50,7 +63,7 @@ void wxFrame::DoMenuUpdates(wxMenu* menu) } if (item->GetSubMenu()) - DoMenuUpdates(item->GetSubMenu()); + DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL); } node = node->Next(); }