Scope
scope::gui::CScopeScrollbarCtrl Class Reference

#include <ScopeScrollbarCtrl.h>

Inherits CWindowImpl< CScopeScrollbarCtrl, CScrollBar >.

Public Member Functions

CScopeScrollbarCtrl (ScopeNumber< double > *_scopenum, const double &_smallincrement, const double &_largeincrement, const bool &_connectback=false, const bool &_connectcontrolstate=false)
 
 ~CScopeScrollbarCtrl ()
 
BOOL AttachToDlgItem (HWND hWnd)
 
void SetState (const bool &state)
 
void SetSmallIncrement (const double &incr)
 
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 (int nSBCode, short 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
 
double smallincrement
 
double largeincrement
 
bool shiftstate
 

Detailed Description

An adapted CScrollB ar control around a ScopeNumber<double>.

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

Definition at line 11 of file ScopeScrollbarCtrl.h.

Constructor & Destructor Documentation

scope::gui::CScopeScrollbarCtrl::CScopeScrollbarCtrl ( ScopeNumber< double > *  _scopenum,
const double &  _smallincrement,
const double &  _largeincrement,
const bool &  _connectback = false,
const bool &  _connectcontrolstate = false 
)

()

Gets a pointer to the ScopeNumber<double> and connects if desired

Parameters
[in]_scopenumScopeNumber to which the slider connects
[in]_smallincrementdiscrete increment of underlying ScopeNumber on scrollbar buttons or set to 0 for 1/100th of scopenum range
[in]_largeincrementdiscrete increment of underlying ScopeNumber on click into scrollbar or set to 0 for 1/20th of scopenum range
[in]_connectbackchange scrollbar value when ScopeNumber is changed
[in]_connectcontrolstatechange scrollbar enabled/disabled state when read/write state of the ScopeNumber is changed

Definition at line 9 of file ScopeScrollbarCtrl.cpp.

scope::gui::CScopeScrollbarCtrl::~CScopeScrollbarCtrl ( )

Disconnects everything.

Definition at line 20 of file ScopeScrollbarCtrl.cpp.

Member Function Documentation

BOOL scope::gui::CScopeScrollbarCtrl::AttachToDlgItem ( HWND  hWnd)

Attach the control to a dialog item and set range and tick frequency.

Definition at line 25 of file ScopeScrollbarCtrl.cpp.

LRESULT scope::gui::CScopeScrollbarCtrl::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 52 of file ScopeScrollbarCtrl.cpp.

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

Resets state of shift key.

Definition at line 64 of file ScopeScrollbarCtrl.cpp.

void scope::gui::CScopeScrollbarCtrl::OnScroll ( int  nSBCode,
short  nPos,
CScrollBar  pScrollBar 
)

Updates the ScopeNumber from the slider position.

Definition at line 35 of file ScopeScrollbarCtrl.cpp.

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

Worker for UpdateControl.

Definition at line 72 of file ScopeScrollbarCtrl.cpp.

void scope::gui::CScopeScrollbarCtrl::UpdateControl ( )

Updates the slider position from the ScopeNumber.

Definition at line 78 of file ScopeScrollbarCtrl.cpp.

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

Sets the enabled/disabled control state.

Definition at line 82 of file ScopeScrollbarCtrl.cpp.

void scope::gui::CScopeScrollbarCtrl::SetSmallIncrement ( const double &  incr)

Sets the small increment.

Definition at line 87 of file ScopeScrollbarCtrl.cpp.

Member Data Documentation

bool scope::gui::CScopeScrollbarCtrl::created
protected

true if window created

Definition at line 16 of file ScopeScrollbarCtrl.h.

ScopeNumber<double>* const scope::gui::CScopeScrollbarCtrl::scopenum
protected

pointer to underlying ScopeValue

Definition at line 19 of file ScopeScrollbarCtrl.h.

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

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

Definition at line 22 of file ScopeScrollbarCtrl.h.

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

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

Definition at line 25 of file ScopeScrollbarCtrl.h.

double scope::gui::CScopeScrollbarCtrl::smallincrement
protected

if != 0, then scopenum is changed by increment on click on scrollbar arrows, otherwise by range/100

Definition at line 28 of file ScopeScrollbarCtrl.h.

double scope::gui::CScopeScrollbarCtrl::largeincrement
protected

if != 0, then scopenum is changed by largeincrement on click inside scrollbar, otherwise by range/20

Definition at line 31 of file ScopeScrollbarCtrl.h.

bool scope::gui::CScopeScrollbarCtrl::shiftstate
protected

stores state of shift key

Definition at line 34 of file ScopeScrollbarCtrl.h.


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