initial import

This commit is contained in:
Guenter Obiltschnig
2006-07-11 16:33:40 +00:00
commit f476bd6b32
1463 changed files with 242402 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
//
// ProgressBar.h
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ProgressBar.h#1 $
//
#ifndef ProgressBar_INCLUDED
#define ProgressBar_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#include <afxwin.h>
CppUnit_BEGIN
/* A Simple ProgressBar for test execution display
*/
class ProgressBar
{
public:
ProgressBar(CWnd* baseWindow, CRect& bounds);
void step(bool successful);
void paint(CDC& dc);
int scale(int value);
void reset();
void start(int total);
protected:
void paintBackground(CDC& dc);
void paintStatus(CDC& dc);
COLORREF getStatusColor();
void paintStep(int startX, int endX);
CWnd* _baseWindow;
CRect _bounds;
bool _error;
int _total;
int _progress;
int _progressX;
};
// Construct a ProgressBar
inline ProgressBar::ProgressBar(CWnd* baseWindow, CRect& bounds):
_baseWindow(baseWindow),
_bounds(bounds),
_error(false),
_total(0),
_progress(0),
_progressX(0)
{
WINDOWINFO wi;
wi.cbSize = sizeof(WINDOWINFO);
baseWindow->GetWindowInfo(&wi);
_bounds.OffsetRect(-wi.rcClient.left, -wi.rcClient.top);
}
// Get the current color
inline COLORREF ProgressBar::getStatusColor()
{
return _error ? RGB(255, 0, 0) : RGB(0, 255, 0);
}
CppUnit_END
#endif // ProgressBar_INCLUDED