Scope
|
#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 |
An adapted CButton control as checkbox around a ScopeValue<bool>.
Definition at line 11 of file ScopeCheckBoxCtrl.h.
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
[in] | _scopeval | ScopeValue<bool> to which the check box control connects (taken by reference) |
[in] | _connectback | change check box check when ScopeValue is changed |
[in] | _connectcontrolstate | change 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.
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.
|
protected |
true after window creation
Definition at line 16 of file ScopeCheckBoxCtrl.h.
|
protected |
pointer to underlying ScopeValue
Definition at line 19 of file ScopeCheckBoxCtrl.h.
|
protected |
stores state of shift key
Definition at line 22 of file ScopeCheckBoxCtrl.h.
|
protected |
The connection object for the control state (connection to the scopenum rw state change)
Definition at line 25 of file ScopeCheckBoxCtrl.h.
|
protected |
The connection object for the control state (connection to the scope_val value change)
Definition at line 28 of file ScopeCheckBoxCtrl.h.