X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bb90a3e6fddff7169d6020b9b22e1f57c09f8fd9..0ae9003c21ed99486e7655d1cfade2e8ee4c2dd0:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index a22b1b0407..c254930217 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -31,6 +31,7 @@ #include "wx/app.h" #include "wx/utils.h" #include "wx/stopwatch.h" + #include "wx/module.h" #if wxUSE_GUI #include "wx/control.h" @@ -40,8 +41,6 @@ #endif // wxUSE_GUI #endif -#include "wx/module.h" - // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- @@ -87,6 +86,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxHelpEvent, wxCommandEvent) IMPLEMENT_DYNAMIC_CLASS(wxContextMenuEvent, wxCommandEvent) IMPLEMENT_DYNAMIC_CLASS(wxMouseCaptureChangedEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxMouseCaptureLostEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxClipboardTextEvent, wxCommandEvent) #endif // wxUSE_GUI @@ -260,6 +260,7 @@ DEFINE_EVENT_TYPE(wxEVT_SHOW) DEFINE_EVENT_TYPE(wxEVT_ICONIZE) DEFINE_EVENT_TYPE(wxEVT_MAXIMIZE) DEFINE_EVENT_TYPE(wxEVT_MOUSE_CAPTURE_CHANGED) +DEFINE_EVENT_TYPE(wxEVT_MOUSE_CAPTURE_LOST) DEFINE_EVENT_TYPE(wxEVT_PAINT) DEFINE_EVENT_TYPE(wxEVT_ERASE_BACKGROUND) DEFINE_EVENT_TYPE(wxEVT_NC_PAINT) @@ -1010,6 +1011,7 @@ wxEvtHandler::wxEvtHandler() m_eventsLocker = new wxCriticalSection; # endif #endif + // no client data (yet) m_clientData = NULL; m_clientDataType = wxClientData_None; @@ -1130,11 +1132,11 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) void wxEvtHandler::ProcessPendingEvents() { - // this method is only called by wxApp if this handler does have pending - // events + // this method is only called by wxApp if this handler does have + // pending events wxCHECK_RET( m_pendingEvents, wxT("Please call wxApp::ProcessPendingEvents() instead") ); - + wxENTER_CRIT_SECT( Lock() ); // we leave the loop once we have processed all events that were present at @@ -1151,11 +1153,13 @@ void wxEvtHandler::ProcessPendingEvents() // It's importan we remove event from list before processing it. // Else a nested event loop, for example from a modal dialog, might // process the same event again. + m_pendingEvents->Erase(node); wxLEAVE_CRIT_SECT( Lock() ); ProcessEvent(*event); + delete event; wxENTER_CRIT_SECT( Lock() );