Main Page
Namespaces
Classes
Package Documentation
src
Fireworks
Core
src
FWBoolParameterSetter.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: Core
4
// Class : FWBoolParameterSetter
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
// Original Author: Chris Jones
10
// Created: Mon Mar 10 11:22:32 CDT 2008
11
//
12
13
// system include files
14
15
#include "TGButton.h"
16
#include <cassert>
17
#include <iostream>
18
19
// user include files
20
#include "
Fireworks/Core/src/FWBoolParameterSetter.h
"
21
22
//
23
// constants, enums and typedefs
24
//
25
26
//
27
// static data member definitions
28
//
29
30
//
31
// constructors and destructor
32
//
33
FWBoolParameterSetter::FWBoolParameterSetter
() :
34
m_param(
nullptr
),
35
m_widget(
nullptr
)
36
{
37
}
38
39
// FWBoolParameterSetter::FWBoolParameterSetter(const FWBoolParameterSetter& rhs)
40
// {
41
// // do actual copying here;
42
// }
43
44
FWBoolParameterSetter::~FWBoolParameterSetter
()
45
{
46
}
47
48
//
49
// assignment operators
50
//
51
// const FWBoolParameterSetter& FWBoolParameterSetter::operator=(const FWBoolParameterSetter& rhs)
52
// {
53
// //An exception safe implementation is
54
// FWBoolParameterSetter temp(rhs);
55
// swap(rhs);
56
//
57
// return *this;
58
// }
59
60
//
61
// member functions
62
//
63
64
void
65
FWBoolParameterSetter::attach
(
FWParameterBase
* iParam)
66
{
67
m_param
=
dynamic_cast<
FWBoolParameter
*
>
(iParam);
68
assert(
nullptr
!=
m_param
);
69
}
70
71
TGFrame*
72
FWBoolParameterSetter::build
(TGFrame* iParent,
bool
/*labelBack*/
)
73
{
74
TGCompositeFrame*
frame
=
new
TGHorizontalFrame(iParent);
75
76
m_widget
=
new
TGCheckButton(frame,
m_param
->
name
().c_str(), 0);
77
m_widget
->SetState(
m_param
->
value
() ? kButtonDown : kButtonUp );
78
m_widget
->Connect(
"Clicked()"
,
"FWBoolParameterSetter"
,
this
,
"doUpdate()"
);
79
frame->AddFrame(
m_widget
,
new
TGLayoutHints(kLHintsLeft|kLHintsCenterY,2,0,1,1));
80
return
frame
;
81
}
82
83
void
84
FWBoolParameterSetter::setEnabled
(
bool
x
)
85
{
86
m_widget
->SetEnabled(x);
87
}
88
89
void
90
FWBoolParameterSetter::doUpdate
()
91
{
92
assert(
nullptr
!=
m_param
);
93
assert(
nullptr
!=
m_widget
);
94
m_param
->
set
(
m_widget
->IsOn());
95
update
();
96
}
97
//
98
// const member functions
99
//
100
101
//
102
// static member functions
103
//
frame
Definition:
G4muDarkBremsstrahlungModel.h:27
FWParameterBase
Definition:
FWParameterBase.h:31
FWBoolParameterSetter::doUpdate
void doUpdate()
Definition:
FWBoolParameterSetter.cc:90
FWParameterSetterBase::frame
FWParameterSetterEditorBase * frame() const
Definition:
FWParameterSetterBase.h:52
nullptr
#define nullptr
Definition:
GCC11Compatibility.h:37
FWBoolParameterSetter::build
TGFrame * build(TGFrame *iParent, bool labelBack=true) override
Definition:
FWBoolParameterSetter.cc:72
FWBoolParameterSetter::FWBoolParameterSetter
FWBoolParameterSetter()
Definition:
FWBoolParameterSetter.cc:33
FWBoolParameterSetter::attach
void attach(FWParameterBase *) override
Definition:
FWBoolParameterSetter.cc:65
FWBoolParameterSetter::m_widget
TGCheckButton * m_widget
Definition:
FWBoolParameterSetter.h:55
FWGenericParameter
Definition:
FWGenericParameter.h:31
FWGenericParameter::set
void set(T iValue)
Definition:
FWGenericParameter.h:86
FWGenericParameter::value
T value() const
Definition:
FWGenericParameter.h:63
FWParameterSetterBase::update
void update() const
Definition:
FWParameterSetterBase.cc:83
DDAxes::x
FWBoolParameterSetter.h
FWBoolParameterSetter::setEnabled
void setEnabled(bool) override
Definition:
FWBoolParameterSetter.cc:84
FWBoolParameterSetter::m_param
FWBoolParameter * m_param
Definition:
FWBoolParameterSetter.h:54
FWBoolParameterSetter::~FWBoolParameterSetter
~FWBoolParameterSetter() override
Definition:
FWBoolParameterSetter.cc:44
FWParameterBase::name
const std::string & name() const
Definition:
FWParameterBase.h:40
Generated for CMSSW Reference Manual by
1.8.11