Woopsi 1.0
GUI Framework for Nintendo DS Homebrew

progressbar.h

00001 #ifndef _PROGRESS_BAR_H_
00002 #define _PROGRESS_BAR_H_
00003 
00004 #include <nds.h>
00005 #include "gadget.h"
00006 
00007 namespace WoopsiUI {
00008 
00012         class ProgressBar : public Gadget {
00013 
00014         public:
00015 
00023                 ProgressBar(s16 x, s16 y, u16 width, u16 height);
00024 
00029                 inline const s16 getMinimumValue() const { return _minimumValue; };
00030 
00035                 inline const s16 getMaximumValue() const { return _maximumValue; };
00036 
00041                 inline const s16 getValue() const { return _value; };
00042 
00047                 inline void setMinimumValue(const s16 value) { _minimumValue = value; };
00048 
00053                 inline void setMaximumValue(const s16 value) { _maximumValue = value; };
00054 
00059                 void setValue(const s16 value);
00060 
00064                 inline void showPercentageText() {
00065                         _showPercentageText = true;
00066                         markRectsDamaged();
00067                 };
00068 
00072                 inline void hidePercentageText() {
00073                         _showPercentageText = false;
00074                         markRectsDamaged();
00075                 };
00076 
00077         protected:
00078                 s16 _minimumValue;                      
00079                 s16 _maximumValue;                      
00080                 s16 _value;                                     
00081                 bool _showPercentageText;       
00089                 virtual void drawContents(GraphicsPort* port);
00090 
00097                 virtual void drawBorder(GraphicsPort* port);
00098 
00102                 virtual inline ~ProgressBar() { };
00103 
00107                 inline ProgressBar(const ProgressBar& progressBar) : Gadget(progressBar) { };
00108         };
00109 }
00110 
00111 #endif