Add wxCocoaNSWindow* parameter to GetAppMenuBar so implementations can

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
This commit is contained in:
David Elliott
2003-11-06 20:37:16 +00:00
parent f1d04a42d5
commit 8ded703ddc
7 changed files with 9 additions and 9 deletions

View 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;
};

View 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:

View 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;

View File

@@ -124,7 +124,7 @@ void wxCocoaNSWindow::DisassociateNSWindow(WX_NSWindow cocoaNSWindow)
}
}
wxMenuBar* wxCocoaNSWindow::GetAppMenuBar()
wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win)
{
return NULL;
}

View 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

View 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);
}

View 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;
}