From dc834029a3eb341d9c9c5bebb4ce7b60560eeacb Mon Sep 17 00:00:00 2001 From: David Elliott Date: Thu, 9 Aug 2007 18:15:50 +0000 Subject: [PATCH] Add Objective-C uniquifying to WXNSWindow and WXNSPanel Copyright 2007 Software 2000 Ltd. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/objc/NSWindow.h | 4 ++++ src/cocoa/NSWindow.mm | 2 ++ src/cocoa/toplevel.mm | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/wx/cocoa/objc/NSWindow.h b/include/wx/cocoa/objc/NSWindow.h index 56ba3e151b..b5d73b16a1 100644 --- a/include/wx/cocoa/objc/NSWindow.h +++ b/include/wx/cocoa/objc/NSWindow.h @@ -12,6 +12,8 @@ #import #import +#include "wx/cocoa/objc/objc_uniquifying.h" + // ============================================================================ // @class WXNSWindow // ============================================================================ @@ -22,6 +24,7 @@ - (BOOL)canBecomeKeyWindow; - (BOOL)canBecomeMainWindow; @end // WXNSWindow +WX_DECLARE_GET_OBJC_CLASS(WXNSWindow,NSWindow) // ============================================================================ // @class WXNSPanel @@ -33,4 +36,5 @@ - (BOOL)canBecomeKeyWindow; - (BOOL)canBecomeMainWindow; @end // WXNSPanel +WX_DECLARE_GET_OBJC_CLASS(WXNSPanel,NSPanel) diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index 7152f6c47b..a9e3f7b58d 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -209,6 +209,7 @@ wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win) } @end // implementation WXNSWindow +WX_IMPLEMENT_GET_OBJC_CLASS(WXNSWindow,NSWindow) // ============================================================================ // @class WXNSPanel @@ -234,3 +235,4 @@ wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win) } @end // implementation WXNSPanel +WX_IMPLEMENT_GET_OBJC_CLASS(WXNSPanel,NSPanel) diff --git a/src/cocoa/toplevel.mm b/src/cocoa/toplevel.mm index f2e44d4b44..2567dcc06a 100644 --- a/src/cocoa/toplevel.mm +++ b/src/cocoa/toplevel.mm @@ -138,9 +138,9 @@ bool wxTopLevelWindowCocoa::Create(wxWindow *parent, NSWindow *newWindow; // Create a WXNSPanel or a WXNSWindow depending on what type of window is desired. if(style & wxFRAME_TOOL_WINDOW) - newWindow = [[WXNSPanel alloc] initWithContentRect:cocoaRect styleMask:cocoaStyle backing:NSBackingStoreBuffered defer:NO]; + newWindow = [[WX_GET_OBJC_CLASS(WXNSPanel) alloc] initWithContentRect:cocoaRect styleMask:cocoaStyle backing:NSBackingStoreBuffered defer:NO]; else - newWindow = [[WXNSWindow alloc] initWithContentRect:cocoaRect styleMask:cocoaStyle backing:NSBackingStoreBuffered defer:NO]; + newWindow = [[WX_GET_OBJC_CLASS(WXNSWindow) alloc] initWithContentRect:cocoaRect styleMask:cocoaStyle backing:NSBackingStoreBuffered defer:NO]; // Make sure the default content view is a WXNSView [newWindow setContentView: [[WX_GET_OBJC_CLASS(WXNSView) alloc] initWithFrame: [[newWindow contentView] frame]]]; // Associate the window and view -- 2.45.2