#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();
+ wxEvtHandler* evtHandler = GetEventHandler();
wxNode* node = menu->GetItems().First();
while (node)
{
}
if (item->GetSubMenu())
- DoMenuUpdates(item->GetSubMenu(), focusWin);
+ DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL);
}
node = node->Next();
}