Scope
ScopeLEDCtrl.h
1 #pragma once
2 
3 #include "helpers/ScopeNumber.h"
4 
5 namespace scope {
6  namespace gui {
7 
8 #define SCOPELED_OKONTRUE 0
9 #define SCOPELED_WARNINGONTRUE 1
10 
13  : public CBitmapButtonImpl<CScopeLEDCtrl> {
14 
15 protected:
18 
20  boost::signals2::connection valueconnection;
21 
25  const uint32_t style;
26 
28  static CImageList imagegreen;
29 
31  static CImageList imagered;
32 
34  static CImageList imagewarning;
35 
36 
37 public:
39  CScopeLEDCtrl(ScopeNumber<bool>* _scopebool, const uint32_t& _style = SCOPELED_WARNINGONTRUE);
40 
43 
45  void UpdateControl();
46 
48  void SetTrue();
49 
51  void SetFalse();
52 
54  void DoPaint(CDCHandle dc);
55 
57  bool AttachToDlgItem(HWND hWnd);
58 };
59 
60 }
61 }
void DoPaint(CDCHandle dc)
override of CBitmapButtonImpl DoPaint() in CBmpBtn class to erase background (otherwise weird overlay...
An adapted CBitmapButton control around a ScopeNumber to show true or false as green or red LED...
Definition: ScopeLEDCtrl.h:12
static CImageList imagewarning
image for warning LED
Definition: ScopeLEDCtrl.h:34
void SetFalse()
Sets LED to false.
bool AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item.
boost::signals2::connection valueconnection
The connection object for the control state (connection to the scopenum value change) ...
Definition: ScopeLEDCtrl.h:20
CScopeLEDCtrl(ScopeNumber< bool > *_scopebool, const uint32_t &_style=SCOPELED_WARNINGONTRUE)
Gets a pointer to the ScopeNumber and connects.
static CImageList imagered
image for red LED
Definition: ScopeLEDCtrl.h:31
void UpdateControl()
Sets LED according to value of scopebool.
void SetTrue()
Sets LED to true.
~CScopeLEDCtrl()
Disconnects.
static CImageList imagegreen
image for green LED
Definition: ScopeLEDCtrl.h:28
ScopeNumber< bool > *const scopebool
pointer to underlying ScopeNumber
Definition: ScopeLEDCtrl.h:17
const uint32_t style
the LED style
Definition: ScopeLEDCtrl.h:25