X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ca6a5f04692678cd2d9f3ea0843fc3f5a0b254f..f51a6f6a0c11f2d5ce58bcb858f5dfa1c27299a5:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index c7678d5b5f..5782c231ef 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -290,6 +290,14 @@ void wxFrameBase::OnMenuHighlight(wxMenuEvent& event) #endif // wxUSE_STATUSBAR } +bool wxFrameBase::SendIconizeEvent(bool iconized) +{ + wxIconizeEvent event(GetId(), iconized); + event.SetEventObject(this); + + return GetEventHandler()->ProcessEvent(event); +} + // ---------------------------------------------------------------------------- // status bar stuff // ---------------------------------------------------------------------------- @@ -427,18 +435,23 @@ void wxFrameBase::DoMenuUpdates() { wxMenuBar* bar = GetMenuBar(); +#ifdef __WXMSW__ + wxWindow* focusWin = wxFindFocusDescendant((wxWindow*) this); +#else + wxWindow* focusWin = (wxWindow*) NULL; +#endif if ( bar != NULL ) { int nCount = bar->GetMenuCount(); for (int n = 0; n < nCount; n++) - DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL); + DoMenuUpdates(bar->GetMenu(n), focusWin); } } // update a menu and all submenus recursively -void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* WXUNUSED(focusWin)) +void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* focusWin) { - wxEvtHandler* evtHandler = GetEventHandler(); + wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler(); wxMenuItemList::Node* node = menu->GetMenuItems().GetFirst(); while (node) {