}
}
-// 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.GetForce())
- {
- this->Destroy();
- }
-}
-
-bool wxFrame::OnClose()
-{
- return TRUE;
+ this->Destroy();
}
// Destroy the window (delayed, if a managed window)
}
*/
- 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