TGLOverlayButton.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLOverlayButton.h 26367 2008-11-21 18:08:30Z matevz $
00002 // Author: Bertrand Bellenot 2008
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
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&);            // Not implemented
00036    TGLOverlayButton& operator=(const TGLOverlayButton&); // Not implemented
00037 
00038 protected:
00039 
00040    TString           fText;         // button text
00041    Int_t             fActiveID;     // active item identifier
00042    Pixel_t           fBackColor;    // button background color
00043    Pixel_t           fTextColor;    // text color
00044    Float_t           fNormAlpha;    // button alpha value (transparency) in normal state
00045    Float_t           fHighAlpha;    // button alpha value (transparency) in highlight state
00046 
00047    Float_t           fPosX;         // button x position
00048    Float_t           fPosY;         // button y position
00049    Float_t           fWidth;        // button width
00050    Float_t           fHeight;       // button height
00051 
00052    mutable TGLFont   fFont;         // font used to render text
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); // *SIGNAL*
00077 
00078    ClassDef(TGLOverlayButton, 0); // GL-overlay button.
00079 };
00080 
00081 #endif
00082 

Generated on Tue Jul 5 14:16:48 2011 for ROOT_528-00b_version by  doxygen 1.5.1