#include <FXFunctorTarget.h>
Inheritance diagram for FX::FXFunctorTarget:
When writing generic code, it's a pain to create FX::FXObject derived classes as these require static data meaning you must labouriously write FXIMPLEMENT()'s. For the simple case of invoking some arbitrary code when a button is pressed for example, instantiate one of these with the required functor and set as the messaging target.
No filtering of the messages is performed. All messages sent to this target are sent to the functor.
You may also wish to investigate the TnFOX enhancements to FX::FXDataTarget including FX::FXDataTargetI.
Definition at line 53 of file FXFunctorTarget.h.
Public Types | |
typedef Generic::Functor< Generic::TL::create< long, FXObject *, FXSelector, void * >::value > | MsgHandlerSpec |
ID_LAST | |
enum | { ID_LAST } |
Public Member Functions | |
virtual long | handle (FX::FXObject *sender, FX::FXSelector sel, void *ptr) |
virtual const FX::FXMetaClass * | getMetaClass () const |
FXFunctorTarget () | |
FXFunctorTarget (MsgHandlerSpec functor) | |
const MsgHandlerSpec & | functor () const |
void | setFunctor (MsgHandlerSpec functor) |
virtual long | onDefault (FXObject *, FXSelector, void *) |
const FXchar * | getClassName () const |
bool | isMemberOf (const FXMetaClass *metaclass) const |
virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
virtual void | save (FXStream &store) const |
virtual void | load (FXStream &store) |
QTransString | tr (const char *text, const char *hint=0) |
virtual void * | getPythonObject () const |
virtual void | decouplePythonObject () const |
Static Public Member Functions | |
static FX::FXObject * | manufacture () |
Static Public Attributes | |
static const FX::FXMetaClass | metaClass |