]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/toplevel.mm
Renamed UpdateWindowMenuBar to UpdateMenuBar and removed unused parameter
[wxWidgets.git] / src / cocoa / toplevel.mm
index c51f22719aa2b760bc26fd123aba18111178055f..de8ad026619aa6b25bb09ef6c6f2163530a8cf63 100644 (file)
@@ -134,6 +134,14 @@ wxTopLevelWindowCocoa::~wxTopLevelWindowCocoa()
 // wxTopLevelWindowCocoa Cocoa Specifics
 // ----------------------------------------------------------------------------
 
+wxMenuBar* wxTopLevelWindowCocoa::GetAppMenuBar(wxCocoaNSWindow *win)
+{
+    wxTopLevelWindowCocoa *parent = wxDynamicCast(GetParent(),wxTopLevelWindow);
+    if(parent)
+        return parent->GetAppMenuBar(win);
+    return NULL;
+}
+
 void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow)
 {
     bool need_debug = cocoaNSWindow || m_cocoaNSWindow;
@@ -159,7 +167,6 @@ 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);
@@ -171,22 +178,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)
+void wxTopLevelWindowCocoa::CocoaDelegate_windowWillClose(void)
 {
     m_closed = true;
     Destroy();
@@ -257,8 +261,8 @@ bool wxTopLevelWindowCocoa::Close(bool force)
     // will invoke windowShouldClose which will call the base class version
     // of Close() which will NOT Destroy() the window (see below) but
     // if closing is not stopped, then performClose will go ahead and
-    // close the window which will invoke Cocoa_close() setting m_closed
-    // to true and Destroy()ing the window.
+    // close the window which will send the close notifications setting
+    // m_closed to true and Destroy()ing the window.
     [m_cocoaNSWindow performClose:m_cocoaNSWindow];
     return m_closed;
 }