X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b107e8d5786afd67550dde069513c80057424f91..e319bb30f7e88242f56144fcc279b57047566a6b:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index b270601e5e..c254930217 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -30,23 +30,17 @@ #include "wx/list.h" #include "wx/app.h" #include "wx/utils.h" + #include "wx/stopwatch.h" + #include "wx/module.h" #if wxUSE_GUI #include "wx/control.h" #include "wx/dc.h" #include "wx/textctrl.h" + #include "wx/validate.h" #endif // wxUSE_GUI #endif -#include "wx/module.h" - -#if wxUSE_GUI - #include "wx/validate.h" -#if wxUSE_STOPWATCH - #include "wx/stopwatch.h" -#endif -#endif // wxUSE_GUI - // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- @@ -92,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 @@ -265,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) @@ -1015,6 +1011,7 @@ wxEvtHandler::wxEvtHandler() m_eventsLocker = new wxCriticalSection; # endif #endif + // no client data (yet) m_clientData = NULL; m_clientDataType = wxClientData_None; @@ -1135,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 @@ -1156,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() );