Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
20class TString;
21
23 public TQObject
24{
25
26private:
29
30protected:
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
46public:
47 TGLOverlayButton(TGLViewerBase *parent, const char *text, Float_t posx,
49 ~TGLOverlayButton() override { }
50
51 Bool_t MouseEnter(TGLOvlSelectRecord& selRec) override;
52 Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event) override;
53 void MouseLeave() override;
54
55 void Render(TGLRnrCtx& rnrCtx) override;
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 ClassDefOverride(TGLOverlayButton, 0); // GL-overlay button.
71};
72
73#endif
74
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Definition RtypesCore.h:63
float Float_t
Definition RtypesCore.h:57
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char text
A wrapper class for FTFont.
GL-overlay button.
TGLOverlayButton(const TGLOverlayButton &)=delete
virtual void SetTextColor(Pixel_t col)
virtual void SetAlphaValues(Float_t norm, Float_t high)
virtual void SetBackColor(Pixel_t col)
virtual void ResetState()
virtual void SetSize(Float_t w, Float_t h)
virtual Pixel_t GetTextColor() const
void Render(TGLRnrCtx &rnrCtx) override
Render the overlay elements.
virtual const char * GetText() const
virtual Pixel_t GetBackColor() const
void MouseLeave() override
Mouse has left overlay area.
~TGLOverlayButton() override
TGLOverlayButton & operator=(const TGLOverlayButton &)=delete
Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event) override
Handle overlay event.
virtual void SetText(const char *text)
virtual void SetPosition(Float_t x, Float_t y)
virtual void Clicked(TGLViewerBase *viewer)
Emits "Clicked(TGLViewerBase*)" signal.
Bool_t MouseEnter(TGLOvlSelectRecord &selRec) override
Mouse has entered overlay area.
An overlay element.
Definition TGLOverlay.h:23
Selection record for overlay objects.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
Base class for GL viewers.
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174