trunk 20080912
[gitenigma.git] / include / lib / gui / eprogress.h
blobc82ea83052381ee025b82abd488e5e0adff656a9
1 #ifndef __eprogress_h
2 #define __eprogress_h
4 #include <lib/gui/ewidget.h>
5 #include <lib/gdi/grc.h>
7 /**
8 * \brief A progressbar.
10 * Useful for displaying a progress or stuff.
12 class eProgress: public eWidget
14 protected:
15 int perc, border, start;
16 int direction;
17 gColor left, right;
18 gPixmap *sliderPixmap;
19 public:
20 eProgress(eWidget *parent, int takeFocus=0);
21 ~eProgress();
23 /**
24 * \brief Sets the value.
26 * \param perc The range is \c 0..100
28 void setPerc(int perc);
29 void setStart(int perc);
30 bool setParams( int _start, int _perc );
31 void redrawWidget(gPainter *target, const eRect &area);
33 /**
34 * \brief Sets a property.
36 * Valid, eProgress specific properties are:
37 * \arg \c leftColor, the color of the left part
38 * \arg \c rightColor, the color of the right part
39 * \arg \c border, the size of the border (in pixels)
40 * \arg \c direction, direction (0 for horiz., 1 for vert.)
41 * \sa eWidget::setProperty
43 int setProperty(const eString &prop, const eString &value);
45 void setDirection(int d) { direction = d; }
46 void setBorder( int b ) { border = b; }
47 void setLeftColor( const gColor& c ) { left = c; }
48 void setRightColor( const gColor& c ) { right = c; }
49 void setSliderPixmap(gPixmap *pmap) { sliderPixmap = pmap; }
52 #endif