test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWViewEnergyScaleEditor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWViewEnergyScaleEditor
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Alja Mrak-Tadel
10 // Created: Fri Sep 24 18:52:19 CEST 2010
11 //
12 
13 // system include files
14 
15 // user include files
16 #include "TGButton.h"
17 #include "TGLabel.h"
22 
23 
24 //
25 // constants, enums and typedefs
26 //
27 
28 //
29 // static data member definitions
30 //
31 
32 //
33 // constructors and destructor
34 //
35 FWViewEnergyScaleEditor::FWViewEnergyScaleEditor(FWViewEnergyScale* s, TGCompositeFrame* w, bool addAutoScaleControll):
36  TGVerticalFrame(w),
37  m_scale(s),
38  m_enabled(true)
39 {
42  addParam(&m_scale->m_fixedValToHeight, "FixedScaleMode");
43  if (addAutoScaleControll)
44  addParam(&m_scale->m_maxTowerHeight, "AutomaticScaleMode");
45 }
46 
47 
49 {
50 }
51 
52 
53 //
54 // member functions
55 //
56 void
58 {
59  m_enabled =x;
60  typedef std::vector<boost::shared_ptr<FWParameterSetterBase> > sList;
61  for (sList::iterator i = m_setters.begin(); i!=m_setters.end(); ++i)
62  {
63  (*i)->setEnabled(m_enabled);
64  }
65 }
66 
67 void
69 {
70  int leftPad = 0;
71  if (title)
72  {
73  leftPad = 10;
74  AddFrame(new TGLabel(this, title), new TGLayoutHints(kLHintsLeft, leftPad, 0, 0, 0));
75  leftPad *= 2;
76  }
77 
78  boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor(param) );
79  ptr->attach((FWParameterBase*)param, this);
80  TGFrame* pframe = ptr->build(this);
81  AddFrame(pframe, new TGLayoutHints(kLHintsLeft, leftPad, 0, 0, 0));
82  m_setters.push_back(ptr);
83 }
int i
Definition: DBlmapReader.cc:9
FWDoubleParameter m_fixedValToHeight
const double w
Definition: UKUtility.cc:23
FWBoolParameter m_plotEt
static boost::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
std::vector< boost::shared_ptr< FWParameterSetterBase > > m_setters
T x() const
Cartesian x coordinate.
FWDoubleParameter m_maxTowerHeight
FWEnumParameter m_scaleMode
FWViewEnergyScaleEditor(FWViewEnergyScale *s, TGCompositeFrame *w, bool addAutoScaleControll=true)
void addParam(FWParameterBase *, const char *title=0)