#include <Fireworks/Core/interface/FWEnumParameterSetter.h>
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 () |
Private Member Functions | |
virtual void | attach (FWParameterBase *) |
FWEnumParameterSetter (const FWEnumParameterSetter &) | |
const FWEnumParameterSetter & | operator= (const FWEnumParameterSetter &) |
Private Attributes | |
FWEnumParameter * | m_param |
TGComboBox * | m_widget |
Description: [one line class summary]
Usage: <usage>
Definition at line 32 of file FWEnumParameterSetter.h.
FWEnumParameterSetter::FWEnumParameterSetter | ( | ) |
Definition at line 32 of file FWEnumParameterSetter.cc.
FWEnumParameterSetter::~FWEnumParameterSetter | ( | ) | [virtual] |
Definition at line 42 of file FWEnumParameterSetter.cc.
{}
FWEnumParameterSetter::FWEnumParameterSetter | ( | const FWEnumParameterSetter & | ) | [private] |
void FWEnumParameterSetter::attach | ( | FWParameterBase * | iParam | ) | [private, virtual] |
Implements FWParameterSetterBase.
Definition at line 62 of file FWEnumParameterSetter.cc.
References m_param.
{ m_param = dynamic_cast<FWEnumParameter*>(iParam); assert(0!=m_param); }
TGFrame * FWEnumParameterSetter::build | ( | TGFrame * | iParent, |
bool | labelBack = true |
||
) | [virtual] |
Implements FWParameterSetterBase.
Definition at line 69 of file FWEnumParameterSetter.cc.
References FWEnumParameter::entryMap(), FWParameterSetterBase::frame(), label, m_param, m_widget, FWParameterBase::name(), and FWGenericParameter< T >::value().
{ TGCompositeFrame *frame = new TGHorizontalFrame(iParent); m_widget = new TGComboBox(frame); std::map<Long_t, std::string>::const_iterator me = m_param->entryMap().begin(); UInt_t max_len = 0; while (me != m_param->entryMap().end()) { m_widget->AddEntry(me->second.c_str(), static_cast<Int_t>(me->first)); if (me->second.length() > max_len) max_len = me->second.length(); ++me; } m_widget->Resize(8*max_len + 20, 20); m_widget->Select(static_cast<Int_t>(m_param->value()), kFALSE); m_widget->Connect("Selected(Int_t)", "FWEnumParameterSetter", this, "doUpdate(Int_t)"); // label TGLabel* label = new TGLabel(frame, m_param->name().c_str()); if (labelBack) { frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,6,2,2)); frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2, 4, 0, 0)); } else { frame->AddFrame(label, new TGLayoutHints(kLHintsLeft|kLHintsCenterY) ); frame->AddFrame(m_widget, new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,8,2,2)); } return frame; }
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().
TGComboBox* FWEnumParameterSetter::getWidget | ( | ) | [inline] |
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.
FWEnumParameter* FWEnumParameterSetter::m_param [private] |
Definition at line 61 of file FWEnumParameterSetter.h.
Referenced by attach(), build(), and doUpdate().
TGComboBox* FWEnumParameterSetter::m_widget [private] |
Definition at line 62 of file FWEnumParameterSetter.h.
Referenced by build(), doUpdate(), getWidget(), and setEnabled().