#include "wx/wxprec.h"
+#if wxUSE_MENUS
+
#include "wx/menu.h"
#ifndef WX_PRECOMP
m_startRadioGroup = -1;
m_allowRearrange = true;
m_noEventsMode = false;
-
+
m_peer = wxMenuImpl::Create( this, wxStripMenuCodes(m_title) );
pSubMenu->DoRearrange();
}
else
- {
+ {
if ( pItem->GetId() == idMenuTitle )
pItem->GetMenu()->Enable( idMenuTitle, false );
}
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?") );
}
}
}
{
if ( !AllowRearrange() )
return;
-
+
wxMenuItem* previousItem = NULL ;
size_t pos ;
wxMenuItemList::compatibility_iterator node;
{
// 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_menuBarFrame = 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()
{
if ( s_macInstalledMenuBar == this )
return ;
-
+
m_rootMenu->GetPeer()->MakeRoot();
+ // DisableMenuCommand( NULL , kHICommandPreferences ) ;
#if 0
MenuBarHandle menubar = NULL ;
void wxMenuBar::EnableTop(size_t pos, bool enable)
{
wxCHECK_RET( IsAttached(), wxT("doesn't work with unattached menubars") );
-
+
m_rootMenu->FindItemByPosition( pos )->Enable(enable);
Refresh();
return false;
m_titles.Insert(title, pos);
-
+
m_rootMenu->Insert( pos+firstMenuPos, wxMenuItem::New( m_rootMenu, wxID_ANY, title, "", wxITEM_NORMAL, menu ) );
if (m_invokingWindow)
void wxMenuBar::UnsetInvokingWindow()
{
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