X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63fec618dcf7313de03a6912b9e0d3f5c5c6535a..372789845514bbe4171026f09744d36b4555a3de:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 59e2c3c868..591382e187 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -3,30 +3,45 @@ // Purpose: common (for all platforms) wxFrame functions // Author: Julian Smart, Vadim Zeitlin // Created: 01/02/97 -// Id: +// Id: $Id$ // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -void wxFrame::OnIdle(wxIdleEvent& event) +// 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) { @@ -37,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()); @@ -48,7 +63,7 @@ void wxFrame::DoMenuUpdates(wxMenu* menu) } if (item->GetSubMenu()) - DoMenuUpdates(item->GetSubMenu()); + DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL); } node = node->Next(); }