CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWStringParameterSetter Class Reference

#include <FWStringParameterSetter.h>

Inheritance diagram for FWStringParameterSetter:
FWParameterSetterBase

List of all members.

Public Member Functions

virtual void attach (FWParameterBase *)
virtual TGFrame * build (TGFrame *iParent, bool labelBack=true)
void doUpdate ()
 FWStringParameterSetter ()
virtual ~FWStringParameterSetter ()

Private Member Functions

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

Private Attributes

FWStringParameterm_param
TGTextEntry * m_widget

Detailed Description

Definition at line 20 of file FWStringParameterSetter.h.


Constructor & Destructor Documentation

FWStringParameterSetter::FWStringParameterSetter ( )

Definition at line 35 of file FWStringParameterSetter.cc.

                                                 :
   m_param(0),
   m_widget(0)
{
}
FWStringParameterSetter::~FWStringParameterSetter ( ) [virtual]

Definition at line 46 of file FWStringParameterSetter.cc.

{
}
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.

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

Implements FWParameterSetterBase.

Definition at line 74 of file FWStringParameterSetter.cc.

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

{
   TGCompositeFrame* frame = new TGHorizontalFrame(iParent,180,20,kFixedWidth);

   m_widget = new TGTextEntry(frame, m_param->name().c_str(), 0);
   m_widget->SetText( m_param->value().c_str() );
   m_widget->Connect("ReturnPressed()", "FWStringParameterSetter", this, "doUpdate()");
   // label
   TGLabel* label = new TGLabel(frame,m_param->name().c_str());
   if (labelBack)
   {
      frame->AddFrame(m_widget, new TGLayoutHints(kLHintsExpandX|kLHintsCenterY,2,2,1,1));
      frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY,4,2,1,1) );
   }
   else
   {
      frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY) );
      frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,8,2,2));
   }
   return frame;
}
void FWStringParameterSetter::doUpdate ( )

Definition at line 97 of file FWStringParameterSetter.cc.

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

{
   assert(0!=m_param);
   assert(0!=m_widget);
   m_param->set(m_widget->GetText());
   update();
}
const FWStringParameterSetter& FWStringParameterSetter::operator= ( const FWStringParameterSetter ) [private]

Member Data Documentation

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