2 #include "ScopeCheckBoxCtrl.h"
13 if ( _connectcontrolstate )
23 if ( SubclassWindow(hWnd) ) {
32 if ( uNotifyCode == BN_CLICKED ) {
43 ::PostMessage(GetParent(), WM_NEXTDLGCTL,
shiftstate, 0L);
48 return DefWindowProc(uMsg, wParam, lParam);
56 return DefWindowProc(uMsg, wParam, lParam);
61 return DefWindowProc(uMsg, wParam, lParam);
67 SetCheck(BST_CHECKED);
69 SetCheck(BST_UNCHECKED);
74 ::PostMessage(m_hWnd, WM_UPDATECONTROL, NULL, NULL);
78 UINT state = GetCheck();
79 if ( state == BST_CHECKED )
81 if ( state == BST_UNCHECKED )
boost::signals2::connection ConnectGUI(signalchange_t::slot_type slot)
Connect signal to slot to GUI.
virtual T Set(const T &_v, const bool &_callguisignal=true, const bool &_callothersignal=true, const bool &_callatnochange=false)
Sets the value and calls both change signals if the value actually changed.
LRESULT OnKeyUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Resets state of shift key.
bool created
true after window creation
void SetState(const bool &state)
Sets the enabled/disabled state of the control.
boost::signals2::connection valueconnection
The connection object for the control state (connection to the scope_val value change) ...
void OnReflectedCommand(UINT uNotifyCode, int nID, CWindow wndCtl)
Updates value on reflected BN_CLICKED.
LRESULT 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 k...
LRESULT OnUpdateControl(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Worker for UpdateControl.
LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Update scope_val when leaving focus.
This is the include file for standard system include files, or project specific include files that ar...
* CScopeCheckBoxCtrl(ScopeValue< bool > *_scopeval, const bool &_connectback=false, const bool &_connectcontrolstate=false)
()
~CScopeCheckBoxCtrl()
Disconnects.
ScopeValue< bool > *const scope_val
pointer to underlying ScopeValue
bool shiftstate
stores state of shift key
boost::signals2::connection ConnectState(signalstate_t::slot_type slot)
Connect signal to slot for state changes.
bool AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item.
boost::signals2::connection stateconnection
The connection object for the control state (connection to the scopenum rw state change) ...
void UpdateValue()
Updates the ScopeValue from the string inside the control.
void UpdateControl()
Updates the string inside the control from the ScopeValues' value.