Scope
|
#include <ScopeSliderCtrl.h>
Inherits CWindowImpl< CScopeSliderCtrl, CTrackBarCtrl >.
Public Member Functions | |
* | CScopeSliderCtrl (ScopeNumber< double > *_scopenum, const double &_increment=0, const bool &_connectback=false, const bool &_connectcontrolstate=false) |
~CScopeSliderCtrl () | |
BOOL | AttachToDlgItem (HWND hWnd) |
void | SetState (const bool &state) |
Called via Win32 messages | |
LRESULT | OnKeyDown (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) |
LRESULT | OnKeyUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) |
void | OnScroll (UINT nSBCode, UINT nPos, CScrollBar pScrollBar) |
LRESULT | OnUpdateControl (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) |
These send async Win32 messages | |
/** | |
void | UpdateControl () |
Protected Attributes | |
bool | created |
ScopeNumber< double > *const | scopenum |
boost::signals2::connection | stateconnection |
boost::signals2::connection | valueconnection |
const double | increment |
const double | scalefactor |
const double | offset |
const int32_t | rangehigh |
const int32_t | rangelow |
bool | shiftstate |
An adapted CTrackBarCtrl control around a ScopeNumber<double>.
Implements a slider control, either with incremental or continuous value changes.
ScopeNumber = slider * scalefactor + offset viceversa slider = (ScopeNumber - offset) / scalefactor
If not incrementing we have only 10 ticks (although we slider positions from 0...100)
Definition at line 13 of file ScopeSliderCtrl.h.
scope::gui::CScopeSliderCtrl::CScopeSliderCtrl | ( | ScopeNumber< double > * | _scopenum, |
const double & | _increment = 0 , |
||
const bool & | _connectback = false , |
||
const bool & | _connectcontrolstate = false |
||
) |
()
Gets a pointer to the ScopeNumber<double> and connects if desired
[in] | _scopenum | ScopeNumber to which the slider connects |
[in] | _increment | discrete increment of underlying ScopeNumber or 0 for (nearly) continuous changing of the ScopeNumber (slider range is 0-100 and converted accordingly) |
[in] | _connectback | change slider value when ScopeNumber is changed |
[in] | _connectcontrolstate | change slider enabled/disabled state when read/write state is set at the ScopeNumber |
Definition at line 8 of file ScopeSliderCtrl.cpp.
scope::gui::CScopeSliderCtrl::~CScopeSliderCtrl | ( | ) |
Disconnects everything.
Definition at line 22 of file ScopeSliderCtrl.cpp.
BOOL scope::gui::CScopeSliderCtrl::AttachToDlgItem | ( | HWND | hWnd | ) |
Attach the control to a dialog item and set range and tick frequency.
Definition at line 27 of file ScopeSliderCtrl.cpp.
LRESULT scope::gui::CScopeSliderCtrl::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 49 of file ScopeSliderCtrl.cpp.
LRESULT scope::gui::CScopeSliderCtrl::OnKeyUp | ( | UINT | uMsg, |
WPARAM | wParam, | ||
LPARAM | lParam, | ||
BOOL & | bHandled | ||
) |
Resets state of shift key.
Definition at line 61 of file ScopeSliderCtrl.cpp.
void scope::gui::CScopeSliderCtrl::OnScroll | ( | UINT | nSBCode, |
UINT | nPos, | ||
CScrollBar | pScrollBar | ||
) |
Updates the ScopeNumber from the slider position.
Definition at line 39 of file ScopeSliderCtrl.cpp.
LRESULT scope::gui::CScopeSliderCtrl::OnUpdateControl | ( | UINT | uMsg, |
WPARAM | wParam, | ||
LPARAM | lParam, | ||
BOOL & | bHandled | ||
) |
Worker for UpdateControl.
Definition at line 69 of file ScopeSliderCtrl.cpp.
void scope::gui::CScopeSliderCtrl::UpdateControl | ( | ) |
Updates the slider position from the ScopeNumber.
Definition at line 75 of file ScopeSliderCtrl.cpp.
void scope::gui::CScopeSliderCtrl::SetState | ( | const bool & | state | ) |
Sets the enabled/disabled control state.
Definition at line 79 of file ScopeSliderCtrl.cpp.
|
protected |
true if window created
Definition at line 18 of file ScopeSliderCtrl.h.
|
protected |
Pointer to the underlying ScopeNumber.
Definition at line 21 of file ScopeSliderCtrl.h.
|
protected |
The connection object for the control state (connection to the scopenum rw state change)
Definition at line 24 of file ScopeSliderCtrl.h.
|
protected |
The connection object for the control state (connection to the scopenum value change)
Definition at line 27 of file ScopeSliderCtrl.h.
|
protected |
if != 0, then scopenum can only be changed by multiples of increment and the slider should display tick marks accordingly
Definition at line 30 of file ScopeSliderCtrl.h.
|
protected |
scalefactor is increment or range/100 (if not incrementing)
Definition at line 33 of file ScopeSliderCtrl.h.
|
protected |
is ScopeNumber lower limit
Definition at line 36 of file ScopeSliderCtrl.h.
|
protected |
the upper end of the slider range (100 if not incrementing, otherwise range/increment)
Definition at line 39 of file ScopeSliderCtrl.h.
|
protected |
lower end of the slider range, usually 0
Definition at line 42 of file ScopeSliderCtrl.h.
|
protected |
stores state of shift key
Definition at line 45 of file ScopeSliderCtrl.h.