1 // @(#)root/base:$Id$ 2 // Author: Rene Brun 12/12/94 3 4 /************************************************************************* 5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 6 * All rights reserved. * 7 * * 8 * For the licensing terms see $ROOTSYS/LICENSE. * 9 * For the list of contributors see $ROOTSYS/README/CREDITS. * 10 *************************************************************************/ 11 12 #ifndef ROOT_TAttText 13 #define ROOT_TAttText 14 15 16 ////////////////////////////////////////////////////////////////////////// 17 // // 18 // TAttText // 19 // // 20 // Text attributes. // 21 // // 22 ////////////////////////////////////////////////////////////////////////// 23 24 #ifndef ROOT_Rtypes 25 #include "Rtypes.h" 26 #endif 27 #ifndef ROOT_Riosfwd 28 #include "Riosfwd.h" 29 #endif 30 31 32 class TAttText { 33 34 protected: 35 Float_t fTextAngle; //Text angle 36 Float_t fTextSize; //Text size 37 Short_t fTextAlign; //Text alignment 38 Color_t fTextColor; //Text color index 39 Font_t fTextFont; //Text font number 40 41 public: 42 TAttText(); 43 TAttText(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize); 44 virtual ~TAttText(); 45 void Copy(TAttText &atttext) const; 46 virtual Short_t GetTextAlign() const {return fTextAlign;} 47 virtual Float_t GetTextAngle() const {return fTextAngle;} 48 virtual Color_t GetTextColor() const {return fTextColor;} 49 virtual Font_t GetTextFont() const {return fTextFont;} 50 virtual Float_t GetTextSize() const {return fTextSize;} 51 virtual void Modify(); 52 virtual void ResetAttText(Option_t *toption=""); 53 virtual void SaveTextAttributes(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); 54 virtual void SetTextAttributes(); // *MENU* 55 virtual void SetTextAlign(Short_t align=11) { fTextAlign = align;} 56 virtual void SetTextAngle(Float_t tangle=0) { fTextAngle = tangle;} // *MENU* 57 virtual void SetTextColor(Color_t tcolor=1) { fTextColor = tcolor;} 58 virtual void SetTextColorAlpha(Color_t tcolor, Float_t talpha); 59 virtual void SetTextFont(Font_t tfont=62) { fTextFont = tfont;} 60 virtual void SetTextSize(Float_t tsize=1) { fTextSize = tsize;} 61 virtual void SetTextSizePixels(Int_t npixels); 62 63 ClassDef(TAttText,2) //Text attributes 64 }; 65 66 enum ETextAlign {kHAlignLeft=10, kHAlignCenter=20, kHAlignRight=30, 67 kVAlignBottom=1, kVAlignCenter=2, kVAlignTop=3}; 68 69 #endif 70 71