Woopsi 1.3
Nintendo DS Gui Framework
libwoopsi/include/progressbar.h
00001 #ifndef _PROGRESS_BAR_H_
00002 #define _PROGRESS_BAR_H_
00003 
00004 #include <nds.h>
00005 #include "gadget.h"
00006 #include "gadgetstyle.h"
00007 
00008 namespace WoopsiUI {
00009 
00013     class ProgressBar : public Gadget {
00014 
00015     public:
00016 
00028         ProgressBar(s16 x, s16 y, u16 width, u16 height, GadgetStyle* style = NULL);
00029 
00034         inline const s16 getMinimumValue() const { return _minimumValue; };
00035 
00040         inline const s16 getMaximumValue() const { return _maximumValue; };
00041 
00046         inline const s16 getValue() const { return _value; };
00047 
00052         inline void setMinimumValue(const s16 value) { _minimumValue = value; };
00053 
00058         inline void setMaximumValue(const s16 value) { _maximumValue = value; };
00059 
00064         void setValue(const s16 value);
00065 
00069         inline void showPercentageText() {
00070             _showPercentageText = true;
00071             markRectsDamaged();
00072         };
00073 
00077         inline void hidePercentageText() {
00078             _showPercentageText = false;
00079             markRectsDamaged();
00080         };
00081 
00082     protected:
00083         s16 _minimumValue;          
00084         s16 _maximumValue;          
00085         s16 _value;                 
00086         bool _showPercentageText;   
00094         virtual void drawContents(GraphicsPort* port);
00095 
00102         virtual void drawBorder(GraphicsPort* port);
00103 
00107         virtual inline ~ProgressBar() { };
00108 
00112         inline ProgressBar(const ProgressBar& progressBar) : Gadget(progressBar) { };
00113     };
00114 }
00115 
00116 #endif
 All Classes Functions Variables Enumerations Enumerator