2 #include "ScopeSliderCtrl.h"
11 , increment(_increment)
12 , scalefactor((increment!=0)?increment:(scopenum->ul()-scopenum->ll()) / 100)
13 , offset(scopenum->ll())
14 , rangehigh((increment!=0)?static_cast<int32_t>((scopenum->ul()-scopenum->ll())/increment):100)
18 if ( _connectcontrolstate )
28 if ( SubclassWindow(hWnd) ) {
42 if ( nSBCode == SB_THUMBPOSITION )
45 if ( (nSBCode == SB_PAGEUP) || (nSBCode == SB_PAGEDOWN) || (nSBCode == SB_PAGELEFT) || (nSBCode == SB_PAGERIGHT) )
53 ::PostMessage(GetParent(), WM_NEXTDLGCTL,
shiftstate, 0L);
58 return DefWindowProc(uMsg, wParam, lParam);
66 return DefWindowProc(uMsg, wParam, lParam);
76 ::PostMessage(m_hWnd, WM_UPDATECONTROL, NULL, NULL);
void SetState(const bool &state)
Sets the enabled/disabled control state.
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.
boost::signals2::connection stateconnection
The connection object for the control state (connection to the scopenum rw state change) ...
bool created
true if window created
* CScopeSliderCtrl(ScopeNumber< double > *_scopenum, const double &_increment=0, const bool &_connectback=false, const bool &_connectcontrolstate=false)
()
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 OnKeyUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Resets state of shift key.
~CScopeSliderCtrl()
Disconnects everything.
const double offset
is ScopeNumber lower limit
This is the include file for standard system include files, or project specific include files that ar...
bool shiftstate
stores state of shift key
void OnScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)
Updates the ScopeNumber from the slider position.
const int32_t rangelow
lower end of the slider range, usually 0
boost::signals2::connection ConnectState(signalstate_t::slot_type slot)
Connect signal to slot for state changes.
const int32_t rangehigh
the upper end of the slider range (100 if not incrementing, otherwise range/increment) ...
const double scalefactor
scalefactor is increment or range/100 (if not incrementing)
void UpdateControl()
Updates the slider position from the ScopeNumber.
ScopeNumber< double > *const scopenum
Pointer to the underlying ScopeNumber.
Various helper functions and classes for Scope.
const double increment
if != 0, then scopenum can only be changed by multiples of increment and the slider should display ti...
boost::signals2::connection valueconnection
The connection object for the control state (connection to the scopenum value change) ...
BOOL AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item and set range and tick frequency.