// Construct a menu with optional title (then use append)
-static
-wxMenu *
-_wxMenuAt(const wxMenuList &menuList, size_t pos)
-{
- wxMenuList::compatibility_iterator menuIter = menuList.GetFirst();
-
- while (pos-- > 0)
- menuIter = menuIter->GetNext();
-
- return menuIter->GetData() ;
-}
-
void wxMenu::Init()
{
m_doBreak = false;
UMASetMenuTitle( MAC_WXHMENU(menu->GetHMenu()) , m_titles[i], GetFont().GetEncoding() ) ;
menu->MacBeforeDisplay(false) ;
- ::InsertMenu(MAC_WXHMENU(_wxMenuAt(m_menus, i)->GetHMenu()), 0);
+ ::InsertMenu(MAC_WXHMENU(GetMenu(i)->GetHMenu()), 0);
}
}
if ( !IsAttached() )
return;
- _wxMenuAt(m_menus, pos)->SetTitle( label ) ;
+ GetMenu(pos)->SetTitle( label ) ;
}
wxString wxMenuBar::GetMenuLabel(size_t pos) const
{
wxString title = wxStripMenuCodes(m_titles[i]);
if ( menuLabel == title )
- return _wxMenuAt(m_menus, i)->FindItem(itemString);
+ return GetMenu(i)->FindItem(itemString);
}
return wxNOT_FOUND;
wxMenuItem *item = NULL;
size_t count = GetMenuCount();
for ( size_t i = 0; !item && (i < count); i++ )
- item = _wxMenuAt(m_menus, i)->FindItem(id, itemMenu);
+ item = GetMenu(i)->FindItem(id, itemMenu);
return item;
}