X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2758e21753c00b8e36f11c003fd6cd0e5137391..cdc48273b49b0b90d9587a1ecc5935d38a160620:/src/osx/nonownedwnd_osx.cpp diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 017107215f..741b646877 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -98,6 +98,7 @@ wxNonOwnedWindow *wxNonOwnedWindow::s_macDeactivateWindow = NULL; void wxNonOwnedWindow::Init() { m_nowpeer = NULL; + m_isNativeWindowWrapper = false; } bool wxNonOwnedWindow::Create(wxWindow *parent, @@ -107,9 +108,6 @@ bool wxNonOwnedWindow::Create(wxWindow *parent, long style, const wxString& name) { - // init our fields - Init(); - m_windowStyle = style; SetName( name ); @@ -150,6 +148,19 @@ bool wxNonOwnedWindow::Create(wxWindow *parent, return true; } +bool wxNonOwnedWindow::Create(wxWindow *parent, WXWindow nativeWindow) +{ + m_nowpeer = wxNonOwnedWindowImpl::CreateNonOwnedWindow(this, parent, nativeWindow ); + m_isNativeWindowWrapper = true; + wxAssociateWindowWithWXWindow( m_nowpeer->GetWXWindow() , this ) ; + m_peer = wxWidgetImpl::CreateContentView(this); + + if ( parent ) + parent->AddChild(this); + + return true; +} + wxNonOwnedWindow::~wxNonOwnedWindow() { SendDestroyEvent(); @@ -424,12 +435,7 @@ void wxNonOwnedWindow::DoGetClientSize( int *width, int *height ) const return; int left, top, w, h; - // perhaps we should do this for all ? -#ifdef __WXOSX_IPHONE__ - m_peer->GetContentArea(left, top, w, h); -#else m_nowpeer->GetContentArea(left, top, w, h); -#endif if (width) *width = w ; @@ -458,6 +464,8 @@ bool wxNonOwnedWindow::DoSetShape(const wxRegion& region) wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); + m_shape = region; + // The empty region signifies that the shape // should be removed from the window. if ( region.IsEmpty() )