Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGLOverlayButton.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gl:$Id$
0002 // Author: Bertrand Bellenot 2008
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGLOverlayButton
0013 #define ROOT_TGLOverlayButton
0014 
0015 #include "TGLOverlay.h"
0016 #include "TGLFontManager.h"
0017 #include "TGLViewerBase.h"
0018 #include "TQObject.h"
0019 
0020 class TString;
0021 
0022 class TGLOverlayButton : public TGLOverlayElement,
0023                          public TQObject
0024 {
0025 
0026 private:
0027    TGLOverlayButton(const TGLOverlayButton&) = delete;
0028    TGLOverlayButton& operator=(const TGLOverlayButton&) = delete;
0029 
0030 protected:
0031 
0032    TString           fText;         // button text
0033    Int_t             fActiveID;     // active item identifier
0034    Pixel_t           fBackColor;    // button background color
0035    Pixel_t           fTextColor;    // text color
0036    Float_t           fNormAlpha;    // button alpha value (transparency) in normal state
0037    Float_t           fHighAlpha;    // button alpha value (transparency) in highlight state
0038 
0039    Float_t           fPosX;         // button x position
0040    Float_t           fPosY;         // button y position
0041    Float_t           fWidth;        // button width
0042    Float_t           fHeight;       // button height
0043 
0044    mutable TGLFont   fFont;         // font used to render text
0045 
0046 public:
0047    TGLOverlayButton(TGLViewerBase *parent, const char *text, Float_t posx,
0048                     Float_t posy, Float_t width, Float_t height);
0049    ~TGLOverlayButton() override { }
0050 
0051    Bool_t       MouseEnter(TGLOvlSelectRecord& selRec) override;
0052    Bool_t       Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event) override;
0053    void         MouseLeave() override;
0054 
0055    void         Render(TGLRnrCtx& rnrCtx) override;
0056    virtual void         ResetState() { fActiveID = -1; }
0057 
0058    virtual const char  *GetText() const { return fText.Data(); }
0059    virtual Pixel_t      GetBackColor() const { return fBackColor; }
0060    virtual Pixel_t      GetTextColor() const { return fTextColor; }
0061    virtual void         SetText(const char *text) { fText = text; }
0062    virtual void         SetPosition(Float_t x, Float_t y) { fPosX = x; fPosY = y; }
0063    virtual void         SetSize(Float_t w, Float_t h) { fWidth = w; fHeight = h; }
0064    virtual void         SetAlphaValues(Float_t norm, Float_t high) { fNormAlpha = norm; fHighAlpha = high; }
0065    virtual void         SetBackColor(Pixel_t col) { fBackColor = col; }
0066    virtual void         SetTextColor(Pixel_t col) { fTextColor = col; }
0067 
0068    virtual void         Clicked(TGLViewerBase *viewer); // *SIGNAL*
0069 
0070    ClassDefOverride(TGLOverlayButton, 0); // GL-overlay button.
0071 };
0072 
0073 #endif
0074