Scope
scope::gui::CScopeCheckBoxCtrl Class Reference

#include <ScopeCheckBoxCtrl.h>

Inherits CWindowImpl< CScopeCheckBoxCtrl, CButton >.

Public Member Functions

CScopeCheckBoxCtrl (ScopeValue< bool > *_scopeval, const bool &_connectback=false, const bool &_connectcontrolstate=false)
 
 ~CScopeCheckBoxCtrl ()
 
bool AttachToDlgItem (HWND hWnd)
 
void SetState (const bool &state)
 
Called via Win32 messages
void OnReflectedCommand (UINT uNotifyCode, int nID, CWindow wndCtl)
 
LRESULT OnKeyDown (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnKeyUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnKillFocus (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnUpdateControl (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
These send async Win32 messages
void UpdateControl ()
 
void UpdateValue ()
 

Protected Attributes

bool created
 
ScopeValue< bool > *const scope_val
 
bool shiftstate
 
boost::signals2::connection stateconnection
 
boost::signals2::connection valueconnection
 

Detailed Description

An adapted CButton control as checkbox around a ScopeValue<bool>.

Warning
Needs message reflection in containing (dialog) window via REFLECT_NOTIFICATIONS()

Definition at line 11 of file ScopeCheckBoxCtrl.h.

Constructor & Destructor Documentation

scope::gui::CScopeCheckBoxCtrl::CScopeCheckBoxCtrl ( ScopeValue< bool > *  _scopeval,
const bool &  _connectback = false,
const bool &  _connectcontrolstate = false 
)

()

Gets a pointer to the ScopeValue<bool> and connects if desired

Parameters
[in]_scopevalScopeValue<bool> to which the check box control connects (taken by reference)
[in]_connectbackchange check box check when ScopeValue is changed
[in]_connectcontrolstatechange check box enabled/disabled state when read/write state of the ScopeValue is changed

Definition at line 7 of file ScopeCheckBoxCtrl.cpp.

scope::gui::CScopeCheckBoxCtrl::~CScopeCheckBoxCtrl ( )

Disconnects.

Definition at line 17 of file ScopeCheckBoxCtrl.cpp.

Member Function Documentation

bool scope::gui::CScopeCheckBoxCtrl::AttachToDlgItem ( HWND  hWnd)

Attach the control to a dialog item.

Definition at line 22 of file ScopeCheckBoxCtrl.cpp.

void scope::gui::CScopeCheckBoxCtrl::OnReflectedCommand ( UINT  uNotifyCode,
int  nID,
CWindow  wndCtl 
)

Updates value on reflected BN_CLICKED.

Definition at line 31 of file ScopeCheckBoxCtrl.cpp.

LRESULT scope::gui::CScopeCheckBoxCtrl::OnKeyDown ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)

Switches to next control on return or tab and updates ScopeValue scope_val Also sets state of shift key.

Definition at line 37 of file ScopeCheckBoxCtrl.cpp.

LRESULT scope::gui::CScopeCheckBoxCtrl::OnKeyUp ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)

Resets state of shift key.

Definition at line 51 of file ScopeCheckBoxCtrl.cpp.

LRESULT scope::gui::CScopeCheckBoxCtrl::OnKillFocus ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)

Update scope_val when leaving focus.

Definition at line 59 of file ScopeCheckBoxCtrl.cpp.

LRESULT scope::gui::CScopeCheckBoxCtrl::OnUpdateControl ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)

Worker for UpdateControl.

Definition at line 64 of file ScopeCheckBoxCtrl.cpp.

void scope::gui::CScopeCheckBoxCtrl::UpdateControl ( )

Updates the string inside the control from the ScopeValues' value.

Do this asynchronously, thus Gui thread does the updating in OnUpdateControl and ScopeController (or whatever) thread can immediatly continue.

Definition at line 73 of file ScopeCheckBoxCtrl.cpp.

void scope::gui::CScopeCheckBoxCtrl::UpdateValue ( )

Updates the ScopeValue from the string inside the control.

Definition at line 77 of file ScopeCheckBoxCtrl.cpp.

void scope::gui::CScopeCheckBoxCtrl::SetState ( const bool &  state)

Sets the enabled/disabled state of the control.

Definition at line 85 of file ScopeCheckBoxCtrl.cpp.

Member Data Documentation

bool scope::gui::CScopeCheckBoxCtrl::created
protected

true after window creation

Definition at line 16 of file ScopeCheckBoxCtrl.h.

ScopeValue<bool>* const scope::gui::CScopeCheckBoxCtrl::scope_val
protected

pointer to underlying ScopeValue

Definition at line 19 of file ScopeCheckBoxCtrl.h.

bool scope::gui::CScopeCheckBoxCtrl::shiftstate
protected

stores state of shift key

Definition at line 22 of file ScopeCheckBoxCtrl.h.

boost::signals2::connection scope::gui::CScopeCheckBoxCtrl::stateconnection
protected

The connection object for the control state (connection to the scopenum rw state change)

Definition at line 25 of file ScopeCheckBoxCtrl.h.

boost::signals2::connection scope::gui::CScopeCheckBoxCtrl::valueconnection
protected

The connection object for the control state (connection to the scope_val value change)

Definition at line 28 of file ScopeCheckBoxCtrl.h.


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