bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
{
wxASSERT_MSG( pItem != NULL, wxT("can't append NULL item to the menu") );
- m_peer->InsertOrAppend( pItem, pos );
+ GetPeer()->InsertOrAppend( pItem, pos );
if ( pItem->IsSeparator() )
{
wxOSXMenuRemoveItem(m_hMenu , pos );
*/
- m_peer->Remove( item );
+ GetPeer()->Remove( item );
// and from internal data structures
return wxMenuBase::DoRemove(item);
}
void wxMenu::SetTitle(const wxString& label)
{
m_title = label ;
- m_peer->SetTitle( wxStripMenuCodes( label ) );
+ GetPeer()->SetTitle( wxStripMenuCodes( label ) );
}
bool wxMenu::ProcessCommand(wxCommandEvent & event)
bool wxMenuBar::s_macAutoWindowMenu = true ;
WXHMENU wxMenuBar::s_macWindowMenuHandle = NULL ;
+const int firstMenuPos = 1; // to account for the 0th application menu on mac
+
void wxMenuBar::Init()
{
m_eventHandler = this;
{
wxCHECK_RET( IsAttached(), wxT("doesn't work with unattached menubars") );
- m_rootMenu->FindItemByPosition( pos )->Enable(enable);
+ m_rootMenu->FindItemByPosition(pos+firstMenuPos)->Enable(enable);
Refresh();
}
// wxMenuBar construction
// ---------------------------------------------------------------------------
-const int firstMenuPos = 1; // to account for the 0th application menu on mac
-
wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
{
wxMenu *menuOld = wxMenuBarBase::Replace(pos, menu, title);