X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0e9a5dfdeebc1d5e2d7e6e2146e63a26c8645a1..53cdd2c11d11b6286936b93158b157610b169edd:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index 959796dbea..4aa6e97a94 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -215,12 +215,7 @@ public: : m_handler( handler ), m_method( method ) { } - virtual void operator()(wxEvtHandler *handler, wxEvent& event) - { - wxEvtHandler * const realHandler = m_handler ? m_handler : handler; - - (realHandler->*m_method)(event); - } + virtual void operator()(wxEvtHandler *handler, wxEvent& event); virtual bool IsMatching(const wxEventFunctor& functor) const { @@ -3253,11 +3248,19 @@ protected: // validators. virtual bool TryBefore(wxEvent& event); - // this one is not a hook but just a helper which looks up the handler in - // this object itself called from ProcessEventLocally() and normally - // shouldn't be called directly as doing it would ignore any chained event - // handlers - bool TryHere(wxEvent& event); + // This one is not a hook but just a helper which looks up the handler in + // this object itself. + // + // It is called from ProcessEventLocally() and normally shouldn't be called + // directly as doing it would ignore any chained event handlers + bool TryHereOnly(wxEvent& event); + + // Another helper which simply calls pre-processing hook and then tries to + // handle the event at this handler level. + bool TryBeforeAndHere(wxEvent& event) + { + return TryBefore(event) || TryHereOnly(event); + } // this one is called after failing to find the event handle in our own // table to give a chance to the other windows to process it @@ -3331,6 +3334,17 @@ private: WX_DEFINE_ARRAY_WITH_DECL_PTR(wxEvtHandler *, wxEvtHandlerArray, class WXDLLIMPEXP_BASE); + +// Define an inline method of wxObjectEventFunctor which couldn't be defined +// before wxEvtHandler declaration: at least Sun CC refuses to compile function +// calls through pointer to member for forward-declared classes (see #12452). +inline void wxObjectEventFunctor::operator()(wxEvtHandler *handler, wxEvent& event) +{ + wxEvtHandler * const realHandler = m_handler ? m_handler : handler; + + (realHandler->*m_method)(event); +} + // ---------------------------------------------------------------------------- // wxEventConnectionRef represents all connections between two event handlers // and enables automatic disconnect when an event handler sink goes out of