Send the wxWindowDestroyEvent for all ports
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -891,6 +891,9 @@ protected:
|
|||||||
void SatisfyConstraints();
|
void SatisfyConstraints();
|
||||||
#endif // wxUSE_CONSTRAINTS
|
#endif // wxUSE_CONSTRAINTS
|
||||||
|
|
||||||
|
// Send the wxWindowDestroyEvent
|
||||||
|
void SendDestroyEvent();
|
||||||
|
|
||||||
// the window id - a number which uniquely identifies a window among
|
// the window id - a number which uniquely identifies a window among
|
||||||
// its siblings unless it is -1
|
// its siblings unless it is -1
|
||||||
wxWindowID m_windowId;
|
wxWindowID m_windowId;
|
||||||
|
@@ -2078,6 +2078,15 @@ void wxWindowBase::ReleaseMouse()
|
|||||||
GetCapture());
|
GetCapture());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxWindowBase::SendDestroyEvent()
|
||||||
|
{
|
||||||
|
wxWindowDestroyEvent event;
|
||||||
|
event.SetEventObject(this);
|
||||||
|
event.SetId(GetId());
|
||||||
|
GetEventHandler()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// global functions
|
// global functions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -2275,21 +2275,6 @@ wxWindow *wxWindowBase::FindFocus()
|
|||||||
return (wxWindow *)g_focusWindow;
|
return (wxWindow *)g_focusWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// "destroy" event
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// VZ: Robert commented the code using out so it generates warnings: should
|
|
||||||
// be either fixed or removed completely
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
static void gtk_window_destroy_callback( GtkWidget* widget, wxWindow *win )
|
|
||||||
{
|
|
||||||
wxWindowDestroyEvent event(win);
|
|
||||||
win->GetEventHandler()->ProcessEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // 0
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// "realize" from m_widget
|
// "realize" from m_widget
|
||||||
@@ -2735,6 +2720,8 @@ bool wxWindowGTK::Create( wxWindow *parent,
|
|||||||
|
|
||||||
wxWindowGTK::~wxWindowGTK()
|
wxWindowGTK::~wxWindowGTK()
|
||||||
{
|
{
|
||||||
|
SendDestroyEvent();
|
||||||
|
|
||||||
if (g_focusWindow == this)
|
if (g_focusWindow == this)
|
||||||
g_focusWindow = NULL;
|
g_focusWindow = NULL;
|
||||||
|
|
||||||
@@ -2940,11 +2927,6 @@ void wxWindowGTK::ConnectWidget( GtkWidget *widget )
|
|||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
|
gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
|
||||||
|
|
||||||
// This keeps crashing on me. RR.
|
|
||||||
//
|
|
||||||
// gtk_signal_connect( GTK_OBJECT(widget), "destroy",
|
|
||||||
// GTK_SIGNAL_FUNC(gtk_window_destroy_callback), (gpointer)this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowGTK::Destroy()
|
bool wxWindowGTK::Destroy()
|
||||||
|
@@ -2275,21 +2275,6 @@ wxWindow *wxWindowBase::FindFocus()
|
|||||||
return (wxWindow *)g_focusWindow;
|
return (wxWindow *)g_focusWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// "destroy" event
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// VZ: Robert commented the code using out so it generates warnings: should
|
|
||||||
// be either fixed or removed completely
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
static void gtk_window_destroy_callback( GtkWidget* widget, wxWindow *win )
|
|
||||||
{
|
|
||||||
wxWindowDestroyEvent event(win);
|
|
||||||
win->GetEventHandler()->ProcessEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // 0
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// "realize" from m_widget
|
// "realize" from m_widget
|
||||||
@@ -2735,6 +2720,8 @@ bool wxWindowGTK::Create( wxWindow *parent,
|
|||||||
|
|
||||||
wxWindowGTK::~wxWindowGTK()
|
wxWindowGTK::~wxWindowGTK()
|
||||||
{
|
{
|
||||||
|
SendDestroyEvent();
|
||||||
|
|
||||||
if (g_focusWindow == this)
|
if (g_focusWindow == this)
|
||||||
g_focusWindow = NULL;
|
g_focusWindow = NULL;
|
||||||
|
|
||||||
@@ -2940,11 +2927,6 @@ void wxWindowGTK::ConnectWidget( GtkWidget *widget )
|
|||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
|
gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
|
||||||
|
|
||||||
// This keeps crashing on me. RR.
|
|
||||||
//
|
|
||||||
// gtk_signal_connect( GTK_OBJECT(widget), "destroy",
|
|
||||||
// GTK_SIGNAL_FUNC(gtk_window_destroy_callback), (gpointer)this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowGTK::Destroy()
|
bool wxWindowGTK::Destroy()
|
||||||
|
@@ -133,6 +133,8 @@ void wxWindowMac::Init()
|
|||||||
// Destructor
|
// Destructor
|
||||||
wxWindowMac::~wxWindowMac()
|
wxWindowMac::~wxWindowMac()
|
||||||
{
|
{
|
||||||
|
SendDestroyEvent();
|
||||||
|
|
||||||
// deleting a window while it is shown invalidates the region
|
// deleting a window while it is shown invalidates the region
|
||||||
if ( IsShown() ) {
|
if ( IsShown() ) {
|
||||||
wxWindowMac* iter = this ;
|
wxWindowMac* iter = this ;
|
||||||
|
@@ -133,6 +133,8 @@ void wxWindowMac::Init()
|
|||||||
// Destructor
|
// Destructor
|
||||||
wxWindowMac::~wxWindowMac()
|
wxWindowMac::~wxWindowMac()
|
||||||
{
|
{
|
||||||
|
SendDestroyEvent();
|
||||||
|
|
||||||
// deleting a window while it is shown invalidates the region
|
// deleting a window while it is shown invalidates the region
|
||||||
if ( IsShown() ) {
|
if ( IsShown() ) {
|
||||||
wxWindowMac* iter = this ;
|
wxWindowMac* iter = this ;
|
||||||
|
@@ -563,6 +563,8 @@ void wxWindowMGL::Init()
|
|||||||
// Destructor
|
// Destructor
|
||||||
wxWindowMGL::~wxWindowMGL()
|
wxWindowMGL::~wxWindowMGL()
|
||||||
{
|
{
|
||||||
|
SendDestroyEvent();
|
||||||
|
|
||||||
m_isBeingDeleted = TRUE;
|
m_isBeingDeleted = TRUE;
|
||||||
|
|
||||||
if ( gs_mouseCapture == this )
|
if ( gs_mouseCapture == this )
|
||||||
|
@@ -3325,8 +3325,7 @@ bool wxWindowMSW::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
|
|||||||
|
|
||||||
bool wxWindowMSW::HandleDestroy()
|
bool wxWindowMSW::HandleDestroy()
|
||||||
{
|
{
|
||||||
wxWindowDestroyEvent event((wxWindow *)this);
|
SendDestroyEvent();
|
||||||
(void)GetEventHandler()->ProcessEvent(event);
|
|
||||||
|
|
||||||
// delete our drop target if we've got one
|
// delete our drop target if we've got one
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
@@ -3513,9 +3513,7 @@ bool wxWindowOS2::HandleCreate(
|
|||||||
|
|
||||||
bool wxWindowOS2::HandleDestroy()
|
bool wxWindowOS2::HandleDestroy()
|
||||||
{
|
{
|
||||||
wxWindowDestroyEvent vEvent((wxWindow*)this);
|
SendDestroyEvent();
|
||||||
|
|
||||||
(void)GetEventHandler()->ProcessEvent(vEvent);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Delete our drop target if we've got one
|
// Delete our drop target if we've got one
|
||||||
|
@@ -341,6 +341,8 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
|
|||||||
// Destructor
|
// Destructor
|
||||||
wxWindowX11::~wxWindowX11()
|
wxWindowX11::~wxWindowX11()
|
||||||
{
|
{
|
||||||
|
SendDestroyEvent();
|
||||||
|
|
||||||
if (g_captureWindow == this)
|
if (g_captureWindow == this)
|
||||||
g_captureWindow = NULL;
|
g_captureWindow = NULL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user