-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgressBar.h
98 lines (86 loc) · 3.03 KB
/
ProgressBar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// ProgressBar.h : header file
//
// Drop-in status bar progress control
//
// Written by Chris Maunder ([email protected])
// Copyright (c) 1998.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included. If
// the source code in this file is used in any commercial application
// then an email to me would be nice.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage to your
// computer, causes your pet cat to fall ill, increases baldness or
// makes you car start emitting strange noises when you start it up.
//
// Expect bugs.
//
// Please use and enjoy. Please let me know of any bugs/mods/improvements
// that you have found/implemented and I will fix/incorporate them into this
// file.
//
// Version 1.1 Chris Maunder ([email protected])
//
// Version 1.2 Michael Martin 07 Aug 1998 [email protected]
// Added code to enable progress bar to appear in any pane
// of the status bar.
//
// Chris Maunder 17 Aug 1998
// Fixed Pane text restoration, and general cleanup.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef _INCLUDE_PROGRESSBAR_H_
#define _INCLUDE_PROGRESSBAR_H_
/////////////////////////////////////////////////////////////////////////////
// CProgressBar - status bar progress control
//
// Copyright (c) Chris Maunder, 1997
// Please feel free to use and distribute.
class CProgressBar: public CProgressCtrl
// Creates a ProgressBar in the status bar
{
public:
CProgressBar();
CProgressBar(LPCTSTR strMessage, int nSize=100, int MaxValue=100,
BOOL bSmooth=FALSE, int nPane=0);
~CProgressBar();
BOOL Create(LPCTSTR strMessage, int nSize=100, int MaxValue=100,
BOOL bSmooth=FALSE, int nPane=0);
DECLARE_DYNCREATE(CProgressBar)
// operations
public:
BOOL SetRange(int nLower, int nUpper, int nStep = 1);
BOOL SetText(LPCTSTR strMessage);
BOOL SetSize(int nSize);
COLORREF SetBarColour(COLORREF clrBar);
COLORREF SetBkColour(COLORREF clrBk);
int SetPos(int nPos);
int OffsetPos(int nPos);
int SetStep(int nStep);
int StepIt();
void Clear();
// Overrides
//{{AFX_VIRTUAL(CProgressBar)
//}}AFX_VIRTUAL
// implementation
protected:
int m_nSize; // Percentage size of control
int m_nPane; // ID of status bar pane progress bar is to appear in
CString m_strMessage; // Message to display to left of control
CString m_strPrevText; // Previous text in status bar
CRect m_Rect; // Dimensions of the whole thing
CStatusBar *GetStatusBar();
BOOL Resize();
// Generated message map functions
protected:
//{{AFX_MSG(CProgressBar)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif
/////////////////////////////////////////////////////////////////////////////