]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/toplevel.mm
Implement wxChoice including sorting and client data
[wxWidgets.git] / src / cocoa / toplevel.mm
index 7535026a54b737e61ed669079326284868c60e22..20c1f6e9fff2aee49b8d10add008b6acfd16e124 100644 (file)
@@ -29,6 +29,8 @@
 #endif //WX_PRECOMP
 
 #include "wx/cocoa/autorelease.h"
+#include "wx/cocoa/string.h"
+#include "wx/cocoa/mbarman.h"
 
 #import <AppKit/NSView.h>
 #import <AppKit/NSWindow.h>
@@ -92,6 +94,7 @@ bool wxTopLevelWindowCocoa::Create(wxWindow *parent,
     // above alloc and thus the retain count will be 1.
     [m_cocoaNSWindow release];
 
+    [m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)];
     return TRUE;
 }
 
@@ -131,6 +134,7 @@ void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newVie
 void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
 {
     wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey",this);
+    wxMenuBarManager::GetInstance()->WindowDidBecomeKey(this);
     wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
     event.SetEventObject(this);
     GetEventHandler()->ProcessEvent(event);
@@ -142,6 +146,19 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
     wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
     event.SetEventObject(this);
     GetEventHandler()->ProcessEvent(event);
+    wxMenuBarManager::GetInstance()->WindowDidResignKey(this);
+}
+
+void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void)
+{
+    wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain",this);
+    wxMenuBarManager::GetInstance()->WindowDidBecomeMain(this);
+}
+
+void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignMain(void)
+{
+    wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain",this);
+    wxMenuBarManager::GetInstance()->WindowDidResignMain(this);
 }
 
 void wxTopLevelWindowCocoa::Cocoa_close(void)