Logo ROOT   6.18/05
Reference Guide
TGEventHandler.h
Go to the documentation of this file.
1// @(#)root/gui:$Id: TGEventHandler.h
2// Author: Bertrand Bellenot 29/01/2008
3
4/*************************************************************************
5 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGEventHandler
13#define ROOT_TGEventHandler
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TGEventHandler //
18// //
19//////////////////////////////////////////////////////////////////////////
20
21#include "TNamed.h"
22#include "TQObject.h"
23#include "GuiTypes.h"
24
25class TGWindow;
26
27class TGEventHandler : public TNamed, public TQObject {
28
29private:
30
31 TGEventHandler(const TGEventHandler&); // Not implemented
32 TGEventHandler& operator=(const TGEventHandler&); // Not implemented
33
34 Bool_t fIsActive; // kTRUE if handler is active, kFALSE if not active
37
38 void *GetSender() { return this; } //used to set gTQSender
39
40public:
41 TGEventHandler(const char *name, TGWindow *w, TObject *obj, const char *title="") :
42 TNamed(name, title), fIsActive(kTRUE), fWindow(w), fObject(obj) { };
43 virtual ~TGEventHandler() { }
44
45 void Activate() { fIsActive = kTRUE; }
47 Bool_t IsActive() const { return fIsActive; }
48 virtual Bool_t HandleEvent(Event_t *ev);
50 virtual Bool_t HandleButton(Event_t *) { return kFALSE; }
51 virtual Bool_t HandleDoubleClick(Event_t *) { return kFALSE; }
52 virtual Bool_t HandleCrossing(Event_t *) { return kFALSE; }
53 virtual Bool_t HandleMotion(Event_t *) { return kFALSE; }
54 virtual Bool_t HandleKey(Event_t *) { return kFALSE; }
55 virtual Bool_t HandleFocusChange(Event_t *) { return kFALSE; }
56 virtual Bool_t HandleSelection(Event_t *) { return kFALSE; }
60 virtual void ProcessedEvent(Event_t *event)
61 { Emit("ProcessedEvent(Event_t*)", (Long_t)event); } //*SIGNAL*
62
63 virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2);
65 virtual void Repaint() { }
66
67 ClassDef(TGEventHandler,0) // Abstract event handler
68};
69
70#endif
71
const Bool_t kFALSE
Definition: RtypesCore.h:88
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
virtual Bool_t HandleSelection(Event_t *)
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
virtual Bool_t HandleKey(Event_t *)
virtual Bool_t HandleMotion(Event_t *)
virtual void ProcessedEvent(Event_t *event)
Bool_t IsActive() const
virtual ~TGEventHandler()
virtual Bool_t HandleEvent(Event_t *ev)
Handle the event.
virtual Bool_t ProcessMessage(Long_t, Long_t, Long_t)
virtual Bool_t HandleColormapChange(Event_t *)
virtual Bool_t HandleCrossing(Event_t *)
virtual Bool_t HandleButton(Event_t *)
virtual Bool_t HandleSelectionRequest(Event_t *)
virtual Bool_t HandleSelectionClear(Event_t *)
virtual void Repaint()
TGEventHandler(const char *name, TGWindow *w, TObject *obj, const char *title="")
TGEventHandler & operator=(const TGEventHandler &)
void * GetSender()
virtual Bool_t HandleConfigureNotify(Event_t *)
TObject * fObject
virtual Bool_t HandleDoubleClick(Event_t *)
virtual Bool_t HandleFocusChange(Event_t *)
TGEventHandler(const TGEventHandler &)
TGWindow * fWindow
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition: TQObject.h:48
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164