X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/osx/carbon/menu.cpp?ds=sidebyside diff --git a/src/osx/carbon/menu.cpp b/src/osx/carbon/menu.cpp index 5f6a7a75d0..5db7b7bc50 100644 --- a/src/osx/carbon/menu.cpp +++ b/src/osx/carbon/menu.cpp @@ -189,7 +189,6 @@ public : virtual ~wxMenuCarbonImpl(); - virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos) { // MacOS counts menu items from 1 and inserts after, therefore having the @@ -217,7 +216,7 @@ public : MenuRef submenu = pItem->GetSubMenu()->GetHMenu(); SetMenuItemHierarchicalMenu(m_osxMenu, index, submenu); // carbon is using the title of the submenu, eg in the menubar - SetMenuTitleWithCFString(submenu, wxCFStringRef(wxStripMenuCodes(pItem->GetLabel()))); + SetMenuTitleWithCFString(submenu, wxCFStringRef(pItem->GetItemLabelText())); } else { @@ -244,8 +243,6 @@ public : DeleteMenuItem(m_osxMenu , i); impl->AttachToParent( NULL, 0 ); } - - delete entry; } } @@ -261,6 +258,24 @@ public : WXHMENU GetHMenu() { return m_osxMenu; } + virtual void PopUp( wxWindow *WXUNUSED(win), int x, int y ) + { + long menuResult = ::PopUpMenuSelect(m_osxMenu, y, x, 0) ; + if ( HiWord(menuResult) != 0 ) + { + MenuCommand macid; + GetMenuItemCommandID( GetMenuHandle(HiWord(menuResult)) , LoWord(menuResult) , &macid ); + int id = wxMacCommandToId( macid ); + wxMenuItem* item = NULL ; + wxMenu* realmenu ; + item = m_peer->FindItem( id, &realmenu ) ; + if ( item ) + { + m_peer->HandleCommandProcess(item, NULL ); + } + } + } + static wxMenuImpl* Create( wxMenu* peer, const wxString& title ); static wxMenuImpl* CreateRootMenu( wxMenu* peer ); protected :