Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "TGButton.h"
00018 #include "TGLabel.h"
00019 #include "Fireworks/Core/interface/FWViewEnergyScaleEditor.h"
00020 #include "Fireworks/Core/interface/FWEveView.h"
00021 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
00022 #include "Fireworks/Core/interface/FWParameterSetterBase.h"
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 FWViewEnergyScaleEditor::FWViewEnergyScaleEditor(FWViewEnergyScale* s, TGCompositeFrame* w, bool addAutoScaleControll):
00037 TGVerticalFrame(w),
00038 m_scale(s),
00039 m_enabled(true)
00040 {
00041 addParam(&m_scale->m_plotEt);
00042 addParam(&m_scale->m_scaleMode);
00043 addParam(&m_scale->m_fixedValToHeight, "FixedScaleMode");
00044 if (addAutoScaleControll)
00045 addParam(&m_scale->m_maxTowerHeight, "AutomaticScaleMode");
00046 }
00047
00048
00049 FWViewEnergyScaleEditor::~FWViewEnergyScaleEditor()
00050 {
00051 }
00052
00053
00054
00055
00056
00057 void
00058 FWViewEnergyScaleEditor::setEnabled(bool x)
00059 {
00060 m_enabled =x;
00061 typedef std::vector<boost::shared_ptr<FWParameterSetterBase> > sList;
00062 for (sList::iterator i = m_setters.begin(); i!=m_setters.end(); ++i)
00063 {
00064 (*i)->setEnabled(m_enabled);
00065 }
00066 }
00067
00068 void
00069 FWViewEnergyScaleEditor::addParam(FWParameterBase* param, const char* title)
00070 {
00071 int leftPad = 0;
00072 if (title)
00073 {
00074 leftPad = 10;
00075 AddFrame(new TGLabel(this, title), new TGLayoutHints(kLHintsLeft, leftPad, 0, 0, 0));
00076 leftPad *= 2;
00077 }
00078
00079 boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor(param) );
00080 ptr->attach((FWParameterBase*)param, this);
00081 TGFrame* pframe = ptr->build(this);
00082 AddFrame(pframe, new TGLayoutHints(kLHintsLeft, leftPad, 0, 0, 0));
00083 m_setters.push_back(ptr);
00084 }