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

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

Inheritance diagram for FWEnumParameterSetter:
FWParameterSetterBase

Public Member Functions

virtual TGFrame * build (TGFrame *iParent, bool labelBack=true)
 
void doUpdate (Int_t id)
 
 FWEnumParameterSetter ()
 
TGComboBox * getWidget ()
 
virtual void setEnabled (bool)
 
virtual ~FWEnumParameterSetter ()
 
- Public Member Functions inherited from FWParameterSetterBase
void attach (FWParameterBase *, FWParameterSetterEditorBase *)
 
 FWParameterSetterBase ()
 
virtual ~FWParameterSetterBase ()
 

Private Member Functions

virtual void attach (FWParameterBase *)
 
 FWEnumParameterSetter (const FWEnumParameterSetter &)
 
const FWEnumParameterSetteroperator= (const FWEnumParameterSetter &)
 

Private Attributes

FWEnumParameterm_param
 
TGComboBox * 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 31 of file FWEnumParameterSetter.h.

Constructor & Destructor Documentation

FWEnumParameterSetter::FWEnumParameterSetter ( )

Definition at line 32 of file FWEnumParameterSetter.cc.

32  :
33  m_param(0),
34  m_widget(0)
35 {}
FWEnumParameterSetter::~FWEnumParameterSetter ( )
virtual

Definition at line 42 of file FWEnumParameterSetter.cc.

43 {}
FWEnumParameterSetter::FWEnumParameterSetter ( const FWEnumParameterSetter )
private

Member Function Documentation

void FWEnumParameterSetter::attach ( FWParameterBase iParam)
privatevirtual

Implements FWParameterSetterBase.

Definition at line 62 of file FWEnumParameterSetter.cc.

References m_param.

63 {
64  m_param = dynamic_cast<FWEnumParameter*>(iParam);
65  assert(0!=m_param);
66 }
TGFrame * FWEnumParameterSetter::build ( TGFrame *  iParent,
bool  labelBack = true 
)
virtual

Implements FWParameterSetterBase.

Definition at line 69 of file FWEnumParameterSetter.cc.

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

70 {
71  TGCompositeFrame *frame = new TGHorizontalFrame(iParent);
72 
73  m_widget = new TGComboBox(frame);
74  std::map<Long_t, std::string>::const_iterator me = m_param->entryMap().begin();
75  UInt_t max_len = 0;
76  while (me != m_param->entryMap().end())
77  {
78  m_widget->AddEntry(me->second.c_str(), static_cast<Int_t>(me->first));
79  if (me->second.length() > max_len) max_len = me->second.length();
80  ++me;
81  }
82  m_widget->Resize(8*max_len + 20, 20);
83  m_widget->Select(static_cast<Int_t>(m_param->value()), kFALSE);
84 
85  m_widget->Connect("Selected(Int_t)", "FWEnumParameterSetter", this, "doUpdate(Int_t)");
86 
87  // label
88  TGLabel* label = new TGLabel(frame, m_param->name().c_str());
89  if (labelBack)
90  {
91  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,6,2,2));
92  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2, 4, 0, 0));
93  }
94  else
95  {
96  frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY) );
97  frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,8,2,2));
98  }
99  return frame;
100 }
FWParameterSetterEditorBase * frame() const
const std::map< Long_t, std::string > & entryMap() const
const std::string & name() const
void FWEnumParameterSetter::doUpdate ( Int_t  id)

Definition at line 103 of file FWEnumParameterSetter.cc.

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

104 {
105  assert(0!=m_param);
106  assert(0!=m_widget);
107  m_param->set((Long_t) id);
108  update();
109 }
TGComboBox* FWEnumParameterSetter::getWidget ( )
inline

Definition at line 50 of file FWEnumParameterSetter.h.

References m_widget.

50 { return m_widget; }
const FWEnumParameterSetter& FWEnumParameterSetter::operator= ( const FWEnumParameterSetter )
private
void FWEnumParameterSetter::setEnabled ( bool  x)
virtual

Reimplemented from FWParameterSetterBase.

Definition at line 112 of file FWEnumParameterSetter.cc.

References m_widget.

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

113 {
114  m_widget->SetEnabled(x);
115 }
Definition: DDAxes.h:10

Member Data Documentation

FWEnumParameter* FWEnumParameterSetter::m_param
private

Definition at line 60 of file FWEnumParameterSetter.h.

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

TGComboBox* FWEnumParameterSetter::m_widget
private

Definition at line 61 of file FWEnumParameterSetter.h.

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