Logo ROOT   6.12/07
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 #include "TGLOverlay.h"
16 #include "TGLFontManager.h"
17 #include "TGLViewerBase.h"
18 #include "TQObject.h"
19 
20 class TString;
21 
23  public TQObject
24 {
25 
26 private:
27  TGLOverlayButton(const TGLOverlayButton&); // Not implemented
28  TGLOverlayButton& operator=(const TGLOverlayButton&); // Not implemented
29 
30 protected:
31 
32  TString fText; // button text
33  Int_t fActiveID; // active item identifier
34  Pixel_t fBackColor; // button background color
35  Pixel_t fTextColor; // text color
36  Float_t fNormAlpha; // button alpha value (transparency) in normal state
37  Float_t fHighAlpha; // button alpha value (transparency) in highlight state
38 
39  Float_t fPosX; // button x position
40  Float_t fPosY; // button y position
41  Float_t fWidth; // button width
42  Float_t fHeight; // button height
43 
44  mutable TGLFont fFont; // font used to render text
45 
46 public:
47  TGLOverlayButton(TGLViewerBase *parent, const char *text, Float_t posx,
48  Float_t posy, Float_t width, Float_t height);
49  virtual ~TGLOverlayButton() { }
50 
51  virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
52  virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event);
53  virtual void MouseLeave();
54 
55  virtual void Render(TGLRnrCtx& rnrCtx);
56  virtual void ResetState() { fActiveID = -1; }
57 
58  virtual const char *GetText() const { return fText.Data(); }
59  virtual Pixel_t GetBackColor() const { return fBackColor; }
60  virtual Pixel_t GetTextColor() const { return fTextColor; }
61  virtual void SetText(const char *text) { fText = text; }
62  virtual void SetPosition(Float_t x, Float_t y) { fPosX = x; fPosY = y; }
63  virtual void SetSize(Float_t w, Float_t h) { fWidth = w; fHeight = h; }
64  virtual void SetAlphaValues(Float_t norm, Float_t high) { fNormAlpha = norm; fHighAlpha = high; }
65  virtual void SetBackColor(Pixel_t col) { fBackColor = col; }
66  virtual void SetTextColor(Pixel_t col) { fTextColor = col; }
67 
68  virtual void Clicked(TGLViewerBase *viewer); // *SIGNAL*
69 
70  ClassDef(TGLOverlayButton, 0); // GL-overlay button.
71 };
72 
73 #endif
74 
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 Pixel_t GetTextColor() const
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
Mouse has entered overlay area.
This is the ROOT implementation of the Qt object communication mechanism (see also http://www...
Definition: TQObject.h:49
virtual Pixel_t GetBackColor() const
Basic string class.
Definition: TString.h:125
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.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
ULong_t Pixel_t
Definition: GuiTypes.h:39
virtual void ResetState()
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.
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)
const char * Data() const
Definition: TString.h:345
virtual const char * GetText() const