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 // $Id: FWViewEnergyScaleEditor.cc,v 1.3 2012/08/01 00:41:36 amraktad Exp $
12 //
13 
14 // system include files
15 
16 // user include files
17 #include "TGButton.h"
18 #include "TGLabel.h"
23 
24 
25 //
26 // constants, enums and typedefs
27 //
28 
29 //
30 // static data member definitions
31 //
32 
33 //
34 // constructors and destructor
35 //
36 FWViewEnergyScaleEditor::FWViewEnergyScaleEditor(FWViewEnergyScale* s, TGCompositeFrame* w, bool addAutoScaleControll):
37  TGVerticalFrame(w),
38  m_scale(s),
39  m_enabled(true)
40 {
43  addParam(&m_scale->m_fixedValToHeight, "FixedScaleMode");
44  if (addAutoScaleControll)
45  addParam(&m_scale->m_maxTowerHeight, "AutomaticScaleMode");
46 }
47 
48 
50 {
51 }
52 
53 
54 //
55 // member functions
56 //
57 void
59 {
60  m_enabled =x;
61  typedef std::vector<boost::shared_ptr<FWParameterSetterBase> > sList;
62  for (sList::iterator i = m_setters.begin(); i!=m_setters.end(); ++i)
63  {
64  (*i)->setEnabled(m_enabled);
65  }
66 }
67 
68 void
70 {
71  int leftPad = 0;
72  if (title)
73  {
74  leftPad = 10;
75  AddFrame(new TGLabel(this, title), new TGLayoutHints(kLHintsLeft, leftPad, 0, 0, 0));
76  leftPad *= 2;
77  }
78 
79  boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor(param) );
80  ptr->attach((FWParameterBase*)param, this);
81  TGFrame* pframe = ptr->build(this);
82  AddFrame(pframe, new TGLayoutHints(kLHintsLeft, leftPad, 0, 0, 0));
83  m_setters.push_back(ptr);
84 }
int i
Definition: DBlmapReader.cc:9
FWDoubleParameter m_fixedValToHeight
FWBoolParameter m_plotEt
static boost::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
std::vector< boost::shared_ptr< FWParameterSetterBase > > m_setters
FWDoubleParameter m_maxTowerHeight
FWEnumParameter m_scaleMode
FWViewEnergyScaleEditor(FWViewEnergyScale *s, TGCompositeFrame *w, bool addAutoScaleControll=true)
void addParam(FWParameterBase *, const char *title=0)
T w() const
Definition: DDAxes.h:10