X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c4e8f384d7c9a2e1f31e9602917f2d1318de01f..650c0aa9180563eece310851973171cfaac83ad8:/src/cocoa/NSWindow.mm?ds=sidebyside diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index 792f701b19..7152f6c47b 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -23,12 +23,11 @@ #include "wx/menuitem.h" #endif // WX_PRECOMP -#include "wx/cocoa/ObjcPose.h" #include "wx/cocoa/NSWindow.h" -#import #import #import +#include "wx/cocoa/objc/NSWindow.h" // ============================================================================ // @class wxNSWindowDelegate @@ -187,18 +186,34 @@ wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win) } // ============================================================================ -// @class wxPoserNSWindow +// @class WXNSWindow // ============================================================================ -@interface wxPoserNSWindow : NSWindow +@implementation WXNSWindow : NSWindow + +- (BOOL)canBecomeKeyWindow +{ + bool canBecome = false; + wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(self); + if(!tlw || !tlw->Cocoa_canBecomeKeyWindow(canBecome)) + canBecome = [super canBecomeKeyWindow]; + return canBecome; +} + +- (BOOL)canBecomeMainWindow { + bool canBecome = false; + wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(self); + if(!tlw || !tlw->Cocoa_canBecomeMainWindow(canBecome)) + canBecome = [super canBecomeMainWindow]; + return canBecome; } -- (BOOL)canBecomeKeyWindow; -- (BOOL)canBecomeMainWindow; -@end // wxPoserNSwindow +@end // implementation WXNSWindow -WX_IMPLEMENT_POSER(wxPoserNSWindow); -@implementation wxPoserNSWindow : NSWindow +// ============================================================================ +// @class WXNSPanel +// ============================================================================ +@implementation WXNSPanel : NSPanel - (BOOL)canBecomeKeyWindow { @@ -218,4 +233,4 @@ WX_IMPLEMENT_POSER(wxPoserNSWindow); return canBecome; } -@end // implementation wxPoserNSWindow +@end // implementation WXNSPanel