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 virtual void Draw(BRect rect); 28 void Set(int32 value); 29 void UpdateColors(int32 color, bool fade); 30 virtual void AttachedToWindow(); 31 virtual void MouseDown(BPoint point); 32 33 enum { 34 PROGRESS_WIDTH = 146, 35 PROGRESS_HEIGHT = 20 36 }; 37 38 private: 39 void Render(bool all = false); 40 41 segment segments[20]; 42 int32 current_value, previous_value; 43 }; 44 45 #endif 46