X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3d012d1bf1a87700ea337b2ef2137d7a9d1a4cba..5a1e0e91a1ca5ec98b0eeb335cda757d1261ed08:/src/cocoa/NSWindow.mm diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index ebb81b92b0..7152f6c47b 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cocoa/NSWindow.mm +// Name: src/cocoa/NSWindow.mm // Purpose: wxCocoaNSWindow // Author: David Elliott // Modified by: // Created: 2003/03/16 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott // Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// @@ -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)canBecomeKeyWindow; -- (BOOL)canBecomeMainWindow; -@end // wxPoserNSwindow +- (BOOL)canBecomeMainWindow +{ + bool canBecome = false; + wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(self); + if(!tlw || !tlw->Cocoa_canBecomeMainWindow(canBecome)) + canBecome = [super canBecomeMainWindow]; + return canBecome; +} -WX_IMPLEMENT_POSER(wxPoserNSWindow); -@implementation wxPoserNSWindow : NSWindow +@end // implementation WXNSWindow + +// ============================================================================ +// @class WXNSPanel +// ============================================================================ +@implementation WXNSPanel : NSPanel - (BOOL)canBecomeKeyWindow { @@ -218,5 +233,4 @@ WX_IMPLEMENT_POSER(wxPoserNSWindow); return canBecome; } -@end // implementation wxPoserNSWindow - +@end // implementation WXNSPanel