Use WM_INITMENUPOPUP

Added wxMenu member to wxMenuEvent


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-07-12 23:09:04 +00:00
parent 1b80d34a52
commit 92f1a59c28
8 changed files with 79 additions and 39 deletions

View File

@@ -256,10 +256,10 @@ void wxFrameBase::OnInternalIdle()
#endif
}
void wxFrameBase::OnMenuOpen(wxMenuEvent& WXUNUSED(event))
void wxFrameBase::OnMenuOpen(wxMenuEvent& event)
{
#if wxUSE_MENUS && !wxUSE_IDLEMENUUPDATES
DoMenuUpdates();
DoMenuUpdates(event.GetMenu());
#endif
}
@@ -421,13 +421,15 @@ wxToolBar* wxFrameBase::OnCreateToolBar(long style,
#if wxUSE_MENUS
// update all menus
void wxFrameBase::DoMenuUpdates()
void wxFrameBase::DoMenuUpdates(wxMenu* menu)
{
wxEvtHandler* source = GetEventHandler();
wxMenuBar* bar = GetMenuBar();
if ( bar != NULL )
if (menu)
menu->UpdateUI(source);
else if ( bar != NULL )
{
wxEvtHandler* source = GetEventHandler();
int nCount = bar->GetMenuCount();
for (int n = 0; n < nCount; n++)
bar->GetMenu(n)->UpdateUI(source);