X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/caf12a79179d1b6e2870d1850d34072192c61047..6af984df34c71bc14648a7b5bf1ad3c3cd07fc05:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index c1a2440e9e..0b196d5d72 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -25,6 +25,7 @@ #endif #include "wx/event.h" +#include "wx/evtloop.h" #ifndef WX_PRECOMP #include "wx/list.h" @@ -518,17 +519,23 @@ wxScrollWinEvent::wxScrollWinEvent(wxEventType commandType, wxMouseEvent::wxMouseEvent(wxEventType commandType) { m_eventType = commandType; - m_metaDown = false; - m_altDown = false; - m_controlDown = false; - m_shiftDown = false; + + m_x = 0; + m_y = 0; + m_leftDown = false; - m_rightDown = false; m_middleDown = false; + m_rightDown = false; m_aux1Down = false; m_aux2Down = false; - m_x = 0; - m_y = 0; + + m_controlDown = false; + m_shiftDown = false; + m_altDown = false; + m_metaDown = false; + + m_clickCount = -1; + m_wheelRotation = 0; m_wheelDelta = 0; m_linesPerAction = 0; @@ -1308,6 +1315,42 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) return TryParent(event); } +bool wxEvtHandler::SafelyProcessEvent(wxEvent& event) +{ +#if wxUSE_EXCEPTIONS + try + { +#endif + return ProcessEvent(event); +#if wxUSE_EXCEPTIONS + } + catch ( ... ) + { + wxEventLoopBase *loop = wxEventLoopBase::GetActive(); + try + { + if ( !wxTheApp || !wxTheApp->OnExceptionInMainLoop() ) + { + if ( loop ) + loop->Exit(); + } + //else: continue running current event loop + + return false; + } + catch ( ... ) + { + // OnExceptionInMainLoop() threw, possibly rethrowing the same + // exception again: very good, but we still need Exit() to + // be called + if ( loop ) + loop->Exit(); + throw; + } + } +#endif // wxUSE_EXCEPTIONS +} + bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event) {