Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGEventHandler.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gui:$Id: TGEventHandler.h
0002 // Author: Bertrand Bellenot   29/01/2008
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGEventHandler
0013 #define ROOT_TGEventHandler
0014 
0015 
0016 #include "TNamed.h"
0017 #include "TQObject.h"
0018 #include "GuiTypes.h"
0019 
0020 class TGWindow;
0021 
0022 class TGEventHandler : public TNamed, public TQObject {
0023 
0024 private:
0025 
0026    TGEventHandler(const TGEventHandler&) = delete;
0027    TGEventHandler& operator=(const TGEventHandler&) = delete;
0028 
0029    Bool_t   fIsActive;    ///< kTRUE if handler is active, kFALSE if not active
0030    TGWindow *fWindow;
0031    TObject  *fObject;
0032 
0033    void  *GetSender() override { return this; }  //used to set gTQSender
0034 
0035 public:
0036    TGEventHandler(const char *name, TGWindow *w, TObject *obj, const char *title="") :
0037       TNamed(name, title), fIsActive(kTRUE), fWindow(w), fObject(obj) { }
0038    ~TGEventHandler() override { }
0039 
0040    void           Activate() { fIsActive = kTRUE; }
0041    void           DeActivate() { fIsActive = kFALSE; }
0042    Bool_t         IsActive() const { return fIsActive; }
0043    virtual Bool_t HandleEvent(Event_t *ev);
0044    virtual Bool_t HandleConfigureNotify(Event_t *) { return kFALSE; }
0045    virtual Bool_t HandleButton(Event_t *) { return kFALSE; }
0046    virtual Bool_t HandleDoubleClick(Event_t *) { return kFALSE; }
0047    virtual Bool_t HandleCrossing(Event_t *) { return kFALSE; }
0048    virtual Bool_t HandleMotion(Event_t *) { return kFALSE; }
0049    virtual Bool_t HandleKey(Event_t *) { return kFALSE; }
0050    virtual Bool_t HandleFocusChange(Event_t *) { return kFALSE; }
0051    virtual Bool_t HandleSelection(Event_t *) { return kFALSE; }
0052    virtual Bool_t HandleSelectionRequest(Event_t *) { return kFALSE; }
0053    virtual Bool_t HandleSelectionClear(Event_t *) { return kFALSE; }
0054    virtual Bool_t HandleColormapChange(Event_t *) { return kFALSE; }
0055    virtual void   ProcessedEvent(Event_t *event)
0056                      { Emit("ProcessedEvent(Event_t*)", (Longptr_t)event); } //*SIGNAL*
0057 
0058    virtual void   SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2);
0059    virtual Bool_t ProcessMessage(Longptr_t, Longptr_t, Longptr_t) { return kFALSE; }
0060    virtual void   Repaint() { }
0061 
0062    ClassDefOverride(TGEventHandler,0)  // Abstract event handler
0063 };
0064 
0065 #endif
0066