]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/frame.cpp
Added the missing check for libw needed for wcslen() (Just defines in headers
[wxWidgets.git] / src / mac / carbon / frame.cpp
index a961e3616f8e4a180f5f3a5546586744fb8c0c11..55f1e3b72c132d90555fbc6622ae329c906f76f5 100644 (file)
@@ -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