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

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

Private Member Functions

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

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::FWStringParameterSetter ( )

Definition at line 34 of file FWStringParameterSetter.cc.

34  :
35  m_param(0),
36  m_widget(0)
37 {
38 }
FWStringParameterSetter::~FWStringParameterSetter ( )
virtual

Definition at line 45 of file FWStringParameterSetter.cc.

46 {
47 }
FWStringParameterSetter::FWStringParameterSetter ( const FWStringParameterSetter )
private

Member Function Documentation

void FWStringParameterSetter::attach ( FWParameterBase iParam)
virtual

Implements FWParameterSetterBase.

Definition at line 66 of file FWStringParameterSetter.cc.

References m_param.

67 {
68  m_param = dynamic_cast<FWStringParameter*>(iParam);
69  assert(0!=m_param);
70 }
TGFrame * FWStringParameterSetter::build ( TGFrame *  iParent,
bool  labelBack = true 
)
virtual

Implements FWParameterSetterBase.

Definition at line 73 of file FWStringParameterSetter.cc.

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

74 {
75  TGCompositeFrame* frame = new TGHorizontalFrame(iParent,180,20,kFixedWidth);
76 
77  m_widget = new TGTextEntry(frame, m_param->name().c_str(), 0);
78  m_widget->SetText( m_param->value().c_str() );
79  m_widget->Connect("ReturnPressed()", "FWStringParameterSetter", this, "doUpdate()");
80  // label
81  TGLabel* label = new TGLabel(frame,m_param->name().c_str());
82  if (labelBack)
83  {
84  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsExpandX|kLHintsCenterY,2,2,1,1));
85  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY,4,2,1,1) );
86  }
87  else
88  {
89  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY) );
90  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,8,2,2));
91  }
92  return frame;
93 }
FWParameterSetterEditorBase * frame() const
const std::string & name() const
void FWStringParameterSetter::doUpdate ( )

Definition at line 96 of file FWStringParameterSetter.cc.

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

97 {
98  assert(0!=m_param);
99  assert(0!=m_widget);
100  m_param->set(m_widget->GetText());
101  update();
102 }
const FWStringParameterSetter& FWStringParameterSetter::operator= ( const FWStringParameterSetter )
private

Member Data Documentation

FWStringParameter* FWStringParameterSetter::m_param
private

Definition at line 41 of file FWStringParameterSetter.h.

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

TGTextEntry* FWStringParameterSetter::m_widget
private

Definition at line 42 of file FWStringParameterSetter.h.

Referenced by build(), and doUpdate().