X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3e89999c1a31a2328ed50e39376f4a1d6be628dd..a290fa5a7deebe9d96c0c0089d18e27d4bd9b624:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 44215d1ffc..8492fd3ec0 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -338,7 +338,7 @@ int wxNewEventType() // ---------------------------------------------------------------------------- /* - * General wxWindows events, covering + * General wxWidgets events, covering * all interesting things that might happen (button clicking, resizing, * setting text in widgets, etc.). * @@ -417,23 +417,23 @@ bool wxUpdateUIEvent::CanUpdate(wxWindowBase *win) if (sm_updateInterval == -1) return false; - else if (sm_updateInterval == 0) + + if (sm_updateInterval == 0) return true; - else - { + #if wxUSE_STOPWATCH && wxUSE_LONGLONG - wxLongLong now = wxGetLocalTimeMillis(); - if (now > (sm_lastUpdate + sm_updateInterval)) - { - return true; - } -#else - // If we don't have wxStopWatch or wxLongLong, we - // should err on the safe side and update now anyway. + wxLongLong now = wxGetLocalTimeMillis(); + if (now > (sm_lastUpdate + sm_updateInterval)) + { return true; -#endif } + return false; +#else + // If we don't have wxStopWatch or wxLongLong, we + // should err on the safe side and update now anyway. + return true; +#endif } // Reset the update time to provide a delay until the next @@ -562,8 +562,6 @@ bool wxMouseEvent::ButtonDClick(int but) const case wxMOUSE_BTN_RIGHT: return RightDClick(); } - - return false; } // return true if was a button down event @@ -587,8 +585,6 @@ bool wxMouseEvent::ButtonDown(int but) const case wxMOUSE_BTN_RIGHT: return RightDown(); } - - return false; } // return true if was a button up event @@ -612,8 +608,6 @@ bool wxMouseEvent::ButtonUp(int but) const case wxMOUSE_BTN_RIGHT: return RightUp(); } - - return false; } // return true if the given button is currently changing state @@ -639,8 +633,6 @@ bool wxMouseEvent::Button(int but) const case wxMOUSE_BTN_RIGHT: return RightDown() || RightUp() || RightDClick(); } - - return false; } bool wxMouseEvent::ButtonIsDown(int but) const @@ -663,8 +655,6 @@ bool wxMouseEvent::ButtonIsDown(int but) const case wxMOUSE_BTN_RIGHT: return RightIsDown(); } - - return false; } int wxMouseEvent::GetButton() const @@ -1105,6 +1095,11 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) void wxEvtHandler::ProcessPendingEvents() { + // this method is only called by wxApp if this handler does have pending + // events + wxCHECK_RET( m_pendingEvents, + wxT("Please call wxApp::ProcessPendingEvents() instead") ); + #if defined(__VISAGECPP__) wxENTER_CRIT_SECT( m_eventsLocker); #else @@ -1340,7 +1335,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData(); #endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES - if ((event.m_eventType == entry->m_eventType) && entry->m_fn) + if ((event.m_eventType == entry->m_eventType) && (entry->m_fn != 0)) { wxEvtHandler *handler = #if !WXWIN_COMPATIBILITY_EVENT_TYPES