X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bb90a3e6fddff7169d6020b9b22e1f57c09f8fd9..ce7208d49d5ce2ca1dc0b3b83f14f1d04f29c4bf:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index a22b1b0407..df764235ac 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,10 @@ wxEvtHandler::wxEvtHandler() m_eventsLocker = new wxCriticalSection; # endif #endif + // reentrace not allowed by default + m_reentranceAllowed = false; + m_eventHandlingInProgress = false; + // no client data (yet) m_clientData = NULL; m_clientDataType = wxClientData_None; @@ -1130,10 +1135,13 @@ 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") ); + + // eventhandling is now in progess + m_eventHandlingInProgress = true; wxENTER_CRIT_SECT( Lock() ); @@ -1151,11 +1159,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() ); @@ -1165,6 +1175,9 @@ void wxEvtHandler::ProcessPendingEvents() } wxLEAVE_CRIT_SECT( Lock() ); + + // eventhandling no longer in progess + m_eventHandlingInProgress = false; } /*