Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RText.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_RText
10#define ROOT7_RText
11
13#include <ROOT/RAttrText.hxx>
14#include <ROOT/RPadPos.hxx>
15
16#include <initializer_list>
17#include <string>
18
19namespace ROOT {
20namespace Experimental {
21
22/** \class ROOT::Experimental::RText
23\ingroup GrafROOT7
24\brief A text.
25\author Olivier Couet <Olivier.Couet@cern.ch>
26\date 2017-10-16
27\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is
28welcome!
29*/
30
31class RText : public ROnFrameDrawable {
32
33 std::string fText; ///< text to display
34 RPadPos fPos; ///< position
35
36public:
37 RAttrText text{this, "text"}; ///<! text attributes
38
39 RText() : ROnFrameDrawable("text") {}
40
41 RText(const std::string &txt) : RText() { fText = txt; }
42
43 RText(const RPadPos &p, const std::string &txt) : RText()
44 {
45 fText = txt;
46 fPos = p;
47 }
48
49 RText &SetText(const std::string &t) { fText = t; return *this; }
50 const std::string &GetText() const { return fText; }
51
52 RText &SetPos(const RPadPos &p) { fPos = p; return *this; }
53 const RPadPos &GetPos() const { return fPos; }
54};
55
56} // namespace Experimental
57} // namespace ROOT
58
59#endif
ROnFrameDrawable(const ROnFrameDrawable &)=delete
A position (horizontal and vertical) in a RPad.
Definition RPadPos.hxx:28
RText(const RPadPos &p, const std::string &txt)
Definition RText.hxx:43
RAttrText text
! text attributes
Definition RText.hxx:37
RText & SetText(const std::string &t)
Definition RText.hxx:49
RPadPos fPos
position
Definition RText.hxx:34
std::string fText
text to display
Definition RText.hxx:33
RText(const std::string &txt)
Definition RText.hxx:41
const std::string & GetText() const
Definition RText.hxx:50
RText & SetPos(const RPadPos &p)
Definition RText.hxx:52
const RPadPos & GetPos() const
Definition RText.hxx:53
TTree * t
Namespace for ROOT features in testing.
Definition TROOT.h:100
Small utility to parse cmdline options.
Definition RExports.h:71