Scope
scope::ScopeButton Class Reference

#include <ScopeButton.h>

Inherited by scope::ScopeScanModeButton.

Public Member Functions

 ScopeButton (const std::wstring &_name=L"None")
 
 ScopeButton (const ScopeButton &sb)
 
std::wstring Name () const
 
bool Enabled () const
 
void Enable (const bool &state)
 
void Click ()
 
Handles connections to the signal for click and control state
boost::signals2::connection Connect (signalchange_t::slot_type slot)
 
boost::signals2::connection ConnectControlState (signalstate_t::slot_type slot)
 
void Disconnect (signalchange_t::slot_type slot)
 
void DisconnectControlState (signalstate_t::slot_type slot)
 

Protected Types

typedef boost::signals2::signal< void()> signalchange_t
 
typedef boost::signals2::signal< void(bool)> signalstate_t
 

Protected Attributes

const std::wstring name
 
bool enabled
 
signalchange_t m_changesig
 
signalstate_t m_ctrlstatesig
 

Detailed Description

Mimicks a button, glue between the GUI and controller, used in ScopeController.

Could have used a ScopeNumber<bool>?!

Definition at line 7 of file ScopeButton.h.

Member Typedef Documentation

typedef boost::signals2::signal<void ()> scope::ScopeButton::signalchange_t
protected

typedef for button click signal

Definition at line 21 of file ScopeButton.h.

typedef boost::signals2::signal<void (bool)> scope::ScopeButton::signalstate_t
protected

typedef for control state

Definition at line 24 of file ScopeButton.h.

Constructor & Destructor Documentation

scope::ScopeButton::ScopeButton ( const std::wstring &  _name = L"None")

Construct and enable.

Definition at line 6 of file ScopeButton.cpp.

scope::ScopeButton::ScopeButton ( const ScopeButton sb)

Copy constructor.

Definition at line 11 of file ScopeButton.cpp.

Member Function Documentation

std::wstring scope::ScopeButton::Name ( ) const
Returns
name of button

Definition at line 22 of file ScopeButton.cpp.

bool scope::ScopeButton::Enabled ( ) const
inline
Returns
true if currently enabled

Definition at line 43 of file ScopeButton.h.

void scope::ScopeButton::Enable ( const bool &  state)

Enable/disable button.

Definition at line 26 of file ScopeButton.cpp.

void scope::ScopeButton::Click ( )

Call signal.

Definition at line 31 of file ScopeButton.cpp.

boost::signals2::connection scope::ScopeButton::Connect ( signalchange_t::slot_type  slot)

Connect slot to signal.

Definition at line 35 of file ScopeButton.cpp.

boost::signals2::connection scope::ScopeButton::ConnectControlState ( signalstate_t::slot_type  slot)

Connect slot to control state signal.

Definition at line 39 of file ScopeButton.cpp.

void scope::ScopeButton::Disconnect ( signalchange_t::slot_type  slot)

Disconnect slot from signal.

Definition at line 43 of file ScopeButton.cpp.

void scope::ScopeButton::DisconnectControlState ( signalstate_t::slot_type  slot)

Disconnect slot from control state signal.

Definition at line 47 of file ScopeButton.cpp.

Member Data Documentation

const std::wstring scope::ScopeButton::name
protected

name of the control

Definition at line 15 of file ScopeButton.h.

bool scope::ScopeButton::enabled
protected

enabled/disabled status

Definition at line 18 of file ScopeButton.h.

signalchange_t scope::ScopeButton::m_changesig
protected

button click signal

Definition at line 27 of file ScopeButton.h.

signalstate_t scope::ScopeButton::m_ctrlstatesig
protected

control state signal

Definition at line 30 of file ScopeButton.h.


The documentation for this class was generated from the following files: