CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_ptr
< FWParameterSetterBase
makeSetterFor (FWParameterBase *)
 
- Protected Member Functions inherited from FWParameterSetterBase
FWParameterSetterEditorBaseframe () const
 
void update () const
 

Detailed Description

Definition at line 20 of file FWStringParameterSetter.h.

Constructor & Destructor Documentation

FWStringParameterSetter::FWStringParameterSetter ( )

Definition at line 35 of file FWStringParameterSetter.cc.

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

Definition at line 46 of file FWStringParameterSetter.cc.

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

Member Function Documentation

void FWStringParameterSetter::attach ( FWParameterBase iParam)
virtual

Implements FWParameterSetterBase.

Definition at line 67 of file FWStringParameterSetter.cc.

References m_param.

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

Implements FWParameterSetterBase.

Definition at line 74 of file FWStringParameterSetter.cc.

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

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

Definition at line 97 of file FWStringParameterSetter.cc.

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

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

Member Data Documentation

FWStringParameter* FWStringParameterSetter::m_param
private

Definition at line 42 of file FWStringParameterSetter.h.

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

TGTextEntry* FWStringParameterSetter::m_widget
private

Definition at line 43 of file FWStringParameterSetter.h.

Referenced by build(), and doUpdate().