GradientProgressCtrl.h
上传用户:oadesign
上传日期:2013-12-25
资源大小:265k
文件大小:2k
源码类别:

进程与线程

开发平台:

Visual C++

  1. #if !defined(AFX_ENHPROGRESSCTRL_H__12909D73_C393_11D1_9FAE_8192554015AD__INCLUDED_)
  2. #define AFX_ENHPROGRESSCTRL_H__12909D73_C393_11D1_9FAE_8192554015AD__INCLUDED_
  3. #if _MSC_VER >= 1000
  4. #pragma once
  5. #endif // _MSC_VER >= 1000
  6. // GradientProgressCtrl.h : header file
  7. /*
  8. Modified by 谢红伟 2000.12
  9. 功能:渐变色进度条显示效果
  10. */
  11. //
  12. #include "MemDC.h"
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CGradientProgressCtrl window
  15. class CGradientProgressCtrl : public CProgressCtrl
  16. {
  17. // Construction
  18. public:
  19. CGradientProgressCtrl();
  20. // Attributes
  21. public:
  22. // Attributes
  23. void SetRange(int nLower, int nUpper);
  24. void SetRange32( int nLower, int nUpper );
  25. int SetPos(int nPos);
  26. int SetStep(int nStep);
  27. int StepIt(void);
  28. // Operations
  29. public:
  30. // Set Functions
  31. void SetTextColor(COLORREF color) {m_clrText = color;}
  32. void SetBkColor(COLORREF color)  {m_clrBkGround = color;}
  33. void SetStartColor(COLORREF color) {m_clrStart = color;}
  34. void SetEndColor(COLORREF color) {m_clrEnd = color;}
  35. // Show the percent caption
  36. void ShowPercent(BOOL bShowPercent = TRUE) {m_bShowPercent = bShowPercent;}
  37. // Get Functions
  38. COLORREF GetTextColor(void) {return m_clrText;}
  39. COLORREF GetBkColor(void)  {return m_clrBkGround;}
  40. COLORREF GetStartColor(void) {return m_clrStart;}
  41. COLORREF GetEndColor(void) {return m_clrEnd;}
  42. // Overrides
  43. // ClassWizard generated virtual function overrides
  44. //{{AFX_VIRTUAL(CGradientProgressCtrl)
  45. protected:
  46. //}}AFX_VIRTUAL
  47. // Implementation
  48. public:
  49. void Reposition();
  50. BOOL Create(CStatusBar * parent, UINT id, DWORD style);
  51. virtual ~CGradientProgressCtrl();
  52. // Generated message map functions
  53. protected:
  54. void DrawGradient(CPaintDC *pDC, const RECT &rectClient, const int &nMaxWidth, const BOOL &bVertical);
  55. int m_nLower, m_nUpper, m_nStep, m_nCurrentPosition;
  56. COLORREF m_clrStart, m_clrEnd, m_clrBkGround, m_clrText;
  57. BOOL m_bShowPercent;
  58. //{{AFX_MSG(CGradientProgressCtrl)
  59. afx_msg void OnPaint();
  60. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. private:
  64. BOOL setup(CStatusBar * parent, UINT id, CRect & r);
  65. };
  66. /////////////////////////////////////////////////////////////////////////////
  67. //{{AFX_INSERT_LOCATION}}
  68. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  69. #endif // !defined(AFX_ENHPROGRESSCTRL_H__12909D73_C393_11D1_9FAE_8192554015AD__INCLUDED_)