#ifndef ROOT_TGEventHandler
#define ROOT_TGEventHandler
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TQObject
#include "TQObject.h"
#endif
#ifndef ROOT_GuiTypes
#include "GuiTypes.h"
#endif
class TGWindow;
class TGEventHandler : public TNamed, public TQObject {
private:
TGEventHandler(const TGEventHandler&);
TGEventHandler& operator=(const TGEventHandler&);
Bool_t fIsActive;
TGWindow *fWindow;
TObject *fObject;
void *GetSender() { return this; }
public:
TGEventHandler(const char *name, TGWindow *w, TObject *obj, const char *title="") :
TNamed(name, title), fIsActive(kTRUE), fWindow(w), fObject(obj) { };
virtual ~TGEventHandler() { }
void Activate() { fIsActive = kTRUE; }
void DeActivate() { fIsActive = kFALSE; }
Bool_t IsActive() const { return fIsActive; }
virtual Bool_t HandleEvent(Event_t *ev);
virtual Bool_t HandleConfigureNotify(Event_t *) { return kFALSE; }
virtual Bool_t HandleButton(Event_t *) { return kFALSE; }
virtual Bool_t HandleDoubleClick(Event_t *) { return kFALSE; }
virtual Bool_t HandleCrossing(Event_t *) { return kFALSE; }
virtual Bool_t HandleMotion(Event_t *) { return kFALSE; }
virtual Bool_t HandleKey(Event_t *) { return kFALSE; }
virtual Bool_t HandleFocusChange(Event_t *) { return kFALSE; }
virtual Bool_t HandleSelection(Event_t *) { return kFALSE; }
virtual Bool_t HandleSelectionRequest(Event_t *) { return kFALSE; }
virtual Bool_t HandleSelectionClear(Event_t *) { return kFALSE; }
virtual Bool_t HandleColormapChange(Event_t *) { return kFALSE; }
virtual void ProcessedEvent(Event_t *event)
{ Emit("ProcessedEvent(Event_t*)", (Long_t)event); }
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2);
virtual Bool_t ProcessMessage(Long_t, Long_t, Long_t) { return kFALSE; }
virtual void Repaint() { }
ClassDef(TGEventHandler,0)
};
#endif