CMS 3D CMS Logo

List of all members | Public Member Functions | Private 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 () override
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
virtual void setEnabled (bool)
 
virtual ~FWParameterSetterBase ()
 

Private Member Functions

 FWStringParameterSetter (const FWStringParameterSetter &)=delete
 
const FWStringParameterSetteroperator= (const FWStringParameterSetter &)=delete
 

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

Member Function Documentation

◆ attach()

void FWStringParameterSetter::attach ( FWParameterBase iParam)
overridevirtual

Implements FWParameterSetterBase.

Definition at line 59 of file FWStringParameterSetter.cc.

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

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

◆ build()

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

Implements FWParameterSetterBase.

Definition at line 64 of file FWStringParameterSetter.cc.

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 }

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

◆ doUpdate()

void FWStringParameterSetter::doUpdate ( )

Definition at line 82 of file FWStringParameterSetter.cc.

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

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

◆ operator=()

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

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().

cms::cuda::assert
assert(be >=bs)
FWGenericParameter::set
void set(T iValue)
Definition: FWGenericParameter.h:70
FWParameterSetterBase::update
void update() const
Definition: FWParameterSetterBase.cc:74
FWParameterBase::name
const std::string & name() const
Definition: FWParameterBase.h:39
FWStringParameterSetter::m_param
FWStringParameter * m_param
Definition: FWStringParameterSetter.h:39
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
FWParameterSetterBase::frame
FWParameterSetterEditorBase * frame() const
Definition: FWParameterSetterBase.h:51
FWStringParameterSetter::m_widget
TGTextEntry * m_widget
Definition: FWStringParameterSetter.h:40
label
const char * label
Definition: PFTauDecayModeTools.cc:11