Scope
ScopeButton.h
1 #pragma once
2 
3 namespace scope {
4 
7 class ScopeButton {
8 
9 private:
10  //ScopeButton(const ScopeButton& b);
11  //ScopeButton& operator=(const ScopeButton& b);
12 
13 protected:
15  const std::wstring name;
16 
18  bool enabled;
19 
21  typedef boost::signals2::signal<void ()> signalchange_t;
22 
24  typedef boost::signals2::signal<void (bool)> signalstate_t;
25 
27  signalchange_t m_changesig;
28 
30  signalstate_t m_ctrlstatesig;
31 
32 public:
34  ScopeButton(const std::wstring& _name = L"None");
35 
37  ScopeButton(const ScopeButton& sb);
38 
40  std::wstring Name() const;
41 
43  bool Enabled() const { return enabled; }
44 
46  void Enable(const bool& state);
47 
49  void Click();
50 
54  boost::signals2::connection Connect(signalchange_t::slot_type slot);
55 
57  boost::signals2::connection ConnectControlState(signalstate_t::slot_type slot);
58 
60  void Disconnect(signalchange_t::slot_type slot);
61 
63  void DisconnectControlState(signalstate_t::slot_type slot);
65 };
66 
67 }
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
void Enable(const bool &state)
Enable/disable button.
Definition: ScopeButton.cpp:26
boost::signals2::signal< void()> signalchange_t
typedef for button click signal
Definition: ScopeButton.h:21
boost::signals2::signal< void(bool)> signalstate_t
typedef for control state
Definition: ScopeButton.h:24
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
bool Enabled() const
Definition: ScopeButton.h:43