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
FWDoubleParameterSetter Class Reference

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

Inheritance diagram for FWDoubleParameterSetter:
FWParameterSetterBase

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 ()
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
virtual ~FWParameterSetterBase ()
 

Private Member Functions

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

Private Attributes

FWDoubleParameterm_param
 
TGNumberEntry * 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

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.

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

Definition at line 46 of file FWDoubleParameterSetter.cc.

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

68 {
69  m_param = dynamic_cast<FWDoubleParameter*>(iParam);
70  assert(0!=m_param);
71 }
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, max(), FWGenericParameterWithRange< T >::max(), FWGenericParameterWithRange< T >::min(), min, FWParameterBase::name(), and FWGenericParameter< T >::value().

75 {
76  TGCompositeFrame* frame = new TGHorizontalFrame(iParent);
77 
78  // number entry widget
79  TGNumberFormat::ELimit limits = m_param->min()==m_param->max() ?
80  TGNumberFormat::kNELNoLimits :
81  ( m_param->min() > m_param->max() ? TGNumberFormat::kNELLimitMin : TGNumberFormat::kNELLimitMinMax);
82  double min = 0;
83  double max = 1;
84  if(m_param->min()!=m_param->max()) {
85  min=m_param->min();
86  max=m_param->max();
87  }
88  m_widget = new TGNumberEntry
89  (frame, m_param->value(),
90  5, // number of digits
91  0, // widget ID
92  TGNumberFormat::kNESReal, // style
93  TGNumberFormat::kNEAAnyNumber, // input value filter
94  limits, // specify limits
95  min, // min value
96  max); // max value
97 
98  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,8,2,2));
99  m_widget->Connect("ValueSet(Long_t)", "FWDoubleParameterSetter", this, "doUpdate(Long_t)");
100 
101  // label
102  frame->AddFrame(new TGLabel(frame,m_param->name().c_str()),
103  new TGLayoutHints(kLHintsLeft|kLHintsCenterY) );
104  return frame;
105 }
FWParameterSetterEditorBase * frame() const
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
const std::string & name() const
void FWDoubleParameterSetter::doUpdate ( Long_t  )

Definition at line 108 of file FWDoubleParameterSetter.cc.

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

109 {
110  //std::cout <<"doUpdate called"<<std::endl;
111  assert(0!=m_param);
112  assert(0!=m_widget);
113  //std::cout <<m_widget->GetNumberEntry()->GetNumber()<<std::endl;
114  m_param->set(m_widget->GetNumberEntry()->GetNumber());
115  update();
116 }
const FWDoubleParameterSetter& FWDoubleParameterSetter::operator= ( const FWDoubleParameterSetter )
private
void FWDoubleParameterSetter::setEnabled ( bool  x)
virtual

Member Data Documentation

FWDoubleParameter* FWDoubleParameterSetter::m_param
private

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