ROOT » GRAF2D » GRAF » TPaveText

class TPaveText: public TPave, public TAttText


TPaveText : to draw a pave with text

A PaveText is a Pave (see TPave) with text, lines or/and boxes inside. Line (and boxes) are positionned in the pave using coordinates relative to the pave (%).

Example:

output of html602/MACRO_TPaveText_1.gif
//Draw a pave text
//Author: Olivier Couet
{
   TCanvas *c = new TCanvas("c");
   TPaveText *pt = new TPaveText(.05,.1,.95,.8);

   pt->AddText("A TPaveText can contain severals line of text.");
   pt->AddText("They are added to the pave using the AddText method.");
   pt->AddLine(.0,.5,1.,.5);
   pt->AddText("Even complex TLatex formulas can be added:");
   pt->AddText("F(t) = #sum_{i=-#infty}^{#infty}A(i)cos#[]{#frac{i}{t+i}}");

   pt->Draw();
   return c;
}
 

Function Members (Methods)

public:
virtual~TPaveText()
voidTObject::AbstractMethod(const char* method) const
virtual TBox*AddBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
virtual TLine*AddLine(Double_t x1 = 0, Double_t y1 = 0, Double_t x2 = 0, Double_t y2 = 0)
virtual TText*AddText(const char* label)
virtual TText*AddText(Double_t x1, Double_t y1, const char* label)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* option = "")MENU
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTPave::ConvertNDCtoPad()
virtual voidTPave::Copy(TObject& pave) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual voidDeleteText()MENU
Int_tTAttLine::DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
virtual Int_tTPave::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidDraw(Option_t* option = "")
virtual TBox*TBox::DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidDrawFile(const char* filename, Option_t* option = "")
virtual voidTPave::DrawPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize = 4, Option_t* option = "br")
virtual voidTObject::Dump() constMENU
virtual voidEditText()MENU
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 voidTPave::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Rectangle_tTBox::GetBBox()
virtual TPointTBox::GetBBoxCenter()
Int_tTPave::GetBorderSize() const
Double_tTPave::GetCornerRadius() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Color_tTAttFill::GetFillColor() const
virtual Style_tTAttFill::GetFillStyle() const
virtual const char*TObject::GetIconName() const
const char*GetLabel() const
virtual TText*GetLine(Int_t number) const
virtual Color_tTAttLine::GetLineColor() const
virtual Style_tTAttLine::GetLineStyle() const
virtual Width_tTAttLine::GetLineWidth() const
virtual TText*GetLineWith(const char* text) const
virtual TList*GetListOfLines() const
Float_tGetMargin() const
virtual Option_t*TPave::GetName() const
virtual TObject*GetObject(Double_t& ymouse, Double_t& yobj) const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TPave::GetOption() const
Int_tTPave::GetShadowColor() const
virtual Int_tGetSize() const
virtual Short_tTAttText::GetTextAlign() const
virtual Float_tTAttText::GetTextAngle() const
virtual Color_tTAttText::GetTextColor() const
virtual Font_tTAttText::GetTextFont() const
virtual Float_tTAttText::GetTextSize() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Double_tTBox::GetX1() const
Double_tTPave::GetX1NDC() const
Double_tTBox::GetX2() const
Double_tTPave::GetX2NDC() const
Double_tTBox::GetY1() const
Double_tTPave::GetY1NDC() const
Double_tTBox::GetY2() const
Double_tTPave::GetY2NDC() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTPave::Hash() const
virtual voidTBox::HideToolTip(Int_t event)
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 voidInsertLine()MENU
virtual voidInsertText(const char* label)MENU
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tTBox::IsBeingResized() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
virtual Int_tTBox::IsInside(Double_t x, Double_t y) const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTPave::IsSortable() const
virtual Bool_tTAttFill::IsTransparent() const
Bool_tTObject::IsZombie() const
virtual voidTPave::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTAttLine::Modify()
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
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)
TPaveText&operator=(const TPaveText&)
virtual voidPaint(Option_t* option = "")
virtual voidTBox::PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t* option = "")
virtual voidTPave::PaintPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize = 4, Option_t* option = "br")
virtual voidTPave::PaintPaveArc(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize = 4, Option_t* option = "br")
virtual voidPaintPrimitives(Int_t mode)
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidReadFile(const char* filename, Option_t* option = "", Int_t nlines = 50, Int_t fromline = 0)MENU
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidTAttFill::ResetAttFill(Option_t* option = "")
virtual voidTAttLine::ResetAttLine(Option_t* option = "")
virtual voidTAttText::ResetAttText(Option_t* toption = "")
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTAttFill::SaveFillAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1001)
virtual voidTAttLine::SaveLineAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t widdef = 1)
virtual voidSaveLines(ostream& out, const char* name)
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)
virtual voidSetAllWith(const char* text, Option_t* option, Double_t value)MENU
virtual voidTBox::SetBBoxCenter(const TPoint& p)
virtual voidTBox::SetBBoxCenterX(const Int_t x)
virtual voidTBox::SetBBoxCenterY(const Int_t y)
virtual voidTBox::SetBBoxX1(const Int_t x)
virtual voidTBox::SetBBoxX2(const Int_t x)
virtual voidTBox::SetBBoxY1(const Int_t y)
virtual voidTBox::SetBBoxY2(const Int_t y)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTPave::SetBorderSize(Int_t bordersize = 4)MENU
virtual voidTPave::SetCornerRadius(Double_t rad = 0.20000000000000001)MENU
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTAttFill::SetFillAttributes()MENU
virtual voidTAttFill::SetFillColor(Color_t fcolor)
virtual voidTAttFill::SetFillColorAlpha(Color_t fcolor, Float_t falpha)
virtual voidTAttFill::SetFillStyle(Style_t fstyle)
virtual voidSetLabel(const char* label)MENU
virtual voidTAttLine::SetLineAttributes()MENU
virtual voidTAttLine::SetLineColor(Color_t lcolor)
virtual voidTAttLine::SetLineColorAlpha(Color_t lcolor, Float_t lalpha)
virtual voidTAttLine::SetLineStyle(Style_t lstyle)
virtual voidTAttLine::SetLineWidth(Width_t lwidth)
virtual voidSetMargin(Float_t margin = 0.050000000000000003)MENU
virtual voidTPave::SetName(const char* name = "")MENU
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTPave::SetOption(Option_t* option = "br")
virtual voidTPave::SetShadowColor(Int_t color)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::SetTextColorAlpha(Color_t tcolor, Float_t talpha)
virtual voidTAttText::SetTextFont(Font_t tfont = 62)
virtual voidTAttText::SetTextSize(Float_t tsize = 1)
virtual voidTAttText::SetTextSizePixels(Int_t npixels)
virtual voidTBox::SetToolTipText(const char* text, Long_t delayms = 1000)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidTPave::SetX1(Double_t x1)
virtual voidTPave::SetX1NDC(Double_t x1)
virtual voidTPave::SetX2(Double_t x2)
virtual voidTPave::SetX2NDC(Double_t x2)
virtual voidTPave::SetY1(Double_t y1)
virtual voidTPave::SetY1NDC(Double_t y1)
virtual voidTPave::SetY2(Double_t y2)
virtual voidTPave::SetY2NDC(Double_t y2)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_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
TPaveText()
TPaveText(const TPaveText& pavetext)
TPaveText(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t* option = "br")
virtual voidUseCurrentStyle()
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

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TBox::(anonymous)TBox::kCannotMove
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TPave::(anonymous)TPave::kNameIsAction
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
Int_tTPave::fBorderSizewindow box bordersize in pixels
Double_tTPave::fCornerRadiusCorner radius in case of option arc
Color_tTAttFill::fFillColorfill area color
Style_tTAttFill::fFillStylefill area style
Int_tTPave::fInit(=0 if transformation to NDC not yet done)
TStringfLabelLabel written at the top of the pavetext
Color_tTAttLine::fLineColorline color
Style_tTAttLine::fLineStyleline style
Width_tTAttLine::fLineWidthline width
TList*fLinesList of labels
Int_tfLongestLength of the longest line
Float_tfMarginText margin
TStringTPave::fNamePave name
TStringTPave::fOptionPave style
Bool_tTBox::fResizing!True if box is being resized
Int_tTPave::fShadowColorColor of the pave's shadow
Short_tTAttText::fTextAlignText alignment
Float_tTAttText::fTextAngleText angle
Color_tTAttText::fTextColorText color index
Font_tTAttText::fTextFontText font number
Float_tTAttText::fTextSizeText size
Double_tTBox::fX1X of 1st point
Double_tTPave::fX1NDCX1 point in NDC coordinates
Double_tTBox::fX2X of 2nd point
Double_tTPave::fX2NDCX2 point in NDC coordinates
Double_tTBox::fY1Y of 1st point
Double_tTPave::fY1NDCY1 point in NDC coordinates
Double_tTBox::fY2Y of 2nd point
Double_tTPave::fY2NDCY2 point in NDC coordinates

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TPaveText()
 pavetext default constructor.
