]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxCocoaNSWindow* parameter to GetAppMenuBar so implementations can
authorDavid Elliott <dfe@tgwbd.org>
Thu, 6 Nov 2003 20:37:16 +0000 (20:37 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Thu, 6 Nov 2003 20:37:16 +0000 (20:37 +0000)
return an alternate menubar based on the window which needs it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/NSWindow.h
include/wx/cocoa/frame.h
include/wx/cocoa/toplevel.h
src/cocoa/NSWindow.mm
src/cocoa/frame.mm
src/cocoa/mbarman.mm
src/cocoa/toplevel.mm

index b7b51e8d0f4076b717a93bfe62ba4b5857acaf30..3bf28f62e03dda5c3d84d20d6d1ee7ce26733732 100644 (file)
@@ -34,7 +34,7 @@ public:
     virtual void CocoaDelegate_windowDidResignKey(void) { }
     virtual void CocoaDelegate_windowDidBecomeMain(void) { }
     virtual void CocoaDelegate_windowDidResignMain(void) { }
-    virtual wxMenuBar* GetAppMenuBar();
+    virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win);
 protected:
     static struct objc_object *sm_cocoaDelegate;
 };
index 9d0fcc3a419a70a8b32c67fdc40d22978ddd6584..9851356a08d8046755fa2a9a0fc61835bb3c16d8 100644 (file)
@@ -51,7 +51,7 @@ protected:
 // Cocoa specifics
 // ------------------------------------------------------------------------
 public:
-    virtual wxMenuBar* GetAppMenuBar();
+    virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win);
     // Returns the NSView for non-client drawing
     virtual WX_NSView GetNonClientNSView();
 protected:
index 8e5f44bd97b666d6fd2c36ef1c7e34ac436f1135..ae5e610a111f1213583f6b33e4ecc617cfb6fb13 100644 (file)
@@ -67,7 +67,7 @@ public:
     virtual void CocoaDelegate_windowDidResignKey(void);
     virtual void CocoaDelegate_windowDidBecomeMain(void);
     virtual void CocoaDelegate_windowDidResignMain(void);
-    virtual wxMenuBar* GetAppMenuBar();
+    virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win);
 protected:
     void SetNSWindow(WX_NSWindow cocoaNSWindow);
     WX_NSWindow m_cocoaNSWindow;
index e54df931015b885860552b585b6c839186c686ad..aef1f0ead5a835d60cb232e1ab53d5899d7e3611 100644 (file)
@@ -124,7 +124,7 @@ void wxCocoaNSWindow::DisassociateNSWindow(WX_NSWindow cocoaNSWindow)
     }
 }
 
-wxMenuBar* wxCocoaNSWindow::GetAppMenuBar()
+wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win)
 {
     return NULL;
 }
index e7ed47ceef0e93d11877d990df5274d266554206..b37aaa181f3246362ec3e85c45112c18f7b970cc 100644 (file)
@@ -81,11 +81,11 @@ void wxFrame::SetMenuBar(wxMenuBar *menubar)
     wxMenuBarManager::GetInstance()->UpdateWindowMenuBar(this);
 }
 
-wxMenuBar* wxFrame::GetAppMenuBar()
+wxMenuBar* wxFrame::GetAppMenuBar(wxCocoaNSWindow *win)
 {
     if(GetMenuBar())
         return GetMenuBar();
-    return wxFrameBase::GetAppMenuBar();
+    return wxFrameBase::GetAppMenuBar(win);
 }
 
 wxPoint wxFrame::GetClientAreaOrigin() const
index f6c52d21be2436140b89f91b4c8103011f3057d0..e67251718289960fab3dd7d61f39e74d5bd7759b 100644 (file)
@@ -272,7 +272,7 @@ void wxMenuBarManager::InstallMenuBarForWindow(wxCocoaNSWindow *win)
 {
     wxASSERT(win);
     m_windowCurrent = win;
-    wxMenuBar *menubar = win->GetAppMenuBar();
+    wxMenuBar *menubar = win->GetAppMenuBar(win);
     wxLogDebug("Found menubar=%p for window=%p.",menubar,win);
     SetMenuBar(menubar);
 }
index 121c6ffdbad1ea6268860bce71d0500388802222..de8ad026619aa6b25bb09ef6c6f2163530a8cf63 100644 (file)
@@ -134,11 +134,11 @@ wxTopLevelWindowCocoa::~wxTopLevelWindowCocoa()
 // wxTopLevelWindowCocoa Cocoa Specifics
 // ----------------------------------------------------------------------------
 
-wxMenuBar* wxTopLevelWindowCocoa::GetAppMenuBar()
+wxMenuBar* wxTopLevelWindowCocoa::GetAppMenuBar(wxCocoaNSWindow *win)
 {
     wxTopLevelWindowCocoa *parent = wxDynamicCast(GetParent(),wxTopLevelWindow);
     if(parent)
-        return parent->GetAppMenuBar();
+        return parent->GetAppMenuBar(win);
     return NULL;
 }