X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..e538985edcc645878a1bbeb3dc3e898e9d29ad11:/src/osx/nonownedwnd_osx.cpp diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 59905b824f..ed53785787 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -13,6 +13,7 @@ #ifndef WX_PRECOMP #include "wx/app.h" + #include "wx/log.h" #endif // WX_PRECOMP #include "wx/hashmap.h" @@ -151,7 +152,7 @@ bool wxNonOwnedWindow::Create(wxWindow *parent, wxNonOwnedWindow::~wxNonOwnedWindow() { - m_isBeingDeleted = true; + SendDestroyEvent(); wxRemoveWXWindowAssociation( this ) ; @@ -244,7 +245,7 @@ void wxNonOwnedWindow::HandleResized( double timestampsec ) wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified } -void wxNonOwnedWindow::HandleResizing( double timestampsec, wxRect* rect ) +void wxNonOwnedWindow::HandleResizing( double WXUNUSED(timestampsec), wxRect* rect ) { wxRect r = *rect ; @@ -350,6 +351,9 @@ bool wxNonOwnedWindow::SetBackgroundStyle(wxBackgroundStyle style) void wxNonOwnedWindow::DoMoveWindow(int x, int y, int width, int height) { + if ( m_nowpeer == NULL ) + return; + m_cachedClippedRectValid = false ; m_nowpeer->MoveWindow(x, y, width, height); @@ -358,6 +362,9 @@ void wxNonOwnedWindow::DoMoveWindow(int x, int y, int width, int height) void wxNonOwnedWindow::DoGetPosition( int *x, int *y ) const { + if ( m_nowpeer == NULL ) + return; + int x1,y1 ; m_nowpeer->GetPosition(x1, y1); @@ -369,6 +376,9 @@ void wxNonOwnedWindow::DoGetPosition( int *x, int *y ) const void wxNonOwnedWindow::DoGetSize( int *width, int *height ) const { + if ( m_nowpeer == NULL ) + return; + int w,h; m_nowpeer->GetSize(w, h); @@ -381,6 +391,9 @@ void wxNonOwnedWindow::DoGetSize( int *width, int *height ) const void wxNonOwnedWindow::DoGetClientSize( int *width, int *height ) const { + if ( m_nowpeer == NULL ) + return; + int left, top, w, h; m_nowpeer->GetContentArea(left, top, w, h); @@ -406,7 +419,7 @@ WXWindow wxNonOwnedWindow::GetWXWindow() const // --------------------------------------------------------------------------- -bool wxNonOwnedWindow::SetShape(const wxRegion& region) +bool wxNonOwnedWindow::DoSetShape(const wxRegion& region) { wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); @@ -420,7 +433,7 @@ bool wxNonOwnedWindow::SetShape(const wxRegion& region) if ( rgn.IsEmpty() ) return false ; else - return SetShape(rgn); + return DoSetShape(rgn); } return m_nowpeer->SetShape(region);