TPaveText(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t* option = "br")
 PaveText normal constructor.

 A PaveText is a Pave with several lines of text

  option = "TR" Top and Right shadows are drawn.
  option = "TL" Top and Left shadows are drawn.
  option = "BR" Bottom and Right shadows are drawn.
  option = "BL" Bottom and Left shadows are drawn.

  If none of these four above options is specified the default the
  option "BR" will be used to draw the border. To produces a pave
  without any border it is enough to specify the option "NB" (no border).

  option = "NDC" x1,y1,x2,y2 are given in NDC
  option = "ARC" corners are rounded

 In case of option "ARC", the corner radius is specified
 via TPave::SetCornerRadius(rad) where rad is given in percent
 of the pave height (default value is 0.2).

 The individual text items are entered via AddText
 By default, text items inherits from the default pavetext AttText.
 A title can be added later to this pavetext via TPaveText::SetLabel.
~TPaveText()
 pavetext default destructor.
TPaveText(const TPaveText& pavetext)
 pavetext copy constructor.
TPaveText& operator=(const TPaveText& )
assignment operator
TBox * AddBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Add a new graphics box to this pavetext.
TLine * AddLine(Double_t x1 = 0, Double_t y1 = 0, Double_t x2 = 0, Double_t y2 = 0)
 Add a new graphics line to this pavetext.
