52a3801208
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
45 lines
860 B
C++
45 lines
860 B
C++
//****************************************************************************************
|
|
//
|
|
// File: ProgressBar.h
|
|
//
|
|
// Written by: David Ramsey and Daniel Switkin
|
|
//
|
|
// Copyright 1999, Be Incorporated
|
|
//
|
|
//****************************************************************************************
|
|
|
|
#ifndef PROGRESSBAR_H
|
|
#define PROGRESSBAR_H
|
|
|
|
#include <interface/View.h>
|
|
|
|
typedef struct {
|
|
rgb_color color;
|
|
BRect rect;
|
|
} segment;
|
|
|
|
#define ltgray 216
|
|
#define dkgray 80
|
|
|
|
class ProgressBar : public BView {
|
|
public:
|
|
ProgressBar(BRect r, char* name);
|
|
void Draw(BRect rect);
|
|
void Set(int32 value);
|
|
void UpdateColors(int32 color, bool fade);
|
|
void AttachedToWindow();
|
|
|
|
enum {
|
|
PROGRESS_WIDTH = 146,
|
|
PROGRESS_HEIGHT = 20
|
|
};
|
|
|
|
private:
|
|
void Render(bool all = false);
|
|
|
|
segment segments[20];
|
|
int32 current_value, previous_value;
|
|
};
|
|
|
|
#endif
|