X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/818e52c20151ce0c22aa752ccbab94f1ae7afc99..0f66a9f39d0d48f3e0da6641fa66d1b3db305732:/src/mac/frame.cpp diff --git a/src/mac/frame.cpp b/src/mac/frame.cpp index a961e3616f..55f1e3b72c 100644 --- a/src/mac/frame.cpp +++ b/src/mac/frame.cpp @@ -371,23 +371,10 @@ void wxFrame::OnActivate(wxActivateEvent& event) } } -// The default implementation for the close window event - calls -// OnClose for backward compatibility. - +// The default implementation for the close window event. void wxFrame::OnCloseWindow(wxCloseEvent& event) { - // Compatibility - if ( GetEventHandler()->OnClose() || !event.CanVeto()) - { - this->Destroy(); - } - else - event.Veto(TRUE); -} - -bool wxFrame::OnClose() -{ - return TRUE; + this->Destroy(); } // Destroy the window (delayed, if a managed window) @@ -463,7 +450,12 @@ void wxFrame::ProcessCommand(int id) } */ - GetEventHandler()->ProcessEvent(commandEvent); + // Process events starting with the window with the focus, if any. + wxWindow* focusWin = wxFindFocusDescendant(this); + + wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler(); + + evtHandler->ProcessEvent(commandEvent); } // Checks if there is a toolbar, and returns the first free client position