Ensure popup menus can display sub-menus.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier 2008-04-23 23:33:30 +00:00
parent 8c6dcbd068
commit 951a1f6009

View File

@ -223,7 +223,10 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added"));
pSubMenu->m_menuParent = this ;
if (wxMenuBar::MacGetInstalledMenuBar() == GetMenuBar())
// We need the !GetMenuBar() check to make sure we run MacBeforeDisplay()
// for popup menus and other menus which may not be part of the main
// menu bar.
if (!GetMenuBar() || wxMenuBar::MacGetInstalledMenuBar() == GetMenuBar())
pSubMenu->MacBeforeDisplay( true ) ;
if ( pos == (size_t)-1 )