Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TPaveText.h
Go to the documentation of this file.
1// @(#)root/graf:$Id$
2// Author: Rene Brun 20/10/95
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_TPaveText
13#define ROOT_TPaveText
14
15
16#include "TPave.h"
17#include "TText.h"
18
19class TLine;
20
21class TPaveText : public TPave, public TAttText {
22
23protected:
24 TString fLabel; ///< Label written at the top of the pavetext
25 Int_t fLongest; ///< Length of the longest line
26 Float_t fMargin; ///< Text margin
27 TList *fLines{nullptr}; ///< List of labels
28
29public:
31 TPaveText(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, Option_t *option="br");
32 TPaveText(const TPaveText &pavetext);
33 ~TPaveText() override;
35
36 virtual TBox *AddBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
37 virtual TLine *AddLine(Double_t x1=0, Double_t y1=0, Double_t x2=0, Double_t y2=0);
38 virtual TText *AddText(Double_t x1, Double_t y1, const char *label);
39 virtual TText *AddText(const char *label);
40 void Clear(Option_t *option="") override; // *MENU*
41 virtual void DeleteText(); // *MENU*
42 void Draw(Option_t *option="") override;
43 virtual void DrawFile(const char *filename, Option_t *option="");
44 virtual void EditText(); // *MENU*
45 const char *GetLabel() const {return fLabel.Data();}
46 virtual TText *GetLine(Int_t number) const;
47 virtual TText *GetLineWith(const char *text) const;
48 virtual TList *GetListOfLines() const {return fLines;}
49 Float_t GetMargin() const {return fMargin;}
50 virtual TObject *GetObject(Double_t &ymouse, Double_t &yobj) const;
51 virtual Int_t GetSize() const;
52 virtual void InsertLine(); // *MENU*
53 virtual void InsertText(const char *label); // *MENU*
54 void Paint(Option_t *option="") override;
55 virtual void PaintPrimitives(Int_t mode);
56 void Print(Option_t *option="") const override;
57 virtual void ReadFile(const char *filename, Option_t *option="", Int_t nlines=50, Int_t fromline=0); // *MENU*
58 virtual void SaveLines(std::ostream &out, const char *name, Bool_t);
59 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
60 virtual void SetAllWith(const char *text, Option_t *option, Double_t value); // *MENU*
61 virtual void SetLabel(const char *label) {fLabel = label;} // *MENU*
62 virtual void SetMargin(Float_t margin=0.05) {fMargin=margin;} // *MENU*
63 void UseCurrentStyle() override;
64
65 ClassDefOverride(TPaveText,2) //PaveText. A Pave with several lines of text.
66};
67
68#endif
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:148
TBox()
Box default constructor.
Definition TBox.cxx:42
Use the TLine constructor to create a simple line.
Definition TLine.h:22
A doubly linked list.
Definition TList.h:38
TObject()
TObject constructor.
Definition TObject.h:259
virtual Int_t GetSize() const
virtual void DrawFile(const char *filename, Option_t *option="")
virtual void InsertText(const char *label)
Int_t fLongest
Length of the longest line.
Definition TPaveText.h:25
~TPaveText() override
virtual TText * GetLine(Int_t number) const
virtual TList * GetListOfLines() const
Definition TPaveText.h:48
const char * GetLabel() const
Definition TPaveText.h:45
TList * fLines
List of labels.
Definition TPaveText.h:27
TPaveText(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="br")
virtual void DeleteText()
virtual void SetMargin(Float_t margin=0.05)
Definition TPaveText.h:62
void Print(Option_t *option="") const override
Dump this pave with its attributes.
Float_t GetMargin() const
Definition TPaveText.h:49
virtual void InsertLine()
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
virtual void ReadFile(const char *filename, Option_t *option="", Int_t nlines=50, Int_t fromline=0)
virtual void EditText()
virtual void SetLabel(const char *label)
Definition TPaveText.h:61
virtual TText * AddText(const char *label)
virtual TLine * AddLine(Double_t x1=0, Double_t y1=0, Double_t x2=0, Double_t y2=0)
virtual void SaveLines(std::ostream &out, const char *name, Bool_t)
void Clear(Option_t *option="") override
TPaveText & operator=(const TPaveText &)
virtual TBox * AddBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void Draw(Option_t *option="") override
Draw this pave with its current attributes.
virtual void PaintPrimitives(Int_t mode)
virtual TObject * GetObject(Double_t &ymouse, Double_t &yobj) const
void Paint(Option_t *option="") override
Paint this pave with its current attributes.
TString fLabel
Label written at the top of the pavetext.
Definition TPaveText.h:24
virtual void SetAllWith(const char *text, Option_t *option, Double_t value)
TPaveText(const TPaveText &pavetext)
virtual TText * GetLineWith(const char *text) const
Float_t fMargin
Text margin.
Definition TPaveText.h:26
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
void UseCurrentStyle() override
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
TPave()
Pave default constructor.
Definition TPave.cxx:35
Basic string class.
Definition TString.h:138
Definition TText.h:22
TText * text