Logo ROOT  
Reference Guide
TGLEventHandler.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
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_TGLEventHandler
13#define ROOT_TGLEventHandler
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TGLEventHandler //
18// //
19//////////////////////////////////////////////////////////////////////////
20
21#include "TGEventHandler.h"
22#include "TPoint.h"
23
24class TGToolTip;
25
26class TGLViewer;
28
30{
31protected:
33 TTimer *fMouseTimer; // mouse delay timer
38 TGToolTip *fTooltip; // tooltip for highlight
49 Int_t fSecSelType; // secondary selection type
55
56 virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2);
57
58 virtual void GrabMouse();
59 virtual void UnGrabMouse();
60
61 virtual void SelectForClicked(Event_t *event);
62 virtual void SelectForMouseOver();
63
65
66public:
68 virtual ~TGLEventHandler();
69
70 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
78 virtual Bool_t HandleKey(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();
85
86 virtual void PopupContextMenu(TGLPhysicalShape* pshp, Event_t *event, Int_t gx, Int_t gy);
87
88 virtual void TriggerTooltip(const char* text);
89 virtual void RemoveTooltip();
90
93
96
97 Int_t GetSecSelType() const { return fSecSelType; }
99
102
103 Bool_t GetArcBall() const { return fArcBall; }
105
106 ClassDef(TGLEventHandler, 0); // Base-class and default implementation of event-handler for TGLViewer.
107};
108
109#endif
110
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
bool Bool_t
Definition: RtypesCore.h:63
float Float_t
Definition: RtypesCore.h:57
#define ClassDef(name, id)
Definition: Rtypes.h:325
Base-class and default implementation of event-handler for TGLViewer.
virtual void GrabMouse()
Acquire mouse grab.
void SetMouseOverSelectDelay(Int_t ms)
Set delay of mouse-over probe (highlight).
virtual Bool_t HandleTimer(TTimer *t)
If mouse delay timer times out emit signal.
Bool_t GetArcBall() const
TGLEventHandler(TGWindow *w, TObject *obj)
Constructor.
virtual void SelectForClicked(Event_t *event)
Run selection (optionally with on secondary selection) and emit corresponding Clicked() signals.
TGLViewer * fGLViewer
TGLPhysicalShape * fLastMouseOverShape
virtual void UnGrabMouse()
Release mouse grab.
virtual Bool_t HandleExpose(Event_t *event)
Handle window expose 'event' - show.
TPoint fLastMouseOverPos
virtual void StartMouseTimer()
Start mouse timer in single-shot mode.
Int_t GetTooltipPixelTolerance() const
virtual void TriggerTooltip(const char *text)
Trigger display of tooltip.
virtual void StopMouseTimer()
Make sure mouse timers are not running.
void SetSecSelType(Int_t t)
void SetDoInternalSelection(Bool_t x)
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle mouse double click 'event'.
virtual Bool_t HandleEvent(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
virtual void PopupContextMenu(TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy)
Popup context menu.
void SetArcBall(Bool_t a)
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button 'event'.
virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Method to handle action TGLViewer::kDragCameraRotate.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion 'event'.
TTimer * fMouseTimer
Float_t fMouseDragFactor
Bool_t fMouseTimerRunning
Int_t GetSecSelType() const
Float_t fMouseWheelFactor
virtual Bool_t HandleCrossing(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
Bool_t fViewerCentricControls
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handle configure notify 'event' - a window resize/movement.
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard 'event'.
void SetMouseOverTooltipDelay(Int_t ms)
Set delay of tooltip timer.
Bool_t fDoInternalSelection
virtual void Repaint()
Handle window expose 'event' - show.
virtual ~TGLEventHandler()
Destructor.
virtual void ClearMouseOver()
Clear mouse-over state and emit mouse-over signals.
TGToolTip * fTooltip
void SetTooltipPixelTolerance(Int_t t)
virtual void SelectForMouseOver()
Run selection (optionally with on secondary selection) and emit corresponding MouseOver() signals.
Int_t fTooltipPixelTolerance
virtual void RemoveTooltip()
Hide the tooltip.
virtual Bool_t HandleFocusChange(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
Int_t ControlValue(Int_t v)
Float_t fArrowKeyFactor
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Process event of type 'event' - one of EEventType types, occurring at window location px,...
Bool_t GetDoInternalSelection() const
Concrete physical shape - a GL drawable.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:55
ROOT GUI Window base class.
Definition: TGWindow.h:23
Mother of all ROOT objects.
Definition: TObject.h:37
Definition: TPoint.h:31
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TText * text
Double_t x[n]
Definition: legend1.C:17
static constexpr double ms
Event structure.
Definition: GuiTypes.h:174
auto * a
Definition: textangle.C:12