git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62985
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxNonOwnedWindowCarbonImpl();
virtual ~wxNonOwnedWindowCarbonImpl();
wxNonOwnedWindowCarbonImpl();
virtual ~wxNonOwnedWindowCarbonImpl();
- virtual void Destroy() ;
+ virtual void WillBeDestroyed() ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
virtual ~wxNonOwnedWindowCocoaImpl();
virtual ~wxNonOwnedWindowCocoaImpl();
- virtual void Destroy() ;
+ virtual void WillBeDestroyed() ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
+ virtual void WillBeDestroyed()
virtual ~wxNonOwnedWindowIPhoneImpl();
virtual ~wxNonOwnedWindowIPhoneImpl();
- virtual void Destroy() ;
+ virtual void WillBeDestroyed() ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
virtual bool OSXShowWithEffect(bool show,
wxShowEffect effect,
unsigned timeout);
virtual bool OSXShowWithEffect(bool show,
wxShowEffect effect,
unsigned timeout);
+
+ void OnWindowDestroy( wxWindowDestroyEvent &event);
wxNonOwnedWindowImpl* m_nowpeer ;
wxNonOwnedWindowImpl* m_nowpeer ;
-void wxNonOwnedWindowCarbonImpl::Destroy()
+void wxNonOwnedWindowCarbonImpl::WillBeDestroyed()
{
if ( m_macEventHandler )
{
::RemoveEventHandler((EventHandlerRef) m_macEventHandler);
m_macEventHandler = NULL ;
}
{
if ( m_macEventHandler )
{
::RemoveEventHandler((EventHandlerRef) m_macEventHandler);
m_macEventHandler = NULL ;
}
-
- wxPendingDelete.Append( new wxDeferredObjectDeleter( this ) ) ;
}
void wxNonOwnedWindowInstallTopLevelWindowEventHandler(WindowRef window, EventHandlerRef* handler, void *ref)
}
void wxNonOwnedWindowInstallTopLevelWindowEventHandler(WindowRef window, EventHandlerRef* handler, void *ref)
-void wxNonOwnedWindowCocoaImpl::Destroy()
+void wxNonOwnedWindowCocoaImpl::WillBeDestroyed()
- wxPendingDelete.Append( new wxDeferredObjectDeleter( this ) );
+ [m_macWindow setDelegate:nil];
}
void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size,
}
void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size,
-void wxNonOwnedWindowIPhoneImpl::Destroy()
+void wxNonOwnedWindowIPhoneImpl::WillBeDestroyed()
- wxPendingDelete.Append( new wxDeferredObjectDeleter( this ) );
}
void wxNonOwnedWindowIPhoneImpl::Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
}
void wxNonOwnedWindowIPhoneImpl::Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
if ( parent )
parent->AddChild(this);
if ( parent )
parent->AddChild(this);
+ wxBIND_OR_CONNECT_HACK(this, wxEVT_DESTROY, wxWindowDestroyEventHandler,
+ wxNonOwnedWindow::OnWindowDestroy, this);
+
DestroyChildren();
delete m_nowpeer;
DestroyChildren();
delete m_nowpeer;
// avoid dangling refs
if ( s_macDeactivateWindow == this )
s_macDeactivateWindow = NULL;
}
// avoid dangling refs
if ( s_macDeactivateWindow == this )
s_macDeactivateWindow = NULL;
}
+void wxNonOwnedWindow::OnWindowDestroy( wxWindowDestroyEvent &event)
+{
+ event.Skip();
+
+ if ( m_nowpeer )
+ m_nowpeer->WillBeDestroyed();
+}
+
// ----------------------------------------------------------------------------
// wxNonOwnedWindow misc
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxNonOwnedWindow misc
// ----------------------------------------------------------------------------