+/*static*/ void wxTopLevelWindowCocoa::DeactivatePendingWindow()
+{
+ if(sm_cocoaDeactivateWindow)
+ sm_cocoaDeactivateWindow->wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey();
+ sm_cocoaDeactivateWindow = NULL;
+}
+
+void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
+{
+ DeactivatePendingWindow();
+ wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
+ wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
+ event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(event);
+}
+
+void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
+{
+ wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this);
+ wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
+ event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(event);
+}
+
+void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void)