1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/nonownedwnd.mm
3 // Purpose: non owned window for cocoa
4 // Author: DavidStefan Csomor
7 // RCS-ID: $Id: nonownedwnd.mm 48805 2007-09-19 14:52:25Z SC $
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/nonownedwnd.h"
19 #include "wx/osx/private.h"
21 NSRect wxToNSRect( NSView* parent, const wxRect& r )
23 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
26 if ( parent == NULL || ![ parent isFlipped ] )
27 y = (int)(frame.size.height - ( r.y + r.height ));
28 return NSMakeRect(x, y, r.width , r.height);
31 wxRect wxFromNSRect( NSView* parent, const NSRect& rect )
33 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
34 int y = (int)rect.origin.y;
35 int x = (int)rect.origin.x;
36 if ( parent == NULL || ![ parent isFlipped ] )
37 y = (int)(frame.size.height - (rect.origin.y + rect.size.height));
38 return wxRect( x, y, (int)rect.size.width, (int)rect.size.height );
41 NSPoint wxToNSPoint( NSView* parent, const wxPoint& p )
43 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
46 if ( parent == NULL || ![ parent isFlipped ] )
47 y = (int)(frame.size.height - ( p.y ));
48 return NSMakePoint(x, y);
51 wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p )
53 NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
56 if ( parent == NULL || ![ parent isFlipped ] )
57 y = (int)(frame.size.height - ( p.y ));
58 return wxPoint( x, y);
61 bool shouldHandleSelector(SEL selector)
63 if (selector == @selector(noop:)
64 || selector == @selector(complete:)
65 || selector == @selector(deleteBackward:)
66 || selector == @selector(deleteForward:)
67 || selector == @selector(insertNewline:)
68 || selector == @selector(insertTab:)
69 || selector == @selector(keyDown:)
70 || selector == @selector(keyUp:)
71 || selector == @selector(scrollPageUp:)
72 || selector == @selector(scrollPageDown:)
73 || selector == @selector(scrollToBeginningOfDocument:)
74 || selector == @selector(scrollToEndOfDocument:))
82 // wx category for NSWindow (our own and wrapped instances)
85 @interface NSWindow (wxNSWindowSupport)
87 - (wxNonOwnedWindowCocoaImpl*) WX_implementation;
89 - (bool) WX_filterSendEvent:(NSEvent *) event;
93 @implementation NSWindow (wxNSWindowSupport)
95 - (wxNonOwnedWindowCocoaImpl*) WX_implementation
97 return (wxNonOwnedWindowCocoaImpl*) wxNonOwnedWindowImpl::FindFromWXWindow( self );
100 // TODO in cocoa everything during a drag is sent to the NSWindow the mouse down occured,
101 // this does not conform to the wx behaviour if the window is not captured, so try to resend
102 // or capture all wx mouse event handling at the tlw as we did for carbon
104 - (bool) WX_filterSendEvent:(NSEvent *) event
106 bool handled = false;
107 if ( ([event type] >= NSLeftMouseDown) && ([event type] <= NSMouseExited) )
109 wxWindow* cw = wxWindow::GetCapture();
112 ((wxWidgetCocoaImpl*)cw->GetPeer())->DoHandleMouseEvent( event);
121 // wx native implementation
124 @interface wxNSWindow : NSWindow
128 - (void) sendEvent:(NSEvent *)event;
129 - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen;
130 - (void)noResponderFor: (SEL) selector;
133 @implementation wxNSWindow
135 - (void)sendEvent:(NSEvent *) event
137 if ( ![self WX_filterSendEvent: event] )
139 WXEVENTREF formerEvent = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEvent();
140 WXEVENTHANDLERCALLREF formerHandler = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEventHandlerCallRef();
143 wxTheApp->MacSetCurrentEvent(event, NULL);
145 [super sendEvent: event];
148 wxTheApp->MacSetCurrentEvent(formerEvent , formerHandler);
152 // The default implementation always moves the window back onto the screen,
153 // even when the programmer explicitly wants to hide it.
154 - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
160 - (void)doCommandBySelector:(SEL)selector
162 if (shouldHandleSelector(selector) &&
163 !(selector == @selector(cancel:) || selector == @selector(cancelOperation:)) )
164 [super doCommandBySelector:selector];
168 // NB: if we don't do this, all key downs that get handled lead to a NSBeep
169 - (void)noResponderFor: (SEL) selector
171 if (selector != @selector(keyDown:) && selector != @selector(keyUp:))
173 [super noResponderFor:selector];
177 // We need this for borderless windows, i.e. shaped windows or windows without
178 // a title bar. For more info, see:
179 // http://lists.apple.com/archives/cocoa-dev/2008/May/msg02091.html
180 - (BOOL)canBecomeKeyWindow
187 @interface wxNSPanel : NSPanel
191 - (void)noResponderFor: (SEL) selector;
192 - (void)sendEvent:(NSEvent *)event;
195 @implementation wxNSPanel
197 - (BOOL)canBecomeKeyWindow
202 - (void)doCommandBySelector:(SEL)selector
204 if (shouldHandleSelector(selector))
205 [super doCommandBySelector:selector];
208 // NB: if we don't do this, it seems that all events that end here lead to a NSBeep
209 - (void)noResponderFor: (SEL) selector
211 if (selector != @selector(keyDown:) && selector != @selector(keyUp:))
213 [super noResponderFor:selector];
217 - (void)sendEvent:(NSEvent *) event
219 if ( ![self WX_filterSendEvent: event] )
220 [super sendEvent: event];
230 @interface wxNonOwnedWindowController : NSObject wxOSX_10_6_AND_LATER(<NSWindowDelegate>)
234 - (void)windowDidResize:(NSNotification *)notification;
235 - (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize;
236 - (void)windowDidResignKey:(NSNotification *)notification;
237 - (void)windowDidBecomeKey:(NSNotification *)notification;
238 - (void)windowDidMove:(NSNotification *)notification;
239 - (BOOL)windowShouldClose:(id)window;
240 - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
244 @implementation wxNonOwnedWindowController
252 - (BOOL)windowShouldClose:(id)nwindow
254 wxNonOwnedWindowCocoaImpl* windowimpl = [(NSWindow*) nwindow WX_implementation];
257 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
264 - (NSSize)windowWillResize:(NSWindow *)window
265 toSize:(NSSize)proposedFrameSize
267 NSRect frame = [window frame];
268 wxRect wxframe = wxFromNSRect( NULL, frame );
269 wxframe.SetWidth( (int)proposedFrameSize.width );
270 wxframe.SetHeight( (int)proposedFrameSize.height );
272 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
275 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
278 wxpeer->HandleResizing( 0, &wxframe );
279 NSSize newSize = NSMakeSize(wxframe.GetWidth(), wxframe.GetHeight());
284 return proposedFrameSize;
287 - (void)windowDidResize:(NSNotification *)notification
289 NSWindow* window = (NSWindow*) [notification object];
290 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
293 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
295 wxpeer->HandleResized(0);
299 - (void)windowDidMove:(NSNotification *)notification
301 wxNSWindow* window = (wxNSWindow*) [notification object];
302 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
305 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
307 wxpeer->HandleMoved(0);
311 - (void)windowDidBecomeKey:(NSNotification *)notification
313 NSWindow* window = (NSWindow*) [notification object];
314 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
317 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
319 wxpeer->HandleActivated(0, true);
323 - (void)windowDidResignKey:(NSNotification *)notification
325 NSWindow* window = (NSWindow*) [notification object];
326 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
329 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
332 wxpeer->HandleActivated(0, false);
333 // Needed for popup window since the firstResponder
334 // (focus in wx) doesn't change when this
335 // TLW becomes inactive.
336 wxFocusEvent event( wxEVT_KILL_FOCUS, wxpeer->GetId());
337 event.SetEventObject(wxpeer);
338 wxpeer->HandleWindowEvent(event);
343 - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject
347 if ([anObject isKindOfClass:[wxNSTextField class]])
349 wxNSTextField* tf = (wxNSTextField*) anObject;
350 wxNSTextFieldEditor* editor = [tf fieldEditor];
353 editor = [[wxNSTextFieldEditor alloc] init];
354 [editor setFieldEditor:YES];
355 [tf setFieldEditor:editor];
363 - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame
365 wxUnusedVar(newFrame);
366 wxNonOwnedWindowCocoaImpl* windowimpl = [window WX_implementation];
369 wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
370 wxMaximizeEvent event(wxpeer->GetId());
371 event.SetEventObject(wxpeer);
372 return !wxpeer->HandleWindowEvent(event);
379 IMPLEMENT_DYNAMIC_CLASS( wxNonOwnedWindowCocoaImpl , wxNonOwnedWindowImpl )
381 wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow* nonownedwnd) :
382 wxNonOwnedWindowImpl(nonownedwnd)
385 m_macFullScreenData = NULL;
388 wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl()
391 m_macFullScreenData = NULL;
394 wxNonOwnedWindowCocoaImpl::~wxNonOwnedWindowCocoaImpl()
396 if ( !m_wxPeer->IsNativeWindowWrapper() )
398 [m_macWindow setDelegate:nil];
399 [m_macWindow release];
403 void wxNonOwnedWindowCocoaImpl::WillBeDestroyed()
405 if ( !m_wxPeer->IsNativeWindowWrapper() )
407 [m_macWindow setDelegate:nil];
411 void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size,
412 long style, long extraStyle, const wxString& WXUNUSED(name) )
414 static wxNonOwnedWindowController* controller = NULL;
417 controller =[[wxNonOwnedWindowController alloc] init];
420 int windowstyle = NSBorderlessWindowMask;
422 if ( style & wxFRAME_TOOL_WINDOW || ( style & wxPOPUP_WINDOW ) ||
423 GetWXPeer()->GetExtraStyle() & wxTOPLEVEL_EX_DIALOG )
425 m_macWindow = [wxNSPanel alloc];
428 m_macWindow = [wxNSWindow alloc];
430 CGWindowLevel level = kCGNormalWindowLevel;
432 if ( style & wxFRAME_TOOL_WINDOW )
434 windowstyle |= NSUtilityWindowMask;
435 if ( ( style & wxMINIMIZE_BOX ) || ( style & wxMAXIMIZE_BOX ) ||
436 ( style & wxCLOSE_BOX ) || ( style & wxSYSTEM_MENU ) )
438 windowstyle |= NSTitledWindowMask ;
441 else if ( ( style & wxPOPUP_WINDOW ) )
443 level = kCGPopUpMenuWindowLevel;
445 if ( ( style & wxBORDER_NONE ) )
447 wclass = kHelpWindowClass ; // has no border
448 attr |= kWindowNoShadowAttribute;
452 wclass = kPlainWindowClass ; // has a single line border, it will have to do for now
456 else if ( ( style & wxCAPTION ) )
458 windowstyle |= NSTitledWindowMask ;
460 else if ( ( style & wxFRAME_DRAWER ) )
463 wclass = kDrawerWindowClass;
468 // set these even if we have no title, otherwise the controls won't be visible
469 if ( ( style & wxMINIMIZE_BOX ) || ( style & wxMAXIMIZE_BOX ) ||
470 ( style & wxCLOSE_BOX ) || ( style & wxSYSTEM_MENU ) )
472 windowstyle |= NSTitledWindowMask ;
475 else if ( ( style & wxNO_BORDER ) )
477 wclass = kSimpleWindowClass ;
481 wclass = kPlainWindowClass ;
486 if ( windowstyle & NSTitledWindowMask )
488 if ( ( style & wxMINIMIZE_BOX ) )
489 windowstyle |= NSMiniaturizableWindowMask ;
491 if ( ( style & wxMAXIMIZE_BOX ) )
492 windowstyle |= NSResizableWindowMask ; // TODO showing ZOOM ?
494 if ( ( style & wxRESIZE_BORDER ) )
495 windowstyle |= NSResizableWindowMask ;
497 if ( ( style & wxCLOSE_BOX) )
498 windowstyle |= NSClosableWindowMask ;
500 if ( extraStyle & wxFRAME_EX_METAL)
501 windowstyle |= NSTexturedBackgroundWindowMask;
503 if ( ( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW ) )
504 level = kCGFloatingWindowLevel;
506 if ( ( style & wxSTAY_ON_TOP ) )
507 level = kCGUtilityWindowLevel;
509 NSRect r = wxToNSRect( NULL, wxRect( pos, size) );
511 r = [NSWindow contentRectForFrameRect:r styleMask:windowstyle];
513 [m_macWindow initWithContentRect:r
514 styleMask:windowstyle
515 backing:NSBackingStoreBuffered
519 [m_macWindow setLevel:level];
521 [m_macWindow setDelegate:controller];
523 [m_macWindow setAcceptsMouseMovedEvents: YES];
525 if ( ( style & wxFRAME_SHAPED) )
527 [m_macWindow setOpaque:NO];
528 [m_macWindow setAlphaValue:1.0];
531 if ( !(style & wxFRAME_TOOL_WINDOW) )
532 [m_macWindow setHidesOnDeactivate:NO];
535 void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), WXWindow nativeWindow )
537 m_macWindow = nativeWindow;
540 WXWindow wxNonOwnedWindowCocoaImpl::GetWXWindow() const
545 void wxNonOwnedWindowCocoaImpl::Raise()
547 [m_macWindow orderWindow:NSWindowAbove relativeTo:0];
550 void wxNonOwnedWindowCocoaImpl::Lower()
552 [m_macWindow orderWindow:NSWindowBelow relativeTo:0];
555 void wxNonOwnedWindowCocoaImpl::ShowWithoutActivating()
557 [m_macWindow orderFront:nil];
558 [[m_macWindow contentView] setNeedsDisplay: YES];
561 bool wxNonOwnedWindowCocoaImpl::Show(bool show)
565 wxNonOwnedWindow* wxpeer = GetWXPeer();
566 if (wxpeer && !(wxpeer->GetWindowStyle() & wxFRAME_TOOL_WINDOW))
567 [m_macWindow makeKeyAndOrderFront:nil];
569 [m_macWindow orderFront:nil];
570 [[m_macWindow contentView] setNeedsDisplay: YES];
573 [m_macWindow orderOut:nil];
577 bool wxNonOwnedWindowCocoaImpl::ShowWithEffect(bool show,
581 return wxWidgetCocoaImpl::
582 ShowViewOrWindowWithEffect(m_wxPeer, show, effect, timeout);
585 void wxNonOwnedWindowCocoaImpl::Update()
587 [m_macWindow displayIfNeeded];
590 bool wxNonOwnedWindowCocoaImpl::SetTransparent(wxByte alpha)
592 [m_macWindow setAlphaValue:(CGFloat) alpha/255.0];
596 bool wxNonOwnedWindowCocoaImpl::SetBackgroundColour(const wxColour& WXUNUSED(col) )
601 void wxNonOwnedWindowCocoaImpl::SetExtraStyle( long exStyle )
605 bool metal = exStyle & wxFRAME_EX_METAL ;
606 int windowStyle = [ m_macWindow styleMask];
607 if ( metal && !(windowStyle & NSTexturedBackgroundWindowMask) )
609 wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
611 else if ( !metal && (windowStyle & NSTexturedBackgroundWindowMask ) )
613 wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
618 void wxNonOwnedWindowCocoaImpl::SetWindowStyleFlag( long style )
622 CGWindowLevel level = kCGNormalWindowLevel;
624 if (style & wxSTAY_ON_TOP)
625 level = kCGUtilityWindowLevel;
626 else if (( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW ))
627 level = kCGFloatingWindowLevel;
629 [m_macWindow setLevel: level];
633 bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle style)
635 if ( style == wxBG_STYLE_TRANSPARENT )
637 [m_macWindow setOpaque:NO];
638 [m_macWindow setBackgroundColor:[NSColor clearColor]];
644 bool wxNonOwnedWindowCocoaImpl::CanSetTransparent()
649 void wxNonOwnedWindowCocoaImpl::MoveWindow(int x, int y, int width, int height)
651 NSRect r = wxToNSRect( NULL, wxRect(x,y,width, height) );
652 // do not trigger refreshes upon invisible and possible partly created objects
653 [m_macWindow setFrame:r display:GetWXPeer()->IsShownOnScreen()];
656 void wxNonOwnedWindowCocoaImpl::GetPosition( int &x, int &y ) const
658 wxRect r = wxFromNSRect( NULL, [m_macWindow frame] );
663 void wxNonOwnedWindowCocoaImpl::GetSize( int &width, int &height ) const
665 NSRect rect = [m_macWindow frame];
666 width = (int)rect.size.width;
667 height = (int)rect.size.height;
670 void wxNonOwnedWindowCocoaImpl::GetContentArea( int& left, int &top, int &width, int &height ) const
672 NSRect outer = NSMakeRect(100,100,100,100);
673 NSRect content = [NSWindow contentRectForFrameRect:outer styleMask:[m_macWindow styleMask] ];
674 NSRect rect = [[m_macWindow contentView] frame];
675 left = (int)rect.origin.x;
676 top = (int)rect.origin.y;
677 width = (int)rect.size.width;
678 height = (int)rect.size.height;
681 bool wxNonOwnedWindowCocoaImpl::SetShape(const wxRegion& WXUNUSED(region))
683 [m_macWindow setOpaque:NO];
684 [m_macWindow setBackgroundColor:[NSColor clearColor]];
689 void wxNonOwnedWindowCocoaImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
691 [m_macWindow setTitle:wxCFStringRef( title , encoding ).AsNSString()];
694 bool wxNonOwnedWindowCocoaImpl::IsMaximized() const
696 if (([m_macWindow styleMask] & NSResizableWindowMask) != 0)
698 return [m_macWindow isZoomed];
702 NSRect rectScreen = [[NSScreen mainScreen] visibleFrame];
703 NSRect rectWindow = [m_macWindow frame];
704 return (rectScreen.origin.x == rectWindow.origin.x &&
705 rectScreen.origin.y == rectWindow.origin.y &&
706 rectScreen.size.width == rectWindow.size.width &&
707 rectScreen.size.height == rectWindow.size.height);
711 bool wxNonOwnedWindowCocoaImpl::IsIconized() const
713 return [m_macWindow isMiniaturized];
716 void wxNonOwnedWindowCocoaImpl::Iconize( bool iconize )
719 [m_macWindow miniaturize:nil];
721 [m_macWindow deminiaturize:nil];
724 void wxNonOwnedWindowCocoaImpl::Maximize(bool WXUNUSED(maximize))
726 [m_macWindow zoom:nil];
730 // http://cocoadevcentral.com/articles/000028.php
735 NSRect m_formerFrame;
738 bool wxNonOwnedWindowCocoaImpl::IsFullScreen() const
740 return m_macFullScreenData != NULL ;
743 bool wxNonOwnedWindowCocoaImpl::ShowFullScreen(bool show, long WXUNUSED(style))
747 FullScreenData *data = (FullScreenData *)m_macFullScreenData ;
749 data = new FullScreenData();
751 m_macFullScreenData = data ;
752 data->m_formerLevel = [m_macWindow level];
753 data->m_formerFrame = [m_macWindow frame];
754 CGDisplayCapture( kCGDirectMainDisplay );
755 [m_macWindow setLevel:CGShieldingWindowLevel()];
756 [m_macWindow setFrame:[[NSScreen mainScreen] frame] display:YES];
758 else if ( m_macFullScreenData != NULL )
760 FullScreenData *data = (FullScreenData *) m_macFullScreenData ;
761 CGDisplayRelease( kCGDirectMainDisplay );
762 [m_macWindow setLevel:data->m_formerLevel];
763 [m_macWindow setFrame:data->m_formerFrame display:YES];
765 m_macFullScreenData = NULL ;
771 void wxNonOwnedWindowCocoaImpl::RequestUserAttention(int flagsWX)
773 NSRequestUserAttentionType flagsOSX;
776 case wxUSER_ATTENTION_INFO:
777 flagsOSX = NSInformationalRequest;
780 case wxUSER_ATTENTION_ERROR:
781 flagsOSX = NSCriticalRequest;
785 wxFAIL_MSG( "invalid RequestUserAttention() flags" );
789 [NSApp requestUserAttention:flagsOSX];
792 void wxNonOwnedWindowCocoaImpl::ScreenToWindow( int *x, int *y )
794 wxPoint p((x ? *x : 0), (y ? *y : 0) );
795 NSPoint nspt = wxToNSPoint( NULL, p );
796 nspt = [m_macWindow convertScreenToBase:nspt];
797 nspt = [[m_macWindow contentView] convertPoint:nspt fromView:nil];
798 p = wxFromNSPoint([m_macWindow contentView], nspt);
805 void wxNonOwnedWindowCocoaImpl::WindowToScreen( int *x, int *y )
807 wxPoint p((x ? *x : 0), (y ? *y : 0) );
808 NSPoint nspt = wxToNSPoint( [m_macWindow contentView], p );
809 nspt = [[m_macWindow contentView] convertPoint:nspt toView:nil];
810 nspt = [m_macWindow convertBaseToScreen:nspt];
811 p = wxFromNSPoint( NULL, nspt);
818 bool wxNonOwnedWindowCocoaImpl::IsActive()
820 return [m_macWindow isKeyWindow];
823 void wxNonOwnedWindowCocoaImpl::SetModified(bool modified)
825 [m_macWindow setDocumentEdited:modified];
828 bool wxNonOwnedWindowCocoaImpl::IsModified() const
830 return [m_macWindow isDocumentEdited];
833 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, WXWindow nativeWindow)
835 wxNonOwnedWindowCocoaImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
836 now->Create( parent, nativeWindow );
840 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
841 long style, long extraStyle, const wxString& name )
843 wxNonOwnedWindowImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
844 now->Create( parent, pos, size, style , extraStyle, name );