// Author: Julian Smart
// Modified by:
// Created: 01/02/97
-// RCS-ID: $Id$
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
const ParamType2 m_param2;
};
+// This is a version for calling any functors
+template <typename T>
+class wxAsyncMethodCallEventFunctor : public wxAsyncMethodCallEvent
+{
+public:
+ typedef T FunctorType;
+
+ wxAsyncMethodCallEventFunctor(wxObject *object, const FunctorType& fn)
+ : wxAsyncMethodCallEvent(object),
+ m_fn(fn)
+ {
+ }
+
+ wxAsyncMethodCallEventFunctor(const wxAsyncMethodCallEventFunctor& other)
+ : wxAsyncMethodCallEvent(other),
+ m_fn(other.m_fn)
+ {
+ }
+
+ virtual wxEvent *Clone() const
+ {
+ return new wxAsyncMethodCallEventFunctor(*this);
+ }
+
+ virtual void Execute()
+ {
+ m_fn();
+ }
+
+private:
+ FunctorType m_fn;
+};
+
#endif // wxHAS_CALL_AFTER
static_cast<T*>(this), method, x1, x2)
);
}
+
+ template <typename T>
+ void CallAfter(const T& fn)
+ {
+ QueueEvent(new wxAsyncMethodCallEventFunctor<T>(this, fn));
+ }
#endif // wxHAS_CALL_AFTER