* Added virtual GetAppMenuBar() which returns the app-wide menubar which
would be appropriate for this window, or NULL if the manager should decide * Added Become/Resign Main handlers * For all Become/Resign Main/Key handlers, notify the menubar manager git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -15,6 +15,8 @@
|
|||||||
#include "wx/hashmap.h"
|
#include "wx/hashmap.h"
|
||||||
#include "wx/cocoa/NSWindow.h"
|
#include "wx/cocoa/NSWindow.h"
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxMenuBar;
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
// wxTopLevelWindowCocoa
|
// wxTopLevelWindowCocoa
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
@@ -63,6 +65,9 @@ public:
|
|||||||
virtual bool CocoaDelegate_windowShouldClose(void);
|
virtual bool CocoaDelegate_windowShouldClose(void);
|
||||||
virtual void CocoaDelegate_windowDidBecomeKey(void);
|
virtual void CocoaDelegate_windowDidBecomeKey(void);
|
||||||
virtual void CocoaDelegate_windowDidResignKey(void);
|
virtual void CocoaDelegate_windowDidResignKey(void);
|
||||||
|
virtual void CocoaDelegate_windowDidBecomeMain(void);
|
||||||
|
virtual void CocoaDelegate_windowDidResignMain(void);
|
||||||
|
virtual wxMenuBar* GetAppMenuBar() { return NULL; }
|
||||||
protected:
|
protected:
|
||||||
void SetNSWindow(WX_NSWindow cocoaNSWindow);
|
void SetNSWindow(WX_NSWindow cocoaNSWindow);
|
||||||
WX_NSWindow m_cocoaNSWindow;
|
WX_NSWindow m_cocoaNSWindow;
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#endif //WX_PRECOMP
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
#include "wx/cocoa/autorelease.h"
|
#include "wx/cocoa/autorelease.h"
|
||||||
|
#include "wx/cocoa/mbarman.h"
|
||||||
|
|
||||||
#import <AppKit/NSView.h>
|
#import <AppKit/NSView.h>
|
||||||
#import <AppKit/NSWindow.h>
|
#import <AppKit/NSWindow.h>
|
||||||
@@ -131,6 +132,7 @@ void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newVie
|
|||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey",this);
|
wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey",this);
|
||||||
|
wxMenuBarManager::GetInstance()->WindowDidBecomeKey(this);
|
||||||
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -142,6 +144,19 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
|
|||||||
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
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::Cocoa_close(void)
|
||||||
|
Reference in New Issue
Block a user