00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGLOverlayButton
00013 #define ROOT_TGLOverlayButton
00014
00015 #ifndef ROOT_TGLOverlay
00016 #include "TGLOverlay.h"
00017 #endif
00018 #ifndef ROOT_TGLFontManager
00019 #include "TGLFontManager.h"
00020 #endif
00021 #ifndef ROOT_TGLViewerBase
00022 #include "TGLViewerBase.h"
00023 #endif
00024 #ifndef ROOT_TQObject
00025 #include "TQObject.h"
00026 #endif
00027
00028 class TString;
00029
00030 class TGLOverlayButton : public TGLOverlayElement,
00031 public TQObject
00032 {
00033
00034 private:
00035 TGLOverlayButton(const TGLOverlayButton&);
00036 TGLOverlayButton& operator=(const TGLOverlayButton&);
00037
00038 protected:
00039
00040 TString fText;
00041 Int_t fActiveID;
00042 Pixel_t fBackColor;
00043 Pixel_t fTextColor;
00044 Float_t fNormAlpha;
00045 Float_t fHighAlpha;
00046
00047 Float_t fPosX;
00048 Float_t fPosY;
00049 Float_t fWidth;
00050 Float_t fHeight;
00051
00052 mutable TGLFont fFont;
00053
00054 public:
00055 TGLOverlayButton(TGLViewerBase *parent, const char *text, Float_t posx,
00056 Float_t posy, Float_t width, Float_t height);
00057 virtual ~TGLOverlayButton() { }
00058
00059 virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
00060 virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event);
00061 virtual void MouseLeave();
00062
00063 virtual void Render(TGLRnrCtx& rnrCtx);
00064 virtual void ResetState() { fActiveID = -1; }
00065
00066 virtual const char *GetText() const { return fText.Data(); }
00067 virtual Pixel_t GetBackColor() const { return fBackColor; }
00068 virtual Pixel_t GetTextColor() const { return fTextColor; }
00069 virtual void SetText(const char *text) { fText = text; }
00070 virtual void SetPosition(Float_t x, Float_t y) { fPosX = x; fPosY = y; }
00071 virtual void SetSize(Float_t w, Float_t h) { fWidth = w; fHeight = h; }
00072 virtual void SetAlphaValues(Float_t norm, Float_t high) { fNormAlpha = norm; fHighAlpha = high; }
00073 virtual void SetBackColor(Pixel_t col) { fBackColor = col; }
00074 virtual void SetTextColor(Pixel_t col) { fTextColor = col; }
00075
00076 virtual void Clicked(TGLViewerBase *viewer);
00077
00078 ClassDef(TGLOverlayButton, 0);
00079 };
00080
00081 #endif
00082