TText * AddText(Double_t x1, Double_t y1, const char* label)
 Add a new Text line to this pavetext at given coordinates.
TText * AddText(const char* label)
 Add a new Text line to this pavetext.
void Clear(Option_t* option = "")
 Clear all lines in this pavetext.
void DeleteText()
 Delete text at the mouse position.
void Draw(Option_t* option = "")
 Draw this pavetext with its current attributes.
void DrawFile(const char* filename, Option_t* option = "")
 Draw lines in filename in this pavetext.
void EditText()
 Edit text at the mouse position.
TText * GetLine(Int_t number) const
 Get Pointer to line number in this pavetext.
TText * GetLineWith(const char* text) const
 Get Pointer to first containing string text in this pavetext.
TObject * GetObject(Double_t& ymouse, Double_t& yobj) const
 Get object pointed by the mouse in this pavetext.
Int_t GetSize() const
  return number of text lines (ignoring Tlines, etc)
void InsertLine()
 Add a new lineine at the mouse position.
void InsertText(const char* label)
 Add a new Text line at the mouse position.
void Paint(Option_t* option = "")
 Paint this pavetext with its current attributes.
void PaintPrimitives(Int_t mode)
 Paint list of primitives in this pavetext.
void Print(Option_t* option = "") const
 Dump this pavetext with its attributes.
void ReadFile(const char* filename, Option_t* option = "", Int_t nlines = 50, Int_t fromline = 0)
 Read lines of filename in this pavetext.

  Read from line number fromline a total of nlines

  Note that this function changes the default text alignment to left/center
void SaveLines(ostream& out, const char* name)
 Save lines of this pavetext as C++ statements on output stream out
void SavePrimitive(ostream& out, Option_t* option = "")
 Save primitive as a C++ statement(s) on output stream out
void SetAllWith(const char* text, Option_t* option, Double_t value)
 Set attribute option for all lines containing string text.

 Possible options are all the AttText attributes
       Align, Color, Font, Size and Angle
void Streamer(TBuffer& )
 Stream an object of class TPaveText.
void UseCurrentStyle()
 Replace current attributes by current style.
const char * GetLabel() const
{return fLabel.Data();}
TList * GetListOfLines() const
{return fLines;}
Float_t GetMargin() const
{return fMargin;}
void SetLabel(const char* label)
{fLabel = label;}
void SetMargin(Float_t margin = 0.050000000000000003)
{fMargin=margin;}