ROOT logo
ROOT » GRAF2D » GRAF » TText

class TText: public TNamed, public TAttText


   TText is the base class for several text objects.
   See TAttText for a list of text attributes or fonts,
   and also for a discussion on text speed and font quality.

  By default, the text is drawn in the pad coordinates system.
  One can draw in NDC coordinates [0,1] if the function SetNDC
  is called for a TText object.

Function Members (Methods)

public:
TText()
TText(const TText& text)
TText(Double_t x, Double_t y, const char* text)
virtual~TText()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidCopy(TObject& text) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tDistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual TText*DrawText(Double_t x, Double_t y, const char* text)
virtual TText*DrawTextNDC(Double_t x, Double_t y, const char* text)
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual voidGetBoundingBox(UInt_t& w, UInt_t& h, Bool_t angle = kFALSE)
virtual voidGetControlBox(Int_t x, Int_t y, Double_t theta, Int_t* cBoxX, Int_t* cBoxY)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual voidGetTextAdvance(UInt_t& a, const char* text, const Bool_t kern = kTRUE) const
virtual Short_tTAttText::GetTextAlign() const
virtual Float_tTAttText::GetTextAngle() const
virtual voidGetTextAscentDescent(UInt_t& a, UInt_t& d, const char* text) const
virtual Color_tTAttText::GetTextColor() const
virtual voidGetTextExtent(UInt_t& w, UInt_t& h, const char* text) const
virtual Font_tTAttText::GetTextFont() const
virtual Float_tTAttText::GetTextSize() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Double_tGetX() const
Double_tGetY() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTAttText::Modify()
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TText&operator=(const TText&)
virtual voidPaint(Option_t* option = "")
virtual voidPaintControlBox(Int_t x, Int_t y, Double_t theta)
virtual voidPaintText(Double_t x, Double_t y, const char* text)
virtual voidPaintTextNDC(Double_t u, Double_t v, const char* text)
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidTAttText::ResetAttText(Option_t* toption = "")
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidSavePrimitive(ostream& out, Option_t* option = "")
virtual voidTAttText::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)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
virtual voidSetNDC(Bool_t isNDC = kTRUE)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetText(Double_t x, Double_t y, const char* text)MENU
virtual voidTAttText::SetTextAlign(Short_t align = 11)
virtual voidTAttText::SetTextAngle(Float_t tangle = 0)MENU
virtual voidTAttText::SetTextAttributes()MENU
virtual voidTAttText::SetTextColor(Color_t tcolor = 1)
virtual voidTAttText::SetTextFont(Font_t tfont = 62)
virtual voidTAttText::SetTextSize(Float_t tsize = 1)
virtual voidTAttText::SetTextSizePixels(Int_t npixels)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetX(Double_t x)MENU
virtual voidSetY(Double_t y)MENU
virtual voidShowMembers(TMemberInspector& insp)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

protected:
TStringTNamed::fNameobject identifier
Short_tTAttText::fTextAlignText alignment
Float_tTAttText::fTextAngleText angle
Color_tTAttText::fTextColorText color index
Font_tTAttText::fTextFontText font number
Float_tTAttText::fTextSizeText size
TStringTNamed::fTitleobject title
Double_tfXX position of text (left,center,etc..)
Double_tfYY position of text (left,center,etc..)

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TText()
 Text default constructor.
TText(Double_t x, Double_t y, const char* text)
 Text normal constructor.
~TText()
 Text default destructor.
TText(const TText& text)
 Copy constructor.
void Copy(TObject& text) const
 Copy this text to text.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
 Compute distance from point px,py to a string.
 The rectangle surrounding this string is evaluated.
 If the point (px,py) is in the rectangle, the distance is set to zero.
TText * DrawText(Double_t x, Double_t y, const char* text)
 Draw this text with new coordinates.
TText * DrawTextNDC(Double_t x, Double_t y, const char* text)
 Draw this text with new coordinates in NDC.
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
 Execute action corresponding to one event.

  This member function must be implemented to realize the action
  corresponding to the mouse click on the object in the window
void GetControlBox(Int_t x, Int_t y, Double_t theta, Int_t* cBoxX, Int_t* cBoxY)
 Return the text control box. The text position coordinates is (x,y) and
 the text angle is theta. The control box coordinates are returned in cBoxX
 and cBoxY.
void GetBoundingBox(UInt_t& w, UInt_t& h, Bool_t angle = kFALSE)
 Return text size in pixels. By default the size returned does not take
 into account the text angle (angle = kFALSE). If angle is set to kTRUE
 w and h take the angle into account.
void GetTextAscentDescent(UInt_t& a, UInt_t& d, const char* text) const
 Return text ascent and descent for string text
  in a return total text ascent
  in d return text descent
void GetTextExtent(UInt_t& w, UInt_t& h, const char* text) const
 Return text extent for string text
  in w return total text width
  in h return text height
void GetTextAdvance(UInt_t& a, const char* text, const Bool_t kern = kTRUE) const
 Return text advance for string text
 if kern is true (default) kerning is taken into account. If it is false
 the kerning is not taken into account.
void ls(Option_t* option = "") const
 List this text with its attributes.
void Paint(Option_t* option = "")
 Paint this text with its current attributes.
void PaintControlBox(Int_t x, Int_t y, Double_t theta)
 Paint the text control box. (x,y) are the coordinates where the control
 box should be painted and theta is the angle of the box.
void PaintText(Double_t x, Double_t y, const char* text)
 Draw this text with new coordinates.
void PaintTextNDC(Double_t u, Double_t v, const char* text)
 Draw this text with new coordinates in NDC.
void Print(Option_t* option = "") const
 Dump this text with its attributes.
void SavePrimitive(ostream& out, Option_t* option = "")
 Save primitive as a C++ statement(s) on output stream out
void SetNDC(Bool_t isNDC = kTRUE)
 Set NDC mode on if isNDC = kTRUE, off otherwise
void Streamer(TBuffer& b)
 Stream an object of class TText.
Double_t GetX() const
{ return fX; }
Double_t GetY() const
{ return fY; }
void SetText(Double_t x, Double_t y, const char* text)
void SetX(Double_t x)
{ fX = x; }
void SetY(Double_t y)
{ fY = y; }