CMS 3D CMS Logo

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

#include <FWStringParameterSetter.h>

Inheritance diagram for FWStringParameterSetter:
FWParameterSetterBase

Public Member Functions

void attach (FWParameterBase *) override
 
TGFrame * build (TGFrame *iParent, bool labelBack=true) override
 
void doUpdate ()
 
 FWStringParameterSetter ()
 
 FWStringParameterSetter (const FWStringParameterSetter &)=delete
 
const FWStringParameterSetteroperator= (const FWStringParameterSetter &)=delete
 
 ~FWStringParameterSetter () override
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
 FWParameterSetterBase (const FWParameterSetterBase &)=delete
 
const FWParameterSetterBaseoperator= (const FWParameterSetterBase &)=delete
 
virtual void setEnabled (bool)
 
virtual ~FWParameterSetterBase ()
 

Private Attributes

FWStringParameterm_param
 
TGTextEntry * 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

Definition at line 19 of file FWStringParameterSetter.h.

Constructor & Destructor Documentation

◆ FWStringParameterSetter() [1/2]

FWStringParameterSetter::FWStringParameterSetter ( )

Definition at line 34 of file FWStringParameterSetter.cc.

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

◆ ~FWStringParameterSetter()

FWStringParameterSetter::~FWStringParameterSetter ( )
override

Definition at line 41 of file FWStringParameterSetter.cc.

41 {}

◆ FWStringParameterSetter() [2/2]

FWStringParameterSetter::FWStringParameterSetter ( const FWStringParameterSetter )
delete

Member Function Documentation

◆ attach()

void FWStringParameterSetter::attach ( FWParameterBase iParam)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 59 of file FWStringParameterSetter.cc.

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

59  {
60  m_param = dynamic_cast<FWStringParameter*>(iParam);
61  assert(nullptr != m_param);
62 }
assert(be >=bs)

◆ build()

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

Implements FWParameterSetterBase.

Definition at line 64 of file FWStringParameterSetter.cc.

References FWParameterSetterBase::frame(), label, m_param, m_widget, FWParameterBase::name(), and FWGenericParameter< T >::value().

64  {
65  TGCompositeFrame* frame = new TGHorizontalFrame(iParent, 180, 20, kFixedWidth);
66 
67  m_widget = new TGTextEntry(frame, m_param->name().c_str(), 0);
68  m_widget->SetText(m_param->value().c_str());
69  m_widget->Connect("ReturnPressed()", "FWStringParameterSetter", this, "doUpdate()");
70  // label
71  TGLabel* label = new TGLabel(frame, m_param->name().c_str());
72  if (labelBack) {
73  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 2, 1, 1));
74  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 4, 2, 1, 1));
75  } else {
76  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
77  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 8, 2, 2));
78  }
79  return frame;
80 }
FWParameterSetterEditorBase * frame() const
const std::string & name() const
char const * label

◆ doUpdate()

void FWStringParameterSetter::doUpdate ( )

Definition at line 82 of file FWStringParameterSetter.cc.

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

82  {
83  assert(nullptr != m_param);
84  assert(nullptr != m_widget);
85  m_param->set(m_widget->GetText());
86  update();
87 }
assert(be >=bs)

◆ operator=()

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

Member Data Documentation

◆ m_param

FWStringParameter* FWStringParameterSetter::m_param
private

Definition at line 39 of file FWStringParameterSetter.h.

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

◆ m_widget

TGTextEntry* FWStringParameterSetter::m_widget
private

Definition at line 40 of file FWStringParameterSetter.h.

Referenced by build(), and doUpdate().