// 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;
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);
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();
// 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;
}