ROOT  6.06/09
Reference Guide
TGLOverlayButton.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Bertrand Bellenot 2008
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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_TGLOverlayButton
13 #define ROOT_TGLOverlayButton
14 
15 #ifndef ROOT_TGLOverlay
16 #include "TGLOverlay.h"
17 #endif
18 #ifndef ROOT_TGLFontManager
19 #include "TGLFontManager.h"
20 #endif
21 #ifndef ROOT_TGLViewerBase
22 #include "TGLViewerBase.h"
23 #endif
24 #ifndef ROOT_TQObject
25 #include "TQObject.h"
26 #endif
27 
28 class TString;
29 
31  public TQObject
32 {
33 
34 private:
35  TGLOverlayButton(const TGLOverlayButton&); // Not implemented
36  TGLOverlayButton& operator=(const TGLOverlayButton&); // Not implemented
37 
38 protected:
39 
40  TString fText; // button text
41  Int_t fActiveID; // active item identifier
42  Pixel_t fBackColor; // button background color
43  Pixel_t fTextColor; // text color
44  Float_t fNormAlpha; // button alpha value (transparency) in normal state
45  Float_t fHighAlpha; // button alpha value (transparency) in highlight state
46 
47  Float_t fPosX; // button x position
48  Float_t fPosY; // button y position
49  Float_t fWidth; // button width
50  Float_t fHeight; // button height
51 
52  mutable TGLFont fFont; // font used to render text
53 
54 public:
55  TGLOverlayButton(TGLViewerBase *parent, const char *text, Float_t posx,
56  Float_t posy, Float_t width, Float_t height);
57  virtual ~TGLOverlayButton() { }
58 
59  virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
60  virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event);
61  virtual void MouseLeave();
62 
63  virtual void Render(TGLRnrCtx& rnrCtx);
64  virtual void ResetState() { fActiveID = -1; }
65 
66  virtual const char *GetText() const { return fText.Data(); }
67  virtual Pixel_t GetBackColor() const { return fBackColor; }
68  virtual Pixel_t GetTextColor() const { return fTextColor; }
69  virtual void SetText(const char *text) { fText = text; }
70  virtual void SetPosition(Float_t x, Float_t y) { fPosX = x; fPosY = y; }
71  virtual void SetSize(Float_t w, Float_t h) { fWidth = w; fHeight = h; }
72  virtual void SetAlphaValues(Float_t norm, Float_t high) { fNormAlpha = norm; fHighAlpha = high; }
73  virtual void SetBackColor(Pixel_t col) { fBackColor = col; }
74  virtual void SetTextColor(Pixel_t col) { fTextColor = col; }
75 
76  virtual void Clicked(TGLViewerBase *viewer); // *SIGNAL*
77 
78  ClassDef(TGLOverlayButton, 0); // GL-overlay button.
79 };
80 
81 #endif
82 
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition: TGLRnrCtx.h:40
float Float_t
Definition: RtypesCore.h:53
virtual void SetTextColor(Pixel_t col)
TGLOverlayButton(const TGLOverlayButton &)
virtual void Render(TGLRnrCtx &rnrCtx)
Render the overlay elements.
TH1 * h
Definition: legend2.C:5
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
Mouse has entered overlay area.
virtual const char * GetText() const
This is the ROOT implementation of the Qt object communication mechanism (see also http://www...
Definition: TQObject.h:53
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
An overlay element.
Definition: TGLOverlay.h:22
Base class for GL viewers.
Definition: TGLViewerBase.h:36
virtual void Clicked(TGLViewerBase *viewer)
Emits "Clicked(TGLViewerBase*)" signal.
virtual Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event)
Handle overlay event.
const char * Data() const
Definition: TString.h:349
Double_t x[n]
Definition: legend1.C:17
ULong_t Pixel_t
Definition: GuiTypes.h:41
virtual Pixel_t GetBackColor() const
virtual void ResetState()
virtual Pixel_t GetTextColor() const
GL-overlay button.
virtual void SetText(const char *text)
virtual void SetPosition(Float_t x, Float_t y)
TText * text
virtual void SetSize(Float_t w, Float_t h)
Double_t y[n]
Definition: legend1.C:17
virtual void MouseLeave()
Mouse has left overlay area.
ClassDef(TGLOverlayButton, 0)
TGLOverlayButton & operator=(const TGLOverlayButton &)
A wrapper class for FTFont.
virtual ~TGLOverlayButton()
Selection record for overlay objects.
virtual void SetBackColor(Pixel_t col)
virtual void SetAlphaValues(Float_t norm, Float_t high)
double norm(double *x, double *p)
Definition: unuranDistr.cxx:40