00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef bargraphwidgetH
00018 #define bargraphwidgetH
00019
00020 #include <vector>
00021 #include <pgthemewidget.h>
00022 #include "../global.h"
00023
00024 class BarGraphWidget : public PG_ThemeWidget {
00025 float fraction;
00026 PG_Color color;
00027 public:
00028 typedef vector<pair<double,int> > Colors;
00029 enum Direction { l2r, r2l, t2b, b2t };
00030 private:
00031 Direction dir;
00032 Colors colors;
00033 public:
00034 BarGraphWidget (PG_Widget *parent, const PG_Rect &rect, Direction direction );
00035
00036 void setFraction( float f );
00037 void setColor( int c ) { color = c; };
00038 void setColor( PG_Color c ) { color = c; };
00039 void setColor( Colors colors ) { this->colors = colors; };
00040
00041 void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst);
00042 };
00043
00044 #endif