Logo ROOT  
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#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; ///< List of labels
28
29
30public:
31 TPaveText();
33 TPaveText(const TPaveText &pavetext);
34 virtual ~TPaveText();
36
37 virtual TBox *AddBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
38 virtual TLine *AddLine(Double_t x1=0, Double_t y1=0, Double_t x2=0, Double_t y2=0);
39 virtual TText *AddText(Double_t x1, Double_t y1, const char *label);
40 virtual TText *AddText(const char *label);
41 virtual void Clear(Option_t *option=""); // *MENU*
42 virtual void DeleteText(); // *MENU*
43 virtual void Draw(Option_t *option="");
44 virtual void DrawFile(const char *filename, Option_t *option="");
45 virtual void EditText(); // *MENU*
46 const char *GetLabel() const {return fLabel.Data();}
47 virtual TText *GetLine(Int_t number) const;
48 virtual TText *GetLineWith(const char *text) const;
49 virtual TList *GetListOfLines() const {return fLines;}
50 Float_t GetMargin() const {return fMargin;}
51 virtual TObject *GetObject(Double_t &ymouse, Double_t &yobj) const;
52 virtual Int_t GetSize() const;
53 virtual void InsertLine(); // *MENU*
54 virtual void InsertText(const char *label); // *MENU*
55 virtual void Paint(Option_t *option="");
56 virtual void PaintPrimitives(Int_t mode);
57 virtual void Print(Option_t *option="") const;
58 virtual void ReadFile(const char *filename, Option_t *option="", Int_t nlines=50, Int_t fromline=0); // *MENU*
59 virtual void SaveLines(std::ostream &out, const char *name, Bool_t saved);
60 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
61 virtual void SetAllWith(const char *text, Option_t *option, Double_t value); // *MENU*
62 virtual void SetLabel(const char *label) {fLabel = label;} // *MENU*
63 virtual void SetMargin(Float_t margin=0.05) {fMargin=margin;} // *MENU*
64 virtual void UseCurrentStyle();
65
66 ClassDef(TPaveText,2) //PaveText. A Pave with several lines of text.
67};
68
69#endif
70
int Int_t
Definition: CPyCppyy.h:43
static const double x2[5]
static const double x1[5]
bool Bool_t
Definition: RtypesCore.h:63
double Double_t
Definition: RtypesCore.h:59
float Float_t
Definition: RtypesCore.h:57
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
Text Attributes class.
Definition: TAttText.h:18
Create a Box.
Definition: TBox.h:22
A simple line.
Definition: TLine.h:22
A doubly linked list.
Definition: TList.h:44
Mother of all ROOT objects.
Definition: TObject.h:37
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:21
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:183
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Definition: TPaveText.cxx:234
Int_t fLongest
Length of the longest line.
Definition: TPaveText.h:25
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TPaveText.cxx:839
virtual Int_t GetSize() const
return number of text lines (ignoring TLine, etc)
Definition: TPaveText.cxx:362
TList * fLines
List of labels.
Definition: TPaveText.h:27
virtual void PaintPrimitives(Int_t mode)
Paint list of primitives in this pavetext.
Definition: TPaveText.cxx:420
const char * GetLabel() const
Definition: TPaveText.h:46
virtual void UseCurrentStyle()
Replace current attributes by current style.
Definition: TPaveText.cxx:925
virtual void SetMargin(Float_t margin=0.05)
Definition: TPaveText.h:63
TPaveText()
pavetext default constructor.
Definition: TPaveText.cxx:73
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:170
Float_t GetMargin() const
Definition: TPaveText.h:50
virtual void InsertText(const char *label)
Add a new Text line at the mouse position.
Definition: TPaveText.cxx:393
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:596
virtual void SetLabel(const char *label)
Definition: TPaveText.h:62
virtual void DrawFile(const char *filename, Option_t *option="")
Draw lines in filename in this pavetext.
Definition: TPaveText.cxx:246
virtual void EditText()
Edit text at the mouse position.
Definition: TPaveText.cxx:256
virtual void SetAllWith(const char *text, Option_t *option, Double_t value)
Set attribute option for all lines containing string text.
Definition: TPaveText.cxx:878
virtual TObject * GetObject(Double_t &ymouse, Double_t &yobj) const
Get object pointed by the mouse in this pavetext.
Definition: TPaveText.cxx:303
virtual void SaveLines(std::ostream &out, const char *name, Bool_t saved)
Save lines of this pavetext as C++ statements on output stream out.
Definition: TPaveText.cxx:675
virtual void DeleteText()
Delete text at the mouse position.
Definition: TPaveText.cxx:219
virtual ~TPaveText()
pavetext default destructor.
Definition: TPaveText.cxx:116
virtual void Paint(Option_t *option="")
Paint this pavetext with its current attributes.
Definition: TPaveText.cxx:409
TPaveText & operator=(const TPaveText &)
assignment operator
Definition: TPaveText.cxx:141
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:157
virtual TText * GetLine(Int_t number) const
Get Pointer to line number in this pavetext.
Definition: TPaveText.cxx:275
virtual void Clear(Option_t *option="")
Clear all lines in this pavetext.
Definition: TPaveText.cxx:209
TString fLabel
Label written at the top of the pavetext.
Definition: TPaveText.h:24
virtual void InsertLine()
Add a new line at the mouse position.
Definition: TPaveText.cxx:376
virtual TList * GetListOfLines() const
Definition: TPaveText.h:49
virtual void Print(Option_t *option="") const
Dump this pavetext with its attributes.
Definition: TPaveText.cxx:583
virtual TText * GetLineWith(const char *text) const
Get Pointer to first containing string text in this pavetext.
Definition: TPaveText.cxx:290
Float_t fMargin
Text margin.
Definition: TPaveText.h:26
A TBox with a bordersize and a shadow option.
Definition: TPave.h:19
Basic string class.
Definition: TString.h:136
const char * Data() const
Definition: TString.h:369
Base class for several text objects.
Definition: TText.h:22
TText * text
static const std::string name("name")