X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5a98acdf25b3d2eae7858d30ac29f629d589703..6a89f9ee4212a2268df1a7ed97145944e937fa0f:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 083e52a709..414390d351 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "event.h" #endif @@ -304,16 +304,6 @@ int wxNewEventType() // MT-FIXME static int s_lastUsedEventType = wxEVT_FIRST; -#if WXWIN_COMPATIBILITY_2 - // check that we don't overlap with the user-defined types: if it does - // happen, the best solution is probably to update the existing code to - // use wxNewEventType() instead of wxEVT_USER_FIRST - // - // due to the uncertainty - wxASSERT_MSG( s_lastUsedEventType < wxEVT_USER_FIRST - 1, - _T("possible event type conflict") ); -#endif // WXWIN_COMPATIBILITY_2 - return s_lastUsedEventType++; } @@ -339,6 +329,7 @@ wxEvent::wxEvent(int theId, wxEventType commandType ) m_skipped = FALSE; m_callbackUserData = (wxObject *) NULL; m_isCommandEvent = FALSE; + m_propagationLevel = wxEVENT_PROPAGATE_NONE; } wxEvent::wxEvent(const wxEvent &src) @@ -348,6 +339,7 @@ wxEvent::wxEvent(const wxEvent &src) , m_timeStamp(src.m_timeStamp) , m_id(src.m_id) , m_callbackUserData(src.m_callbackUserData) + , m_propagationLevel(src.m_propagationLevel) , m_skipped(src.m_skipped) , m_isCommandEvent(src.m_isCommandEvent) { @@ -370,6 +362,9 @@ wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId) m_extraLong = 0; m_commandInt = 0; m_isCommandEvent = TRUE; + + // the command events are propagated upwards by default + m_propagationLevel = wxEVENT_PROPAGATE_MAX; } /* @@ -385,7 +380,7 @@ long wxUpdateUIEvent::sm_updateInterval = 0; wxUpdateUIMode wxUpdateUIEvent::sm_updateMode = wxUPDATE_UI_PROCESS_ALL; // Can we update? -bool wxUpdateUIEvent::CanUpdate(wxWindow* win) +bool wxUpdateUIEvent::CanUpdate(wxWindowBase *win) { // Don't update if we've switched global updating off // and this window doesn't support updates. @@ -708,6 +703,9 @@ wxChildFocusEvent::wxChildFocusEvent(wxWindow *win) #endif // wxUSE_GUI + +#if wxUSE_BASE + // ---------------------------------------------------------------------------- // wxEventHashTable // ---------------------------------------------------------------------------- @@ -888,8 +886,6 @@ void wxEventHashTable::GrowEventTypeTable() // wxEvtHandler // ---------------------------------------------------------------------------- -#if wxUSE_BASE - /* * Event handler */ @@ -1101,10 +1097,8 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) { // if we have a validator, it has higher priority than our own event // table -#if wxUSE_VALIDATORS if ( TryValidator(event) ) return TRUE; -#endif // wxUSE_VALIDATORS // Handle per-instance dynamic event tables first if ( m_dynamicEvents && SearchDynamicEventTable(event) ) @@ -1317,17 +1311,6 @@ void *wxEvtHandler::DoGetClientData() const return m_clientData; } - -#if WXWIN_COMPATIBILITY -bool wxEvtHandler::OnClose() -{ - if (GetNextHandler()) - return GetNextHandler()->OnClose(); - else - return FALSE; -} -#endif // WXWIN_COMPATIBILITY - #endif // wxUSE_BASE #if wxUSE_GUI