diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-25 21:30:47 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-25 17:35:59 -0700 |
commit | 537d390ae65e9b8a2701c04baa22962f7db0f093 (patch) | |
tree | 10a14a57ca6d61e4660cf68c15ea68652d81bc41 /src/gui/progressbar.h | |
parent | edd500dd27bb648840abfe1cecb0767d7b2ba3ae (diff) | |
download | mana-537d390ae65e9b8a2701c04baa22962f7db0f093.tar.gz mana-537d390ae65e9b8a2701c04baa22962f7db0f093.tar.bz2 mana-537d390ae65e9b8a2701c04baa22962f7db0f093.tar.xz mana-537d390ae65e9b8a2701c04baa22962f7db0f093.zip |
Made the labels on the progress bars more readable
Diffstat (limited to 'src/gui/progressbar.h')
-rw-r--r-- | src/gui/progressbar.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h index 670b4ab4..e874b56d 100644 --- a/src/gui/progressbar.h +++ b/src/gui/progressbar.h @@ -25,6 +25,7 @@ #include <guichan/widget.hpp> #include <SDL_types.h> +#include <string> #include "../guichanfwd.h" @@ -35,7 +36,8 @@ class ImageRect; * * \ingroup GUI */ -class ProgressBar : public gcn::Widget { +class ProgressBar : public gcn::Widget +{ public: /** * Constructor, initializes the progress with the given value. @@ -67,7 +69,7 @@ class ProgressBar : public gcn::Widget { /** * Returns the current progress. */ - float getProgress() { return mProgress; } + float getProgress() const { return mProgress; } /** * Change the filling of the progress bar. @@ -75,24 +77,37 @@ class ProgressBar : public gcn::Widget { void setColor(Uint8, Uint8 green, Uint8 blue); /** - * Get The red value of color + * Returns the red value of color. */ - Uint8 getRed() { return mRed; } + Uint8 getRed() const { return mRed; } - /** - * Get The red value of color + /** + * Returns the green value of color. + */ + Uint8 getGreen() const { return mGreen; } + + /** + * Returns the blue value of color. + */ + Uint8 getBlue() const { return mBlue; } + + /** + * Sets the text shown on the progress bar. */ - Uint8 getGreen() { return mGreen; } + void setText(const std::string &text) + { mText = text; } /** - * Get The red value of color + * Returns the text shown on the progress bar. */ - Uint8 getBlue() { return mBlue; } + const std::string &text() const + { return mText; } private: float mProgress; Uint8 mRed, mGreen, mBlue; Uint8 mRedToGo, mGreenToGo, mBlueToGo; + std::string mText; static ImageRect mBorder; static int mInstances; |