#if !defined(AFX_DYNAMICLED_H__397221C9_D6F5_40A5_8004_B83E7C55F5E8__INCLUDED_) #define AFX_DYNAMICLED_H__397221C9_D6F5_40A5_8004_B83E7C55F5E8__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // DynamicLED.h : header file // /* Original DynamicLED component by V. Girish. http://www.codeguru.com/controls/DynLED.html Modified for SerialTester to not blink, draw itself properly and to work as a custom control. */ ///////////////////////////////////////////////////////////////////////////// // CDynamicLED window class CDynamicLED : public CStatic { // Construction public: CDynamicLED(); // The constants needed to define the colours of the LED #define ID_LED_RED 2001 #define ID_LED_GREEN 2002 #define ID_LED_BLUE 2003 #define ID_LED_YELLOW 2004 // The constants needed to define the shape of the LED #define ID_SHAPE_ROUND 3001 #define ID_SHAPE_SQUARE 3002 // Attributes public: protected: CPen m_PenBright,m_PenDark; CBrush m_BrushBright,m_BrushDark,m_BrushCurrent; // This variable is used to store the shape and color // set by the user for resetting the led later UINT m_nID; UINT m_nShape; CWnd *m_pWnd; int m_nTimerInterval,m_nPrevTimerInterval; // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CDynamicLED) //}}AFX_VIRTUAL // Implementation public: bool bReversed; void Draw(CPaintDC *dc); void SwitchOn(); void SwitchOff(); void SetLED(UINT nIDColor, UINT nIDShape); bool m_bBright; virtual ~CDynamicLED(); static BOOL RegisterWindowClass(); // virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); private: // This function cannot be called directly from your dialog application. // Its used internally by this class to reset the LED again. void ResetLED(UINT nIDColor, UINT nIDShape, int nTimerInterval); // Generated message map functions protected: CBitmap m_Bitmap; protected: //{{AFX_MSG(CDynamicLED) afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DYNAMICLED_H__397221C9_D6F5_40A5_8004_B83E7C55F5E8__INCLUDED_)