#include <Fireworks/Core/interface/FWLongParameterSetter.h>
Public Member Functions | |
virtual void | attach (FWParameterBase *) |
virtual TGFrame * | build (TGFrame *iParent, bool labelBack=true) |
void | doUpdate (Long_t) |
FWLongParameterSetter () | |
virtual | ~FWLongParameterSetter () |
Private Member Functions | |
FWLongParameterSetter (const FWLongParameterSetter &) | |
const FWLongParameterSetter & | operator= (const FWLongParameterSetter &) |
Private Attributes | |
FWLongParameter * | m_param |
TGNumberEntry * | m_widget |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 32 of file FWLongParameterSetter.h.
FWLongParameterSetter::FWLongParameterSetter | ( | ) |
Definition at line 36 of file FWLongParameterSetter.cc.
FWLongParameterSetter::~FWLongParameterSetter | ( | ) | [virtual] |
Definition at line 47 of file FWLongParameterSetter.cc.
{ }
FWLongParameterSetter::FWLongParameterSetter | ( | const FWLongParameterSetter & | ) | [private] |
void FWLongParameterSetter::attach | ( | FWParameterBase * | iParam | ) | [virtual] |
Implements FWParameterSetterBase.
Definition at line 68 of file FWLongParameterSetter.cc.
References m_param.
{ m_param = dynamic_cast<FWLongParameter*>(iParam); assert(0!=m_param); }
TGFrame * FWLongParameterSetter::build | ( | TGFrame * | iParent, |
bool | labelBack = true |
||
) | [virtual] |
Implements FWParameterSetterBase.
Definition at line 75 of file FWLongParameterSetter.cc.
References FWParameterSetterBase::frame(), diffTwoXMLs::label, m_param, m_widget, FWGenericParameterWithRange< T >::max(), max(), min, FWGenericParameterWithRange< T >::min(), FWParameterBase::name(), and FWGenericParameter< T >::value().
{ TGCompositeFrame* frame = new TGHorizontalFrame(iParent); // number entry widget TGNumberFormat::ELimit limits = m_param->min()==m_param->max() ? TGNumberFormat::kNELNoLimits : ( m_param->min() > m_param->max() ? TGNumberFormat::kNELLimitMin : TGNumberFormat::kNELLimitMinMax); double min = 0; double max = 1; if (m_param->min()!=m_param->max()) { min=m_param->min(); max=m_param->max(); } m_widget = new TGNumberEntry (frame, m_param->value(), 5, // number of digits 0, // widget ID TGNumberFormat::kNESInteger, // style TGNumberFormat::kNEAAnyNumber, // input value filter limits, // specify limits min, // min value max); // max value m_widget->Connect("ValueSet(Long_t)", "FWLongParameterSetter", this, "doUpdate(Long_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,2,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 FWLongParameterSetter::doUpdate | ( | Long_t | ) |
Definition at line 119 of file FWLongParameterSetter.cc.
References m_param, m_widget, FWGenericParameter< T >::set(), and FWParameterSetterBase::update().
{ //std::cout <<"doUpdate called"<<std::endl; // Idiotic TGNumberEntry arrow buttons can send several events and if // individual event processing takes longer it can happen that the widget // gets detroyed in the meantime. So, process all events from arrows as // soon as possible. static bool in_update = false; if (in_update) return; in_update = true; gClient->ProcessEventsFor((TGWindow*)gTQSender); in_update = false; assert(0!=m_param); assert(0!=m_widget); //std::cout <<m_widget->GetNumberEntry()->GetNumber()<<std::endl; m_param->set(m_widget->GetNumberEntry()->GetIntNumber()); update(); }
const FWLongParameterSetter& FWLongParameterSetter::operator= | ( | const FWLongParameterSetter & | ) | [private] |
FWLongParameter* FWLongParameterSetter::m_param [private] |
Definition at line 55 of file FWLongParameterSetter.h.
Referenced by attach(), build(), and doUpdate().
TGNumberEntry* FWLongParameterSetter::m_widget [private] |
Definition at line 56 of file FWLongParameterSetter.h.
Referenced by build(), and doUpdate().