CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWDoubleParameterSetter Class Reference

#include <Fireworks/Core/interface/FWDoubleParameterSetter.h>

Inheritance diagram for FWDoubleParameterSetter:
FWParameterSetterBase

List of all members.

Public Member Functions

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

Private Member Functions

 FWDoubleParameterSetter (const FWDoubleParameterSetter &)
const FWDoubleParameterSetteroperator= (const FWDoubleParameterSetter &)

Private Attributes

FWDoubleParameterm_param
TGNumberEntry * m_widget

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 33 of file FWDoubleParameterSetter.h.


Constructor & Destructor Documentation

FWDoubleParameterSetter::FWDoubleParameterSetter ( )

Definition at line 35 of file FWDoubleParameterSetter.cc.

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

Definition at line 46 of file FWDoubleParameterSetter.cc.

{
}
FWDoubleParameterSetter::FWDoubleParameterSetter ( const FWDoubleParameterSetter ) [private]

Member Function Documentation

void FWDoubleParameterSetter::attach ( FWParameterBase iParam) [virtual]

Implements FWParameterSetterBase.

Definition at line 67 of file FWDoubleParameterSetter.cc.

References m_param.

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

Implements FWParameterSetterBase.

Definition at line 74 of file FWDoubleParameterSetter.cc.

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

{
   TGCompositeFrame* frame = new TGHorizontalFrame(iParent);

   // number entry widget
   TGNumberFormat::ELimit limits = m_param->min()==m_param->max() ?
                                   TGNumberFormat::kNELNoLimits :
                                   ( m_param->min() > m_param->max() ? TGNumberFormat::kNELLimitMin : TGNumberFormat::kNELLimitMinMax);
   double min = 0;
   double max = 1;
   if(m_param->min()!=m_param->max()) {
      min=m_param->min();
      max=m_param->max();
   }
   m_widget = new TGNumberEntry
           (frame, m_param->value(),
           5,                         // number of digits
           0,                         // widget ID
           TGNumberFormat::kNESReal,  // style
           TGNumberFormat::kNEAAnyNumber, // input value filter
           limits,                    // specify limits
           min,                       // min value
           max);                      // max value

   frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,8,2,2));
   m_widget->Connect("ValueSet(Long_t)", "FWDoubleParameterSetter", this, "doUpdate(Long_t)");

   // label
   frame->AddFrame(new TGLabel(frame,m_param->name().c_str()),
                   new TGLayoutHints(kLHintsLeft|kLHintsCenterY) );
   return frame;
}
void FWDoubleParameterSetter::doUpdate ( Long_t  )

Definition at line 108 of file FWDoubleParameterSetter.cc.

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

{
   //std::cout <<"doUpdate called"<<std::endl;
   assert(0!=m_param);
   assert(0!=m_widget);
   //std::cout <<m_widget->GetNumberEntry()->GetNumber()<<std::endl;
   m_param->set(m_widget->GetNumberEntry()->GetNumber());
   update();
}
const FWDoubleParameterSetter& FWDoubleParameterSetter::operator= ( const FWDoubleParameterSetter ) [private]
void FWDoubleParameterSetter::setEnabled ( bool  x) [virtual]

Reimplemented from FWParameterSetterBase.

Definition at line 119 of file FWDoubleParameterSetter.cc.

References m_widget.

{
   m_widget->SetState(x);
}

Member Data Documentation

Definition at line 58 of file FWDoubleParameterSetter.h.

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

TGNumberEntry* FWDoubleParameterSetter::m_widget [private]

Definition at line 59 of file FWDoubleParameterSetter.h.

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