ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPaveText //
19 // //
20 // PaveText A Pave with several lines of text. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TPave
25 #include "TPave.h"
26 #endif
27 #ifndef ROOT_TText
28 #include "TText.h"
29 #endif
30 #ifndef ROOT_TLine
31 #include "TLine.h"
32 #endif
33 
34 
35 class TPaveText : public TPave, public TAttText {
36 
37 protected:
38  TString fLabel; //Label written at the top of the pavetext
39  Int_t fLongest; //Length of the longest line
40  Float_t fMargin; //Text margin
41  TList *fLines; //List of labels
42 
43 
44 public:
45  TPaveText();
46  TPaveText(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, Option_t *option="br");
47  TPaveText(const TPaveText &pavetext);
48  virtual ~TPaveText();
49  TPaveText& operator=(const TPaveText&);
50 
51  virtual TBox *AddBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
52  virtual TLine *AddLine(Double_t x1=0, Double_t y1=0, Double_t x2=0, Double_t y2=0);
53  virtual TText *AddText(Double_t x1, Double_t y1, const char *label);
54  virtual TText *AddText(const char *label);
55  virtual void Clear(Option_t *option=""); // *MENU*
56  virtual void DeleteText(); // *MENU*
57  virtual void Draw(Option_t *option="");
58  virtual void DrawFile(const char *filename, Option_t *option="");
59  virtual void EditText(); // *MENU*
60  const char *GetLabel() const {return fLabel.Data();}
61  virtual TText *GetLine(Int_t number) const;
62  virtual TText *GetLineWith(const char *text) const;
63  virtual TList *GetListOfLines() const {return fLines;}
64  Float_t GetMargin() const {return fMargin;}
65  virtual TObject *GetObject(Double_t &ymouse, Double_t &yobj) const;
66  virtual Int_t GetSize() const;
67  virtual void InsertLine(); // *MENU*
68  virtual void InsertText(const char *label); // *MENU*
69  virtual void Paint(Option_t *option="");
70  virtual void PaintPrimitives(Int_t mode);
71  virtual void Print(Option_t *option="") const;
72  virtual void ReadFile(const char *filename, Option_t *option="", Int_t nlines=50, Int_t fromline=0); // *MENU*
73  virtual void SaveLines(std::ostream &out, const char *name);
74  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
75  virtual void SetAllWith(const char *text, Option_t *option, Double_t value); // *MENU*
76  virtual void SetLabel(const char *label) {fLabel = label;} // *MENU*
77  virtual void SetMargin(Float_t margin=0.05) {fMargin=margin;} // *MENU*
78  virtual void UseCurrentStyle();
79 
80  ClassDef(TPaveText,2) //PaveText. A Pave with several lines of text.
81 };
82 
83 #endif
84 
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Definition: TPaveText.cxx:211
virtual void SetLabel(const char *label)
Definition: TPaveText.h:76
virtual TBox * AddBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Add a new graphics box to this pavetext.
Definition: TPaveText.cxx:134
ClassDef(TAttBBox2D, 0)
Float_t GetMargin() const
Definition: TPaveText.h:64
float Float_t
Definition: RtypesCore.h:53
const char * GetLabel() const
Definition: TPaveText.h:60
Float_t fMargin
Definition: TPaveText.h:40
const char Option_t
Definition: RtypesCore.h:62
virtual 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.
Definition: TPaveText.cxx:147
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TPaveText.cxx:813
Create a Box.
Definition: TBox.h:44
virtual void DeleteText()
Delete text at the mouse position.
Definition: TPaveText.cxx:196
virtual void UseCurrentStyle()
Replace current attributes by current style.
Definition: TPaveText.cxx:898
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition: TPaveText.cxx:160
static const char * filename()
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
virtual TList * GetListOfLines() const
Definition: TPaveText.h:63
virtual void InsertText(const char *label)
Add a new Text line at the mouse position.
Definition: TPaveText.cxx:376
A TBox with a bordersize and a shadow option.
Definition: TPave.h:31
const char * Data() const
Definition: TString.h:349
static const double x2[5]
virtual void DrawFile(const char *filename, Option_t *option="")
Draw lines in filename in this pavetext.
Definition: TPaveText.cxx:223
virtual void Paint(Option_t *option="")
Paint this pavetext with its current attributes.
Definition: TPaveText.cxx:392
TList * fLines
Definition: TPaveText.h:41
TString fLabel
Definition: TPaveText.h:38
virtual void Clear(Option_t *option="")
Clear all lines in this pavetext.
Definition: TPaveText.cxx:186
Base class for several text objects.
Definition: TText.h:42
virtual ~TPaveText()
pavetext default destructor.
Definition: TPaveText.cxx:93
virtual TObject * GetObject(Double_t &ymouse, Double_t &yobj) const
Get object pointed by the mouse in this pavetext.
Definition: TPaveText.cxx:280
virtual void ReadFile(const char *filename, Option_t *option="", Int_t nlines=50, Int_t fromline=0)
Read lines of filename in this pavetext.
Definition: TPaveText.cxx:579
Int_t fLongest
Definition: TPaveText.h:39
char * out
Definition: TBase64.cxx:29
A doubly linked list.
Definition: TList.h:47
virtual TText * GetLine(Int_t number) const
Get Pointer to line number in this pavetext.
Definition: TPaveText.cxx:252
virtual void InsertLine()
Add a new line at the mouse position.
Definition: TPaveText.cxx:359
virtual void EditText()
Edit text at the mouse position.
Definition: TPaveText.cxx:233
Text Attributes class.
Definition: TAttText.h:32
A simple line.
Definition: TLine.h:41
static const double x1[5]
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:35
double Double_t
Definition: RtypesCore.h:55
TText * text
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Int_t GetSize() const
return number of text lines (ignoring TLine, etc)
Definition: TPaveText.cxx:345
virtual void PaintPrimitives(Int_t mode)
Paint list of primitives in this pavetext.
Definition: TPaveText.cxx:403
float value
Definition: math.cpp:443
TPaveText & operator=(const TPaveText &)
assignment operator
Definition: TPaveText.cxx:118
virtual void Print(Option_t *option="") const
Dump this pavetext with its attributes.
Definition: TPaveText.cxx:566
virtual void SetAllWith(const char *text, Option_t *option, Double_t value)
Set attribute option for all lines containing string text.
Definition: TPaveText.cxx:851
virtual void SetMargin(Float_t margin=0.05)
Definition: TPaveText.h:77
virtual void SaveLines(std::ostream &out, const char *name)
Save lines of this pavetext as C++ statements on output stream out.
Definition: TPaveText.cxx:658
virtual TText * GetLineWith(const char *text) const
Get Pointer to first containing string text in this pavetext.
Definition: TPaveText.cxx:267