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

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

Inheritance diagram for FWLongParameterSetter:
FWParameterSetterBase

Public Member Functions

virtual void attach (FWParameterBase *)
 
virtual TGFrame * build (TGFrame *iParent, bool labelBack=true)
 
void doUpdate (Long_t)
 
 FWLongParameterSetter ()
 
virtual ~FWLongParameterSetter ()
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
virtual void setEnabled (bool)
 
virtual ~FWParameterSetterBase ()
 

Private Member Functions

 FWLongParameterSetter (const FWLongParameterSetter &)
 
const FWLongParameterSetteroperator= (const FWLongParameterSetter &)
 

Private Attributes

FWLongParameterm_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 FWLongParameterSetter.h.

Constructor & Destructor Documentation

FWLongParameterSetter::FWLongParameterSetter ( )

Definition at line 36 of file FWLongParameterSetter.cc.

36  :
37  m_param(0),
38  m_widget(0)
39 {
40 }
FWLongParameterSetter::~FWLongParameterSetter ( )
virtual

Definition at line 47 of file FWLongParameterSetter.cc.

48 {
49 }
FWLongParameterSetter::FWLongParameterSetter ( const FWLongParameterSetter )
private

Member Function Documentation

void FWLongParameterSetter::attach ( FWParameterBase iParam)
virtual

Implements FWParameterSetterBase.

Definition at line 68 of file FWLongParameterSetter.cc.

References m_param.

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

Implements FWParameterSetterBase.

Definition at line 75 of file FWLongParameterSetter.cc.

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

76 {
77  TGCompositeFrame* frame = new TGHorizontalFrame(iParent);
78 
79  // number entry widget
80  TGNumberFormat::ELimit limits = m_param->min()==m_param->max() ?
81  TGNumberFormat::kNELNoLimits :
82  ( m_param->min() > m_param->max() ? TGNumberFormat::kNELLimitMin : TGNumberFormat::kNELLimitMinMax);
83  double min = 0;
84  double max = 1;
85  if(m_param->min()!=m_param->max()) {
86  min=m_param->min();
87  max=m_param->max();
88  }
89  m_widget = new TGNumberEntry
90  (frame, m_param->value(),
91  5, // number of digits
92  0, // widget ID
93  TGNumberFormat::kNESInteger, // style
94  TGNumberFormat::kNEAAnyNumber, // input value filter
95  limits, // specify limits
96  min, // min value
97  max); // max value
98 
99  m_widget->Connect("ValueSet(Long_t)", "FWLongParameterSetter", this, "doUpdate(Long_t)");
100 
101  // label
102  TGLabel* label = new TGLabel(frame, m_param->name().c_str());
103  if (labelBack)
104  {
105  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,6,2,2));
106  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2, 2, 0, 0));
107  }
108  else
109  {
110  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY) );
111  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,8,2,2));
112  }
113 
114  return frame;
115 }
const std::string & label
Definition: MVAComputer.cc:186
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 FWLongParameterSetter::doUpdate ( Long_t  )

Definition at line 118 of file FWLongParameterSetter.cc.

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

119 {
120  //std::cout <<"doUpdate called"<<std::endl;
121  assert(0!=m_param);
122  assert(0!=m_widget);
123  //std::cout <<m_widget->GetNumberEntry()->GetNumber()<<std::endl;
124  m_param->set(m_widget->GetNumberEntry()->GetIntNumber());
125  update();
126 }
const FWLongParameterSetter& FWLongParameterSetter::operator= ( const FWLongParameterSetter )
private

Member Data Documentation

FWLongParameter* FWLongParameterSetter::m_param
private

Definition at line 54 of file FWLongParameterSetter.h.

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

TGNumberEntry* FWLongParameterSetter::m_widget
private

Definition at line 55 of file FWLongParameterSetter.h.

Referenced by build(), and doUpdate().