1 //**************************************************************************************** 2 // 3 // File: ProgressBar.h 4 // 5 // Written by: David Ramsey and Daniel Switkin 6 // 7 // Copyright 1999, Be Incorporated 8 // 9 //**************************************************************************************** 10 11 #ifndef PROGRESSBAR_H 12 #define PROGRESSBAR_H 13 14 #include <interface/View.h> 15 16 typedef struct { 17 rgb_color color; 18 BRect rect; 19 } segment; 20 21 #define ltgray 216 22 #define dkgray 80 23 24 class ProgressBar : public BView { 25 public: 26 ProgressBar(BRect r, char* name); 27 void Draw(BRect rect); 28 void Set(int32 value); 29 void UpdateColors(int32 color, bool fade); 30 void AttachedToWindow(); 31 32 enum { 33 PROGRESS_WIDTH = 146, 34 PROGRESS_HEIGHT = 20 35 }; 36 37 private: 38 void Render(bool all = false); 39 40 segment segments[20]; 41 int32 current_value, previous_value; 42 }; 43 44 #endif 45