home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / labs / c05 / lab06 / ex03 / progress.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.5 KB  |  60 lines

  1. // Progress.h : header file
  2. //
  3.  
  4. const int PROGRESS_CTRL_CX = 160;    // Default width of progress control
  5.  
  6. const int X_MARGIN = 5;    // X value used for margins 
  7.                         // and control spacing
  8. const int Y_MARGIN = 2;    // Y value used for margins 
  9.                         // and control spacing
  10.  
  11.  
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CProgressStatusBar window
  14.  
  15. class CProgressStatusBar : public CStatusBar
  16. {
  17. // Construction
  18. public:
  19.     CProgressStatusBar();
  20.  
  21. // Attributes
  22. public:
  23.     void SetProgressCtrlWidth(UINT nWidth = PROGRESS_CTRL_CX);
  24.     void SetProgressLabel(LPCSTR lpszProgressLabel);
  25.     CProgressCtrl * GetProgressCtrl() 
  26.                         { return &m_ProgressCtrl; }
  27.  
  28. // Operations
  29. public:
  30.     void ShowProgressDisplay(BOOL  bShow = TRUE);
  31.  
  32. // Overrides
  33.     // ClassWizard generated virtual function overrides
  34.     //{{AFX_VIRTUAL(CProgressStatusBar)
  35.     //}}AFX_VIRTUAL
  36.  
  37. // Implementation
  38. public:
  39.     virtual ~CProgressStatusBar();
  40.     void RecalcProgressDisplay();
  41.  
  42. // Generated message map functions
  43. protected:
  44.     //{{AFX_MSG(CProgressStatusBar)
  45.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  46.     afx_msg void OnPaint();
  47.     //}}AFX_MSG
  48.     DECLARE_MESSAGE_MAP()
  49.  
  50.         // Data Members
  51. protected:
  52.     CProgressCtrl    m_ProgressCtrl;            //    Embedded progress control
  53.     CStatic            m_ProgressLabel;        //    Text of the label
  54.     BOOL            m_bProgressMode;        //    TRUE when displaying the progress control
  55.     int                m_nProgressCtrlWidth;    //    Width of progress control
  56.  
  57. };
  58.  
  59. /////////////////////////////////////////////////////////////////////////////
  60.