Scope
ScopeButton.cpp
1 #include "StdAfx.h"
2 #include "ScopeButton.h"
3 
4 namespace scope {
5 
6 ScopeButton::ScopeButton(const std::wstring& _name)
7  : name(_name)
8  , enabled(true) {
9 }
10 
12  : name(sb.name)
13  , enabled(sb.enabled) {
14 }
15 
16 /*ScopeButton operator=(const ScopeButton& sb) {
17  name = sb.name;
18  enabled = sb.enabled;
19  return *this;
20 }*/
21 
22 std::wstring ScopeButton::Name() const {
23  return name;
24 }
25 
26 void ScopeButton::Enable(const bool& state) {
27  enabled = state;
29 }
30 
32  m_changesig();
33 }
34 
35 boost::signals2::connection ScopeButton::Connect(signalchange_t::slot_type slot) {
36  return m_changesig.connect(slot);
37 }
38 
39 boost::signals2::connection ScopeButton::ConnectControlState(signalstate_t::slot_type slot) {
40  return m_ctrlstatesig.connect(slot);
41 }
42 
43 void ScopeButton::Disconnect(signalchange_t::slot_type slot) {
44  m_changesig.disconnect(&slot);
45 }
46 
47 void ScopeButton::DisconnectControlState(signalstate_t::slot_type slot) {
48  m_ctrlstatesig.disconnect(&slot);
49 }
50 
51 }
signalstate_t m_ctrlstatesig
control state signal
Definition: ScopeButton.h:30
std::wstring Name() const
Definition: ScopeButton.cpp:22
ScopeButton(const std::wstring &_name=L"None")
Construct and enable.
Definition: ScopeButton.cpp:6
bool enabled
enabled/disabled status
Definition: ScopeButton.h:18
void Click()
Call signal.
Definition: ScopeButton.cpp:31
const std::wstring name
name of the control
Definition: ScopeButton.h:15
This is the include file for standard system include files, or project specific include files that ar...
void Enable(const bool &state)
Enable/disable button.
Definition: ScopeButton.cpp:26
Mimicks a button, glue between the GUI and controller, used in ScopeController.
Definition: ScopeButton.h:7
void Disconnect(signalchange_t::slot_type slot)
Disconnect slot from signal.
Definition: ScopeButton.cpp:43
boost::signals2::connection Connect(signalchange_t::slot_type slot)
Connect slot to signal.
Definition: ScopeButton.cpp:35
signalchange_t m_changesig
button click signal
Definition: ScopeButton.h:27
void DisconnectControlState(signalstate_t::slot_type slot)
Disconnect slot from control state signal.
Definition: ScopeButton.cpp:47
boost::signals2::connection ConnectControlState(signalstate_t::slot_type slot)
Connect slot to control state signal.
Definition: ScopeButton.cpp:39