X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/65536c9221c62262cca9b76431bc1fdaf4886a3b..9914bfbb77f48baf869b63aff58feb2b145ff4d3:/src/osx/nonownedwnd_osx.cpp diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index bdc9be1d32..54ecb11f6d 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -159,12 +159,26 @@ wxNonOwnedWindow::~wxNonOwnedWindow() DestroyChildren(); delete m_nowpeer; + m_nowpeer = NULL; // avoid dangling refs if ( s_macDeactivateWindow == this ) s_macDeactivateWindow = NULL; } +bool wxNonOwnedWindow::Destroy() +{ + WillBeDestroyed(); + + return wxWindow::Destroy(); +} + +void wxNonOwnedWindow::WillBeDestroyed() +{ + if ( m_nowpeer ) + m_nowpeer->WillBeDestroyed(); +} + // ---------------------------------------------------------------------------- // wxNonOwnedWindow misc // ---------------------------------------------------------------------------- @@ -217,6 +231,17 @@ bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c ) return true; } +void wxNonOwnedWindow::SetWindowStyleFlag(long flags) +{ + if (flags == GetWindowStyleFlag()) + return; + + wxWindow::SetWindowStyleFlag(flags); + + if (m_nowpeer) + m_nowpeer->SetWindowStyleFlag(flags); +} + // Raise the window to the top of the Z order void wxNonOwnedWindow::Raise() { @@ -399,12 +424,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 ;