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 32 of file FWDoubleParameterSetter.h.

Constructor & Destructor Documentation

FWDoubleParameterSetter::FWDoubleParameterSetter ( )

Definition at line 34 of file FWDoubleParameterSetter.cc.

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

Definition at line 45 of file FWDoubleParameterSetter.cc.

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

Member Function Documentation

void FWDoubleParameterSetter::attach ( FWParameterBase iParam)
virtual

Implements FWParameterSetterBase.

Definition at line 66 of file FWDoubleParameterSetter.cc.

References m_param.

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

Implements FWParameterSetterBase.

Definition at line 73 of file FWDoubleParameterSetter.cc.

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

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

Definition at line 107 of file FWDoubleParameterSetter.cc.

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

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

Reimplemented from FWParameterSetterBase.

Definition at line 118 of file FWDoubleParameterSetter.cc.

References m_widget.

Referenced by Vispa.Views.PropertyView.BooleanProperty::setReadOnly(), and Vispa.Views.PropertyView.DropDownProperty::setReadOnly().

119 {
120  m_widget->SetState(x);
121 }
Definition: DDAxes.h:10

Member Data Documentation

FWDoubleParameter* FWDoubleParameterSetter::m_param
private

Definition at line 57 of file FWDoubleParameterSetter.h.

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

TGNumberEntry* FWDoubleParameterSetter::m_widget
private

Definition at line 58 of file FWDoubleParameterSetter.h.

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