Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TAttText.h
Go to the documentation of this file.
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#include "Rtypes.h"
17
18class TColorNumber;
19class TVirtualPad;
20
21class TAttText {
22
23protected:
24 Float_t fTextAngle; ///< Text angle
25 Float_t fTextSize; ///< Text size
26 Short_t fTextAlign; ///< Text alignment
27 Color_t fTextColor; ///< Text color
28 Font_t fTextFont; ///< Text font
29
30public:
32 TAttText(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize);
33 virtual ~TAttText();
34 void Copy(TAttText &atttext) const;
35 virtual Short_t GetTextAlign() const {return fTextAlign;} ///< Return the text alignment
36 virtual Float_t GetTextAngle() const {return fTextAngle;} ///< Return the text angle
37 virtual Color_t GetTextColor() const {return fTextColor;} ///< Return the text color
38 virtual Font_t GetTextFont() const {return fTextFont;} ///< Return the text font
39 virtual Float_t GetTextSize() const {return fTextSize;} ///< Return the text size
40 virtual Float_t GetTextSizePercent(Float_t size); ///< Return the text in percent of the pad size
41 virtual Float_t GetTextSizePixels(TVirtualPad &pad) const; ///< Return the text size in pixels for specified pad
42 virtual Float_t GetTextSizeRelative(TVirtualPad &pad) const; ///< Return the text size in relative units
43 virtual void Modify();
44 virtual void ModifyOn(TVirtualPad &pad);
45 virtual void ResetAttText(Option_t *toption="");
46 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);
47 virtual void SetTextAttributes(); // *MENU*
48 virtual void SetTextAlign(Short_t align=11) { fTextAlign = align;} ///< Set the text alignment
49 virtual void SetTextAngle(Float_t tangle=0) { fTextAngle = tangle;} ///< Set the text angle
50 virtual void SetTextColor(Color_t tcolor=1) { fTextColor = tcolor;} ///< Set the text color
51 virtual void SetTextColorAlpha(Color_t tcolor, Float_t talpha);
52 virtual void SetTextFont(Font_t tfont=62) { fTextFont = tfont;} ///< Set the text font
53 virtual void SetTextSize(Float_t tsize=1) { fTextSize = tsize;} ///< Set the text size
54 virtual void SetTextSizePixels(Int_t npixels); ///< Set the text size in pixel
55
57
58 ClassDef(TAttText,2) //Text attributes
59};
60
63
64#endif
65
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
short Font_t
Font number (short).
Definition RtypesCore.h:95
short Short_t
Signed Short integer 2 bytes (short).
Definition RtypesCore.h:53
short Color_t
Color number (short).
Definition RtypesCore.h:99
short Style_t
Style number (short).
Definition RtypesCore.h:96
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
#define ClassDef(name, id)
Definition Rtypes.h:344
ETextAlign
Definition TAttText.h:61
@ kVAlignTop
Definition TAttText.h:62
@ kVAlignCenter
Definition TAttText.h:62
@ kHAlignLeft
Definition TAttText.h:61
@ kVAlignBottom
Definition TAttText.h:62
@ kHAlignCenter
Definition TAttText.h:61
@ kHAlignRight
Definition TAttText.h:61
char name[80]
Definition TGX11.cxx:148
virtual Float_t GetTextSize() const
Return the text size.
Definition TAttText.h:39
virtual void SetTextColorAlpha(Color_t tcolor, Float_t talpha)
virtual void SetTextAttributes()
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:48
virtual Short_t GetTextAlign() const
Return the text alignment.
Definition TAttText.h:35
virtual Font_t GetTextFont() const
Return the text font.
Definition TAttText.h:38
Color_t fTextColor
Text color.
Definition TAttText.h:27
Float_t fTextAngle
Text angle.
Definition TAttText.h:24
virtual void SetTextSizePixels(Int_t npixels)
Set the text size in pixel.
virtual Color_t GetTextColor() const
Return the text color.
Definition TAttText.h:37
virtual ~TAttText()
virtual Float_t GetTextSizePixels(TVirtualPad &pad) const
Return the text size in pixels for specified pad.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
Definition TAttText.h:49
virtual Float_t GetTextAngle() const
Return the text angle.
Definition TAttText.h:36
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition TAttText.h:50
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:52
Font_t fTextFont
Text font.
Definition TAttText.h:28
virtual void ModifyOn(TVirtualPad &pad)
virtual void ResetAttText(Option_t *toption="")
void SetTextColor(TColorNumber lcolor)
virtual Float_t GetTextSizePercent(Float_t size)
Return the text in percent of the pad size.
virtual Float_t GetTextSizeRelative(TVirtualPad &pad) const
Return the text size in relative units.
TAttText(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize)
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:53
Short_t fTextAlign
Text alignment.
Definition TAttText.h:26
void Copy(TAttText &atttext) const
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)
Float_t fTextSize
Text size.
Definition TAttText.h:25
virtual void Modify()
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51