#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();
+ wxMenuBar* bar = GetMenuBar();
- if ( bar != NULL ) {
- int nCount = bar->GetMenuCount();
- for (int n = 0; n < nCount; n++)
- DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL);
- }
+ 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* WXUNUSED(focusWin))
{
wxEvtHandler* evtHandler = GetEventHandler();
- wxNode* node = menu->GetItems().First();
+ wxMenuItemList::Node* node = menu->GetMenuItems().GetFirst();
while (node)
{
- wxMenuItem* item = (wxMenuItem*) node->Data();
+ wxMenuItem* item = node->GetData();
if ( !item->IsSeparator() )
{
wxWindowID id = item->GetId();
if (item->GetSubMenu())
DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL);
}
- node = node->Next();
+ node = node->GetNext();
}
}