// Construct a menu with optional title (then use append)
+#ifdef __DARWIN__
+short wxMenu::s_macNextMenuId = 3 ;
+#else
short wxMenu::s_macNextMenuId = 2 ;
+#endif
void wxMenu::Init()
{
if ( accel )
m_accels[n] = accel;
else
- m_accels.Remove(n);
+ m_accels.RemoveAt(n);
}
if ( IsAttached() )
{
delete m_accels[n];
- m_accels.Remove(n);
+ m_accels.RemoveAt(n);
}
//else: this item doesn't have an accel, nothing to do
#endif // wxUSE_ACCEL
// other
// ---------------------------------------------------------------------------
-void wxMenu::Attach(wxMenuBar *menubar)
-{
- // menu can be in at most one menubar because otherwise they would both
- // delete the menu pointer
- wxASSERT_MSG( !m_menuBar, wxT("menu belongs to 2 menubars, expect a crash") );
-
- m_menuBar = menubar;
-}
-
-void wxMenu::Detach()
-{
- wxASSERT_MSG( m_menuBar, wxT("can't detach menu if it's not attached") );
-
- m_menuBar = NULL;
-}
-
wxWindow *wxMenu::GetWindow() const
{
if ( m_invokingWindow != NULL )
return true ;
}
}
-#ifndef __WXMAC_X__
+#ifndef __DARWIN__
else if ( macMenuId == kHMHelpMenuID )
{
int menuItem = formerHelpMenuItems ;
}
}
}
-#endif // __WXMAC_X__
+#endif // __DARWIN__
for (pos = 0, node = GetMenuItems().First(); node; node = node->Next(), pos++)
{
for (int i = 0; i < m_menus.GetCount() ; i++)
{
if ( m_menus[i]->MacGetMenuId() == macMenuId
-#ifndef __WXMAC_X__
+#ifndef __DARWIN__
||
( macMenuId == kHMHelpMenuID && ( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName ) )
#endif
if ( !wxMenuBarBase::Append(menu, title) )
return FALSE;
- menu->Attach(this);
-
m_titles.Add(title);
if ( IsAttached() )
return TRUE;
}
-void wxMenuBar::Attach(wxFrame *frame)
+void wxMenuBar::Detach()
{
-// wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
+ wxMenuBarBase::Detach() ;
+}
- m_menuBarFrame = frame;
+void wxMenuBar::Attach(wxFrame *frame)
+{
+ wxMenuBarBase::Attach( frame ) ;
#if wxUSE_ACCEL
RebuildAccelTable();