: 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
{
// 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
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