X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8950f7cc7e1dbe7cd1b9513d8ba74610fa696e36..f7f78039d2e18114efdec0abe46dc4ed2d4529a8:/src/mac/window.cpp diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 92efcad9f1..9f7a20f4e7 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -386,40 +386,7 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) menu->UpdateUI(); ClientToScreen( &x , &y ) ; - wxArrayPtrVoid submenus ; - wxMenuItemList::Node *node; - wxMenuItem *item; - int pos ; - for (pos = 0, node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++) - { - item = (wxMenuItem *)node->GetData(); - wxMenu* subMenu = item->GetSubMenu() ; - if (subMenu) - { - submenus.Add(subMenu) ; - } - } - - ::InsertMenu( (MenuHandle) menu->GetHMenu() , -1 ) ; - - for ( size_t i = 0 ; i < submenus.GetCount() ; ++i ) - { - wxMenu* submenu = (wxMenu*) submenus[i] ; - wxMenuItemList::Node *subnode; - wxMenuItem *subitem; - int subpos ; - for ( subpos = 0 , subnode = submenu->GetMenuItems().GetFirst(); subnode; subnode = subnode->GetNext(), subpos++) - { - subitem = (wxMenuItem *)subnode->GetData(); - wxMenu* itsSubMenu = subitem->GetSubMenu() ; - if (itsSubMenu) - { - submenus.Add(itsSubMenu) ; - } - } - ::InsertMenu( MAC_WXHMENU(submenu->GetHMenu()) , -1 ) ; - } - + menu->MacBeforeDisplay( true ) ; long menuResult = ::PopUpMenuSelect((MenuHandle) menu->GetHMenu() ,y,x, 0) ; if ( HiWord(menuResult) != 0 ) { @@ -434,12 +401,7 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) } menu->SendEvent( id , item->IsCheckable() ? item->IsChecked() : -1 ) ; } - ::DeleteMenu( menu->MacGetMenuId() ) ; - for ( size_t i = 0 ; i < submenus.GetCount() ; ++i ) - { - wxMenu* submenu = (wxMenu*) submenus[i] ; - ::DeleteMenu( submenu->MacGetMenuId() ) ; - } + menu->MacAfterDisplay( true ) ; menu->SetInvokingWindow(NULL); @@ -1680,7 +1642,7 @@ wxString wxWindowMac::MacGetToolTipString( wxPoint &pt ) { return m_tooltip->GetTip() ; } - return "" ; + return wxEmptyString ; } void wxWindowMac::Update() @@ -1893,13 +1855,13 @@ WXHWND wxWindowMac::MacGetRootWindow() const iter = iter->GetParent() ; } - wxASSERT_MSG( 1 , "No valid mac root window" ) ; + wxASSERT_MSG( 1 , wxT("No valid mac root window") ) ; return NULL ; } void wxWindowMac::MacCreateScrollBars( long style ) { - wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , "attempt to create window twice" ) ; + wxASSERT_MSG( m_vScrollBar == NULL && m_hScrollBar == NULL , wxT("attempt to create window twice") ) ; bool hasBoth = ( style & wxVSCROLL ) && ( style & wxHSCROLL ) ; int adjust = hasBoth ? MAC_SCROLLBAR_SIZE - 1: 0 ;