Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB

  1. // ProgressBar.h : header file
  2. /////////////////////////////////////////////////////////////////////////////
  3. #ifndef _INCLUDE_PROGRESSBAR_H_
  4. #define _INCLUDE_PROGRESSBAR_H_
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CProgressBar - status bar progress control
  7. //
  8. // Copyright (c) Chris Maunder, 1997
  9. // Please feel free to use and distribute.
  10. class CProgressBar: public CProgressCtrl
  11. // Creates a ProgressBar in the status bar
  12. {
  13. public:
  14. CProgressBar();
  15. CProgressBar(LPCTSTR strMessage, int nSize=100, int MaxValue=100,
  16. BOOL bSmooth=FALSE, int nPane=0);
  17. ~CProgressBar();
  18. BOOL Create(LPCTSTR strMessage, int nSize=100, int MaxValue=100,
  19. BOOL bSmooth=FALSE, int nPane=0);
  20. DECLARE_DYNCREATE(CProgressBar)
  21. // operations
  22. public:
  23. BOOL SetRange(int nLower, int nUpper, int nStep = 1);
  24. BOOL SetText(LPCTSTR strMessage);
  25. BOOL SetSize(int nSize);
  26. COLORREF SetBarColour(COLORREF clrBar);
  27. COLORREF SetBkColour(COLORREF clrBk);
  28. int SetPos(int nPos);
  29. int OffsetPos(int nPos);
  30. int SetStep(int nStep);
  31. int StepIt();
  32. void Clear();
  33. BOOL SetPaneText(int nPane, LPCTSTR strText);
  34. // Overrides
  35. //{{AFX_VIRTUAL(CProgressBar)
  36. //}}AFX_VIRTUAL
  37. // implementation
  38. protected:
  39. int m_nSize; // Percentage size of control
  40. int m_nPane; // ID of status bar pane progress bar is to appear in
  41. CString m_strMessage; // Message to display to left of control
  42. CString m_strPrevText; // Previous text in status bar
  43. CRect m_Rect; // Dimensions of the whole thing
  44. CStatusBar *GetStatusBar();
  45. BOOL Resize();
  46. // Generated message map functions
  47. protected:
  48. //{{AFX_MSG(CProgressBar)
  49. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  50. //}}AFX_MSG
  51. DECLARE_MESSAGE_MAP()
  52. };
  53. #endif
  54. /////////////////////////////////////////////////////////////////////////////