Logo ROOT   6.08/07
Reference Guide
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 #ifndef ROOT_TPave
17 #include "TPave.h"
18 #endif
19 #ifndef ROOT_TText
20 #include "TText.h"
21 #endif
22 #ifndef ROOT_TLine
23 #include "TLine.h"
24 #endif
25 
26 
27 class TPaveText : public TPave, public TAttText {
28 
29 protected:
30  TString fLabel; ///< Label written at the top of the pavetext
31  Int_t fLongest; ///< Length of the longest line
32  Float_t fMargin; ///< Text margin
33  TList *fLines; ///< List of labels
34 
35 
36 public:
37  TPaveText();
38  TPaveText(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, Option_t *option="br");
39  TPaveText(const TPaveText &pavetext);
40  virtual ~TPaveText();
41  TPaveText& operator=(const TPaveText&);
42 
43  virtual TBox *AddBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
44  virtual TLine *AddLine(Double_t x1=0, Double_t y1=0, Double_t x2=0, Double_t y2=0);
45  virtual TText *AddText(Double_t x1, Double_t y1, const char *label);
46  virtual TText *AddText(const char *label);
47  virtual void Clear(Option_t *option=""); // *MENU*
48  virtual void DeleteText(); // *MENU*
49  virtual void Draw(Option_t *option="");
50  virtual void DrawFile(const char *filename, Option_t *option="");
51  virtual void EditText(); // *MENU*
52  const char *GetLabel() const {return fLabel.Data();}
53  virtual TText *GetLine(Int_t number) const;
54  virtual TText *GetLineWith(const char *text) const;
55  virtual TList *GetListOfLines() const {return fLines;}
56  Float_t GetMargin() const {return fMargin;}
57  virtual TObject *GetObject(Double_t &ymouse, Double_t &yobj) const;
58  virtual Int_t GetSize() const;
59  virtual void InsertLine(); // *MENU*
60  virtual void InsertText(const char *label); // *MENU*
61  virtual void Paint(Option_t *option="");
62  virtual void PaintPrimitives(Int_t mode);
63  virtual void Print(Option_t *option="") const;
64  virtual void ReadFile(const char *filename, Option_t *option="", Int_t nlines=50, Int_t fromline=0); // *MENU*
65  virtual void SaveLines(std::ostream &out, const char *name);
66  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
67  virtual void SetAllWith(const char *text, Option_t *option, Double_t value); // *MENU*
68  virtual void SetLabel(const char *label) {fLabel = label;} // *MENU*
69  virtual void SetMargin(Float_t margin=0.05) {fMargin=margin;} // *MENU*
70  virtual void UseCurrentStyle();
71 
72  ClassDef(TPaveText,2) //PaveText. A Pave with several lines of text.
73 };
74 
75 #endif
76 
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:68
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
float Float_t
Definition: RtypesCore.h:53
Float_t fMargin
Text margin.
Definition: TPaveText.h:32
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:36
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
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
virtual void InsertText(const char *label)
Add a new Text line at the mouse position.
Definition: TPaveText.cxx:376
Float_t GetMargin() const
Definition: TPaveText.h:56
A TBox with a bordersize and a shadow option.
Definition: TPave.h:23
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
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void Paint(Option_t *option="")
Paint this pavetext with its current attributes.
Definition: TPaveText.cxx:392
virtual Int_t GetSize() const
return number of text lines (ignoring TLine, etc)
Definition: TPaveText.cxx:345
TList * fLines
List of labels.
Definition: TPaveText.h:33
TString fLabel
Label written at the top of the pavetext.
Definition: TPaveText.h:30
virtual TText * GetLine(Int_t number) const
Get Pointer to line number in this pavetext.
Definition: TPaveText.cxx:252
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:33
virtual ~TPaveText()
pavetext default destructor.
Definition: TPaveText.cxx:93
const char * GetLabel() const
Definition: TPaveText.h:52
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
Length of the longest line.
Definition: TPaveText.h:31
A doubly linked list.
Definition: TList.h:47
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
virtual TText * GetLineWith(const char *text) const
Get Pointer to first containing string text in this pavetext.
Definition: TPaveText.cxx:267
Text Attributes class.
Definition: TAttText.h:24
virtual TObject * GetObject(Double_t &ymouse, Double_t &yobj) const
Get object pointed by the mouse in this pavetext.
Definition: TPaveText.cxx:280
A simple line.
Definition: TLine.h:33
virtual TList * GetListOfLines() const
Definition: TPaveText.h:55
static const double x1[5]
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:27
double Double_t
Definition: RtypesCore.h:55
TText * text
virtual void Print(Option_t *option="") const
Dump this pavetext with its attributes.
Definition: TPaveText.cxx:566
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void PaintPrimitives(Int_t mode)
Paint list of primitives in this pavetext.
Definition: TPaveText.cxx:403
TPaveText & operator=(const TPaveText &)
assignment operator
Definition: TPaveText.cxx:118
TPaveText()
pavetext default constructor.
Definition: TPaveText.cxx:50
char name[80]
Definition: TGX11.cxx:109
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:69
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
const char * Data() const
Definition: TString.h:349