#include "wx/wxprec.h"
+#if wxUSE_MENUS
+
#include "wx/menu.h"
#ifndef WX_PRECOMP
wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
{
- wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") );
+ wxCHECK_MSG( item, NULL, wxT("NULL item in wxMenu::DoAppend") );
bool check = false;
}
else
{
- wxFAIL_MSG( _T("where is the radio group start item?") );
+ wxFAIL_MSG( wxT("where is the radio group start item?") );
}
}
}
{
// next (i.e. second as we must be first) item is
// the separator to hide
- wxASSERT_MSG( pos == 0, _T("should be the menu start") );
+ wxASSERT_MSG( pos == 0, wxT("should be the menu start") );
sepToHide = next;
}
else if ( GetMenuItems().GetCount() == pos + 1 &&
{
m_eventHandler = this;
m_menuBarFrame = NULL;
- m_invokingWindow = (wxWindow*) NULL;
+ m_invokingWindow = NULL;
m_rootMenu = new wxMenu();
- wxMenu* applemenu = new wxMenu();
- applemenu->SetAllowRearrange(false);
- applemenu->Append( wxApp::s_macAboutMenuItemId, "About..." );
- applemenu->AppendSeparator();
- applemenu->Append( wxApp::s_macPreferencesMenuItemId, "Preferences..." );
- applemenu->AppendSeparator();
-
-#if ! wxOSX_USE_CARBON
- applemenu->Append( wxApp::s_macExitMenuItemId, "Quit\tCtrl+Q" );
+ m_appleMenu = new wxMenu();
+ m_appleMenu->SetAllowRearrange(false);
+ m_appleMenu->Append( wxApp::s_macAboutMenuItemId, "About..." );
+ m_appleMenu->AppendSeparator();
+#if !wxOSX_USE_CARBON
+ m_appleMenu->Append( wxApp::s_macPreferencesMenuItemId, "Preferences..." );
+ m_appleMenu->AppendSeparator();
+ m_appleMenu->Append( wxApp::s_macExitMenuItemId, "Quit\tCtrl+Q" );
#endif
- m_rootMenu->AppendSubMenu(applemenu, "\x14") ;
+ m_rootMenu->AppendSubMenu(m_appleMenu, "\x14") ;
}
wxMenuBar::wxMenuBar()
return ;
m_rootMenu->GetPeer()->MakeRoot();
+ // DisableMenuCommand( NULL , kHICommandPreferences ) ;
#if 0
MenuBarHandle menubar = NULL ;
static void wxMenubarUnsetInvokingWindow( wxMenu *menu )
{
- menu->SetInvokingWindow( (wxWindow*) NULL );
+ menu->SetInvokingWindow( NULL );
wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetFirst();
while (node)
void wxMenuBar::UnsetInvokingWindow()
{
- m_invokingWindow = (wxWindow*) NULL;
+ m_invokingWindow = NULL;
+ wxMenubarUnsetInvokingWindow(m_appleMenu);
+
wxMenu *menu;
wxMenuList::compatibility_iterator node = m_menus.GetFirst();
void wxMenuBar::SetInvokingWindow(wxFrame *frame)
{
m_invokingWindow = frame;
+ wxMenubarSetInvokingWindow(m_appleMenu, frame);
+
wxMenu *menu;
wxMenuList::compatibility_iterator node = m_menus.GetFirst();
return item;
}
+
+#endif