X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0e9a5dfdeebc1d5e2d7e6e2146e63a26c8645a1..e9e8b38179b147dd04f5c19af7e56a94342e93a7:/include/wx/event.h?ds=inline diff --git a/include/wx/event.h b/include/wx/event.h index 959796dbea..dae8470ac9 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 { @@ -1696,6 +1691,7 @@ public: { m_eventType = wxEVT_SIZING; m_id = id; } wxSize GetSize() const { return m_size; } + void SetSize(wxSize size) { m_size = size; } wxRect GetRect() const { return m_rect; } void SetRect(const wxRect& rect) { m_rect = rect; } @@ -3253,11 +3249,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 +3335,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