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 ()
 
 FWEnumParameterSetter (const FWEnumParameterSetter &)=delete
 
TGComboBox * getWidget ()
 
const FWEnumParameterSetteroperator= (const FWEnumParameterSetter &)=delete
 
void setEnabled (bool) override
 
 ~FWEnumParameterSetter () override
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
 FWParameterSetterBase (const FWParameterSetterBase &)=delete
 
const FWParameterSetterBaseoperator= (const FWParameterSetterBase &)=delete
 
virtual ~FWParameterSetterBase ()
 

Private Member Functions

void attach (FWParameterBase *) override
 

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 )
delete

Member Function Documentation

◆ attach()

void FWEnumParameterSetter::attach ( FWParameterBase iParam)
overrideprivatevirtual

Implements FWParameterSetterBase.

Definition at line 57 of file FWEnumParameterSetter.cc.

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

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

◆ build()

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

Implements FWParameterSetterBase.

Definition at line 62 of file FWEnumParameterSetter.cc.

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

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 }
FWParameterSetterEditorBase * frame() const
const std::string & name() const
char const * label
const std::map< Long_t, std::string > & entryMap() const

◆ doUpdate()

void FWEnumParameterSetter::doUpdate ( Int_t  id)

Definition at line 91 of file FWEnumParameterSetter.cc.

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

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

◆ getWidget()

TGComboBox* FWEnumParameterSetter::getWidget ( )
inline

Definition at line 48 of file FWEnumParameterSetter.h.

References m_widget.

48 { return m_widget; }

◆ operator=()

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

◆ setEnabled()

void FWEnumParameterSetter::setEnabled ( bool  x)
overridevirtual

Reimplemented from FWParameterSetterBase.

Definition at line 98 of file FWEnumParameterSetter.cc.

References m_widget, and x.

98 { m_widget->SetEnabled(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().