X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f9dae7798b164a5f4abc85d16f49cabd4e0980c0..bb41dcbe3a1ee4df0cd6a44e9cfb6a55b5d94fd6:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 3641dec49e..cbf6bf21ee 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -151,7 +151,7 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const { wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin(); -#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) +#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) && !defined(__WXWINCE__) wxToolBar *toolbar = GetToolBar(); if ( toolbar && toolbar->IsShown() ) { @@ -250,16 +250,18 @@ void wxFrameBase::OnMenuHighlight(wxMenuEvent& event) // Implement internal behaviour (menu updating on some platforms) void wxFrameBase::OnInternalIdle() { + wxTopLevelWindow::OnInternalIdle(); + #if wxUSE_MENUS && wxUSE_IDLEMENUUPDATES if (wxUpdateUIEvent::CanUpdate(this)) DoMenuUpdates(); #endif } -void wxFrameBase::OnMenuOpen(wxMenuEvent& WXUNUSED(event)) +void wxFrameBase::OnMenuOpen(wxMenuEvent& event) { #if wxUSE_MENUS && !wxUSE_IDLEMENUUPDATES - DoMenuUpdates(); + DoMenuUpdates(event.GetMenu()); #endif } @@ -421,13 +423,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);