#ifndef ROOT_TGLOverlayButton
#define ROOT_TGLOverlayButton
#ifndef ROOT_TGLOverlay
#include "TGLOverlay.h"
#endif
#ifndef ROOT_TGLFontManager
#include "TGLFontManager.h"
#endif
#ifndef ROOT_TGLViewerBase
#include "TGLViewerBase.h"
#endif
#ifndef ROOT_TQObject
#include "TQObject.h"
#endif
class TString;
class TGLOverlayButton : public TGLOverlayElement,
public TQObject
{
private:
TGLOverlayButton(const TGLOverlayButton&);
TGLOverlayButton& operator=(const TGLOverlayButton&);
protected:
TString fText;
Int_t fActiveID;
Pixel_t fBackColor;
Pixel_t fTextColor;
Float_t fNormAlpha;
Float_t fHighAlpha;
Float_t fPosX;
Float_t fPosY;
Float_t fWidth;
Float_t fHeight;
mutable TGLFont fFont;
public:
TGLOverlayButton(TGLViewerBase *parent, const char *text, Float_t posx,
Float_t posy, Float_t width, Float_t height);
virtual ~TGLOverlayButton() { }
virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event);
virtual void MouseLeave();
virtual void Render(TGLRnrCtx& rnrCtx);
virtual void ResetState() { fActiveID = -1; }
virtual const char *GetText() const { return fText.Data(); }
virtual Pixel_t GetBackColor() const { return fBackColor; }
virtual Pixel_t GetTextColor() const { return fTextColor; }
virtual void SetText(const char *text) { fText = text; }
virtual void SetPosition(Float_t x, Float_t y) { fPosX = x; fPosY = y; }
virtual void SetSize(Float_t w, Float_t h) { fWidth = w; fHeight = h; }
virtual void SetAlphaValues(Float_t norm, Float_t high) { fNormAlpha = norm; fHighAlpha = high; }
virtual void SetBackColor(Pixel_t col) { fBackColor = col; }
virtual void SetTextColor(Pixel_t col) { fTextColor = col; }
virtual void Clicked(TGLViewerBase *viewer);
ClassDef(TGLOverlayButton, 0);
};
#endif