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 )
{
}
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);
{
return m_tooltip->GetTip() ;
}
- return "" ;
+ return wxEmptyString ;
}
void wxWindowMac::Update()
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 ;