Advanced Strategic Command
bargraphwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  dropdownselector
3  -------------------
4  copyright : (C) 2006 by Martin Bickel
5  email : <bickel@asc-hq.org>
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef bargraphwidgetH
18 #define bargraphwidgetH
19 
20 #include <vector>
21 #include <pgthemewidget.h>
22 #include "../global.h"
23 
24 class BarGraphWidget : public PG_ThemeWidget {
25  float fraction;
26  PG_Color color;
27  public:
28  typedef vector<pair<double,int> > Colors;
29  enum Direction { l2r, r2l, t2b, b2t };
30  private:
31  Direction dir;
32  Colors colors;
33  public:
34  BarGraphWidget (PG_Widget *parent, const PG_Rect &rect, Direction direction );
35 
36  void setFraction( float f );
37  void setColor( int c ) { color = c; };
38  void setColor( PG_Color c ) { color = c; };
39  void setColor( Colors colors ) { this->colors = colors; };
40 
41  void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst);
42 };
43 
44 #endif
vector< pair< double, int > > Colors
void setColor(PG_Color c)
void eventBlit(SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst)
BarGraphWidget(PG_Widget *parent, const PG_Rect &rect, Direction direction)
void setColor(int c)
void setFraction(float f)
Direction
Definition: weatherarea.h:84
void setColor(Colors colors)