Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RFrameTitle.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_RFrameTitle
10#define ROOT7_RFrameTitle
11
12#include <ROOT/RDrawable.hxx>
13#include <ROOT/RAttrText.hxx>
14#include <ROOT/RAttrValue.hxx>
15#include <ROOT/RPadPos.hxx>
16
17#include <string>
18
19namespace ROOT {
20namespace Experimental {
21
22/** \class RFrameTitle
23\ingroup GrafROOT7
24\brief A title for the RFrame.
25\author Sergey Linev <s.linev@gsi.de>
26\date 2020-02-26
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 RFrameTitle final : public RDrawable {
32
33 std::string fText; ///< title to display
34
35protected:
36
37 bool IsFrameRequired() const final { return true; }
38
39public:
40
41 RAttrText text{this, "text", 0.07}; ///<! title text attributes
42 RAttrValue<RPadLength> margin{this, "margin", 0.02_normal}; ///<! title margin to frame
43 RAttrValue<RPadLength> height{this, "height", 0.05_normal}; ///<! title height
44
45 RFrameTitle() : RDrawable("title") {}
46
47 RFrameTitle(const std::string &txt) : RFrameTitle() { fText = txt; }
48
49 RFrameTitle &SetText(const std::string &t)
50 {
51 fText = t;
52 return *this;
53 }
54 const std::string &GetText() const { return fText; }
55};
56
57} // namespace Experimental
58} // namespace ROOT
59
60#endif
#define const
Definition Tailor.h:92
Template class to access single value from drawable or other attributes.
RDrawable(const RDrawable &)=delete
RFrameTitle(const std::string &txt)
bool IsFrameRequired() const final
const std::string & GetText() const
RAttrText text
! title text attributes
RFrameTitle & SetText(const std::string &t)
std::string fText
title to display
RAttrValue< RPadLength > margin
! title margin to frame
RAttrValue< RPadLength > height
! title height
TTree * t
Namespace for ROOT features in testing.
Definition TROOT.h:100
Small utility to parse cmdline options.
Definition RExports.h:71