12 #ifndef ROOT_TGLEventHandler
13 #define ROOT_TGLEventHandler
27 class TGLPhysicalShape;
29 class TGLEventHandler :
public TGEventHandler
34 TPoint fButtonPushPos;
36 TPoint fLastMouseOverPos;
37 TGLPhysicalShape *fLastMouseOverShape;
39 TPoint fLastGlobalPos;
41 UInt_t fActiveButtonID;
42 UInt_t fLastEventState;
43 Bool_t fIgnoreButtonUp;
44 Bool_t fInPointerGrab;
45 Bool_t fMouseTimerRunning;
48 Int_t fTooltipPixelTolerance;
50 Bool_t fDoInternalSelection;
51 Bool_t fViewerCentricControls;
52 Float_t fArrowKeyFactor;
53 Float_t fMouseDragFactor;
54 Float_t fMouseWheelFactor;
56 virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2);
58 virtual void GrabMouse();
59 virtual void UnGrabMouse();
61 virtual void SelectForClicked(Event_t *event);
62 virtual void SelectForMouseOver();
64 Int_t ControlValue(Int_t v) {
return fViewerCentricControls ? -v : v; }
67 TGLEventHandler(TGWindow *w, TObject *obj);
68 virtual ~TGLEventHandler();
70 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
71 virtual Bool_t HandleEvent(Event_t *event);
72 virtual Bool_t HandleExpose(Event_t * event);
73 virtual Bool_t HandleFocusChange(Event_t *event);
74 virtual Bool_t HandleCrossing(Event_t *event);
75 virtual Bool_t HandleButton(Event_t * event);
76 virtual Bool_t HandleDoubleClick(Event_t *event);
77 virtual Bool_t HandleConfigureNotify(Event_t *event);
78 virtual Bool_t HandleKey(Event_t *event);
79 virtual Bool_t HandleMotion(Event_t * event);
80 virtual Bool_t HandleTimer(TTimer *t);
81 virtual void StartMouseTimer();
82 virtual void StopMouseTimer();
83 virtual void ClearMouseOver();
84 virtual void Repaint();
86 virtual void PopupContextMenu(TGLPhysicalShape* pshp, Event_t *event, Int_t gx, Int_t gy);
88 virtual void TriggerTooltip(
const char* text);
89 virtual void RemoveTooltip();
91 void SetMouseOverSelectDelay(Int_t ms);
92 void SetMouseOverTooltipDelay(Int_t ms);
94 Int_t GetTooltipPixelTolerance()
const {
return fTooltipPixelTolerance; }
95 void SetTooltipPixelTolerance(Int_t t) { fTooltipPixelTolerance = t; }
97 Int_t GetSecSelType()
const {
return fSecSelType; }
98 void SetSecSelType(Int_t t) { fSecSelType = t; }
100 Bool_t GetDoInternalSelection()
const {
return fDoInternalSelection; }
101 void SetDoInternalSelection(Bool_t x) { fDoInternalSelection = x; }
103 Bool_t GetArcBall()
const {
return fArcBall; }
104 void SetArcBall(Bool_t a) { fArcBall = a; }
106 ClassDef(TGLEventHandler, 0);