X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e45d90901d75b511a851f94306f171fefb06e493..c1431e59e3db4c224c88078130b479eb673fa7d3:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index f052255bed..0c074e6bae 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1707,6 +1707,15 @@ public: // Get Y position wxCoord GetY() const { return m_y; } + // Can be called from wxEVT_CHAR_HOOK handler to allow generation of normal + // key events even though the event had been handled (by default they would + // not be generated in this case). + void DoAllowNextEvent() { m_allowNext = true; } + + // Return the value of the "allow next" flag, for internal use only. + bool IsNextEventAllowed() const { return m_allowNext; } + + virtual wxEvent *Clone() const { return new wxKeyEvent(*this); } virtual wxEventCategory GetEventCategory() const { return wxEVT_CATEGORY_USER_INPUT; } @@ -1744,6 +1753,16 @@ public: wxUint32 m_rawFlags; private: + // Set the event to propagate if necessary, i.e. if it's of wxEVT_CHAR_HOOK + // type. This is used by all ctors. + void InitPropagation() + { + if ( m_eventType == wxEVT_CHAR_HOOK ) + m_propagationLevel = wxEVENT_PROPAGATE_MAX; + + m_allowNext = false; + } + // Copy only the event data present in this class, this is used by // AssignKeyData() and copy ctor. void DoAssignMembers(const wxKeyEvent& evt) @@ -1760,6 +1779,11 @@ private: #endif } + // If this flag is true, the normal key events should still be generated + // even if wxEVT_CHAR_HOOK had been handled. By default it is false as + // handling wxEVT_CHAR_HOOK suppresses all the subsequent events. + bool m_allowNext; + DECLARE_DYNAMIC_CLASS(wxKeyEvent) }; @@ -3325,7 +3349,7 @@ protected: // base class implementation passes the event to wxTheApp virtual bool TryAfter(wxEvent& event); -#ifdef WXWIN_COMPATIBILITY_2_8 +#if WXWIN_COMPATIBILITY_2_8 // deprecated method: override TryBefore() instead of this one wxDEPRECATED_BUT_USED_INTERNALLY_INLINE( virtual bool TryValidator(wxEvent& WXUNUSED(event)), return false; )