Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-13 09:10:58

0001 // @(#)root/base:$Id$
0002 // Author: Rene Brun   12/12/94
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, 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_TAttText
0013 #define ROOT_TAttText
0014 
0015 
0016 #include "Rtypes.h"
0017 
0018 class TColorNumber;
0019 
0020 class TAttText {
0021 
0022 protected:
0023    Float_t    fTextAngle;           ///< Text angle
0024    Float_t    fTextSize;            ///< Text size
0025    Short_t    fTextAlign;           ///< Text alignment
0026    Color_t    fTextColor;           ///< Text color
0027    Font_t     fTextFont;            ///< Text font
0028 
0029 public:
0030    TAttText();
0031    TAttText(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize);
0032    virtual ~TAttText();
0033            void     Copy(TAttText &atttext) const;
0034    virtual Short_t  GetTextAlign() const {return fTextAlign;} ///< Return the text alignment
0035    virtual Float_t  GetTextAngle() const {return fTextAngle;} ///< Return the text angle
0036    virtual Color_t  GetTextColor() const {return fTextColor;} ///< Return the text color
0037    virtual Font_t   GetTextFont()  const {return fTextFont;}  ///< Return the text font
0038    virtual Float_t  GetTextSize()  const {return fTextSize;}  ///< Return the text size
0039    virtual Float_t  GetTextSizePercent(Float_t size);         ///< Return the text in percent of the pad size
0040    virtual void     Modify();
0041    virtual void     ResetAttText(Option_t *toption="");
0042    virtual void     SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1);
0043    virtual void     SetTextAttributes();  // *MENU*
0044    virtual void     SetTextAlign(Short_t align=11) { fTextAlign = align;}  ///< Set the text alignment
0045    virtual void     SetTextAngle(Float_t tangle=0) { fTextAngle = tangle;} ///< Set the text angle
0046    virtual void     SetTextColor(Color_t tcolor=1) { fTextColor = tcolor;} ///< Set the text color
0047    virtual void     SetTextColorAlpha(Color_t tcolor, Float_t talpha);
0048    virtual void     SetTextFont(Font_t tfont=62) { fTextFont = tfont;}     ///< Set the text font
0049    virtual void     SetTextSize(Float_t tsize=1) { fTextSize = tsize;}     ///< Set the text size
0050    virtual void     SetTextSizePixels(Int_t npixels);                      ///< Set the text size in pixel
0051 
0052    void SetTextColor(TColorNumber lcolor);
0053 
0054    ClassDef(TAttText,2)  //Text attributes
0055 };
0056 
0057    enum ETextAlign {kHAlignLeft=10, kHAlignCenter=20, kHAlignRight=30,
0058                     kVAlignBottom=1, kVAlignCenter=2, kVAlignTop=3};
0059 
0060 #endif
0061