Scope
ScopeProgressCtrl.cpp
1 #include "stdafx.h"
2 #include "ScopeProgressCtrl.h"
3 #include "helpers\helpers.h"
4 
5 namespace scope {
6  namespace gui {
7 
8 
10  : created(false)
11  , scopenum(_scopenum) {
13 }
14 
16  valueconnection.disconnect();
17 }
18 
20  if ( SubclassWindow(hWnd) ) {
21  created = true;
22  SetRange(0, 100);
23  UpdateControl();
24  return TRUE;
25  }
26  return FALSE;
27 }
28 
29 LRESULT CScopeProgressCtrl::OnUpdateControl(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
30  // Progress bar goes from 0 to 100
31  SetPos( round2i32(scopenum->Value()/(scopenum->ul()-scopenum->ll()) * 100.0) );
32  return 0;
33 }
34 
36  ::PostMessage(m_hWnd, WM_UPDATECONTROL, NULL, NULL);
37 }
38 
39 }
40 
41 }
boost::signals2::connection ConnectGUI(signalchange_t::slot_type slot)
Connect signal to slot to GUI.
* CScopeProgressCtrl(ScopeNumber< double > *_scopenum)
()
T Value() const
Definition: ScopeValue.h:46
void UpdateControl()
Updates the position from the ScopeNumber.
This is the include file for standard system include files, or project specific include files that ar...
bool created
true if window created
LRESULT OnUpdateControl(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Worker for UpdateControl.
ScopeNumber< double > *const scopenum
Pointer to the underlying ScopeNumber.
BOOL AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item and set range.
Various helper functions and classes for Scope.
boost::signals2::connection valueconnection
The connection object for the control state (connection to the scopenum value change) ...