]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/NSWindow.mm
blind OS/2 compilation fix in wxSetWorkingDirectory()
[wxWidgets.git] / src / cocoa / NSWindow.mm
index 792f701b1911049f545b70f11728d6e86d8de7b9..7152f6c47bb982560b1749ad1c1d7b515d3bd248 100644 (file)
     #include "wx/menuitem.h"
 #endif // WX_PRECOMP
 
-#include "wx/cocoa/ObjcPose.h"
 #include "wx/cocoa/NSWindow.h"
 
-#import <AppKit/NSWindow.h>
 #import <Foundation/NSNotification.h>
 #import <Foundation/NSString.h>
+#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