Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

bargraphwidget.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                              dropdownselector
00003                              -------------------
00004     copyright            : (C)  2006 by Martin Bickel
00005     email                : <bickel@asc-hq.org>
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
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

Generated on Tue Jun 24 01:27:35 2008 for Advanced Strategic Command by  doxygen 1.4.2