Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:33

0001 /*************************************************************************
0002  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers.               *
0003  * All rights reserved.                                                  *
0004  *                                                                       *
0005  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0006  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0007  *************************************************************************/
0008 
0009 #ifndef ROOT7_RFrameTitle
0010 #define ROOT7_RFrameTitle
0011 
0012 #include <ROOT/RDrawable.hxx>
0013 #include <ROOT/RAttrText.hxx>
0014 #include <ROOT/RAttrValue.hxx>
0015 #include <ROOT/RPadPos.hxx>
0016 
0017 #include <string>
0018 
0019 namespace ROOT {
0020 namespace Experimental {
0021 
0022 /** \class RFrameTitle
0023 \ingroup GrafROOT7
0024 \brief A title for the RFrame.
0025 \author Sergey Linev <s.linev@gsi.de>
0026 \date 2020-02-26
0027 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is
0028 welcome!
0029 */
0030 
0031 class RFrameTitle final : public RDrawable {
0032 
0033    std::string fText;                                           ///< title to display
0034 
0035 protected:
0036 
0037    bool IsFrameRequired() const final { return true; }
0038 
0039 public:
0040 
0041    RAttrText text{this, "text", 0.07};                         ///<! title text attributes
0042    RAttrValue<RPadLength> margin{this, "margin", 0.02_normal}; ///<! title margin to frame
0043    RAttrValue<RPadLength> height{this, "height", 0.05_normal}; ///<! title height
0044 
0045    RFrameTitle() : RDrawable("title") {}
0046 
0047    RFrameTitle(const std::string &txt) : RFrameTitle() { fText = txt; }
0048 
0049    RFrameTitle &SetText(const std::string &t)
0050    {
0051       fText = t;
0052       return *this;
0053    }
0054    const std::string &GetText() const { return fText; }
0055 };
0056 
0057 } // namespace Experimental
0058 } // namespace ROOT
0059 
0060 #endif