#include "wx/hashmap.h"
#include "wx/cocoa/NSWindow.h"
+class WXDLLEXPORT wxMenuBar;
+
// ========================================================================
// wxTopLevelWindowCocoa
// ========================================================================
virtual bool CocoaDelegate_windowShouldClose(void);
virtual void CocoaDelegate_windowDidBecomeKey(void);
virtual void CocoaDelegate_windowDidResignKey(void);
+ virtual void CocoaDelegate_windowDidBecomeMain(void);
+ virtual void CocoaDelegate_windowDidResignMain(void);
+ virtual wxMenuBar* GetAppMenuBar() { return NULL; }
protected:
void SetNSWindow(WX_NSWindow cocoaNSWindow);
WX_NSWindow m_cocoaNSWindow;
#endif //WX_PRECOMP
#include "wx/cocoa/autorelease.h"
+#include "wx/cocoa/mbarman.h"
#import <AppKit/NSView.h>
#import <AppKit/NSWindow.h>
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)