CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWEnumParameterSetter Class Reference

#include <Fireworks/Core/interface/FWEnumParameterSetter.h>

Inheritance diagram for FWEnumParameterSetter:
FWParameterSetterBase

Public Member Functions

TGFrame * build (TGFrame *iParent, bool labelBack=true) override
 
void doUpdate (Int_t id)
 
 FWEnumParameterSetter ()
 
TGComboBox * getWidget ()
 
void setEnabled (bool) override
 
 ~FWEnumParameterSetter () override
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
virtual ~FWParameterSetterBase ()
 

Private Member Functions

void attach (FWParameterBase *) override
 
 FWEnumParameterSetter (const FWEnumParameterSetter &)=delete
 
const FWEnumParameterSetteroperator= (const FWEnumParameterSetter &)=delete
 

Private Attributes

FWEnumParameterm_param
 
TGComboBox * m_widget
 

Additional Inherited Members

- Static Public Member Functions inherited from FWParameterSetterBase
static std::shared_ptr< FWParameterSetterBasemakeSetterFor (FWParameterBase *)
 
- Protected Member Functions inherited from FWParameterSetterBase
FWParameterSetterEditorBaseframe () const
 
void update () const
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 31 of file FWEnumParameterSetter.h.

Constructor & Destructor Documentation

◆ FWEnumParameterSetter() [1/2]

FWEnumParameterSetter::FWEnumParameterSetter ( )

Definition at line 32 of file FWEnumParameterSetter.cc.

32 : m_param(nullptr), m_widget(nullptr) {}

◆ ~FWEnumParameterSetter()

FWEnumParameterSetter::~FWEnumParameterSetter ( )
override

Definition at line 39 of file FWEnumParameterSetter.cc.

39 {}

◆ FWEnumParameterSetter() [2/2]

FWEnumParameterSetter::FWEnumParameterSetter ( const FWEnumParameterSetter )
privatedelete

Member Function Documentation

◆ attach()

void FWEnumParameterSetter::attach ( FWParameterBase iParam)
overrideprivatevirtual

Implements FWParameterSetterBase.

Definition at line 57 of file FWEnumParameterSetter.cc.

57  {
58  m_param = dynamic_cast<FWEnumParameter*>(iParam);
59  assert(nullptr != m_param);
60 }

References cms::cuda::assert(), and m_param.

◆ build()

TGFrame * FWEnumParameterSetter::build ( TGFrame *  iParent,
bool  labelBack = true 
)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 62 of file FWEnumParameterSetter.cc.

62  {
63  TGCompositeFrame* frame = new TGHorizontalFrame(iParent);
64 
65  m_widget = new TGComboBox(frame);
66  std::map<Long_t, std::string>::const_iterator me = m_param->entryMap().begin();
67  UInt_t max_len = 0;
68  while (me != m_param->entryMap().end()) {
69  m_widget->AddEntry(me->second.c_str(), static_cast<Int_t>(me->first));
70  if (me->second.length() > max_len)
71  max_len = me->second.length();
72  ++me;
73  }
74  m_widget->Resize(8 * max_len + 20, 20);
75  m_widget->Select(static_cast<Int_t>(m_param->value()), kFALSE);
76 
77  m_widget->Connect("Selected(Int_t)", "FWEnumParameterSetter", this, "doUpdate(Int_t)");
78 
79  // label
80  TGLabel* label = new TGLabel(frame, m_param->name().c_str());
81  if (labelBack) {
82  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 6, 2, 2));
83  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 4, 0, 0));
84  } else {
85  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
86  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 8, 2, 2));
87  }
88  return frame;
89 }

References FWEnumParameter::entryMap(), FWParameterSetterBase::frame(), label, m_param, m_widget, hlt_dqm_clientPB-live_cfg::me, FWParameterBase::name(), and FWGenericParameter< T >::value().

◆ doUpdate()

void FWEnumParameterSetter::doUpdate ( Int_t  id)

Definition at line 91 of file FWEnumParameterSetter.cc.

91  {
92  assert(nullptr != m_param);
93  assert(nullptr != m_widget);
94  m_param->set((Long_t)id);
95  update();
96 }

References cms::cuda::assert(), m_param, m_widget, FWGenericParameter< T >::set(), and FWParameterSetterBase::update().

◆ getWidget()

TGComboBox* FWEnumParameterSetter::getWidget ( )
inline

Definition at line 48 of file FWEnumParameterSetter.h.

48 { return m_widget; }

References m_widget.

◆ operator=()

const FWEnumParameterSetter& FWEnumParameterSetter::operator= ( const FWEnumParameterSetter )
privatedelete

◆ setEnabled()

void FWEnumParameterSetter::setEnabled ( bool  x)
overridevirtual

Reimplemented from FWParameterSetterBase.

Definition at line 98 of file FWEnumParameterSetter.cc.

98 { m_widget->SetEnabled(x); }

References m_widget, and x.

Member Data Documentation

◆ m_param

FWEnumParameter* FWEnumParameterSetter::m_param
private

Definition at line 58 of file FWEnumParameterSetter.h.

Referenced by attach(), build(), and doUpdate().

◆ m_widget

TGComboBox* FWEnumParameterSetter::m_widget
private

Definition at line 59 of file FWEnumParameterSetter.h.

Referenced by build(), doUpdate(), getWidget(), and setEnabled().

FWEnumParameter::entryMap
const std::map< Long_t, std::string > & entryMap() const
Definition: FWEnumParameter.h:55
cms::cuda::assert
assert(be >=bs)
FWGenericParameter::set
void set(T iValue)
Definition: FWGenericParameter.h:70
DDAxes::x
FWEnumParameterSetter::m_param
FWEnumParameter * m_param
Definition: FWEnumParameterSetter.h:58
FWParameterSetterBase::update
void update() const
Definition: FWParameterSetterBase.cc:74
FWParameterBase::name
const std::string & name() const
Definition: FWParameterBase.h:39
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
FWParameterSetterBase::frame
FWParameterSetterEditorBase * frame() const
Definition: FWParameterSetterBase.h:51
FWEnumParameterSetter::m_widget
TGComboBox * m_widget
Definition: FWEnumParameterSetter.h:59
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:56
label
const char * label
Definition: PFTauDecayModeTools.cc:11