diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-25 21:30:47 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-25 21:30:47 +0100 |
commit | 65da3d5cd5c8cf40abc1e6d31b04eada615fe307 (patch) | |
tree | 70d570f181fddc5cddb7934b4735d2729ca44e11 /src/gui/progressbar.h | |
parent | 1610ed4b3bc9ea3328087818da0af3f5852d1ff5 (diff) | |
download | mana-65da3d5cd5c8cf40abc1e6d31b04eada615fe307.tar.gz mana-65da3d5cd5c8cf40abc1e6d31b04eada615fe307.tar.bz2 mana-65da3d5cd5c8cf40abc1e6d31b04eada615fe307.tar.xz mana-65da3d5cd5c8cf40abc1e6d31b04eada615fe307.zip |
Made the labels on the progress bars more readable
Diffstat (limited to 'src/gui/progressbar.h')
-rw-r--r-- | src/gui/progressbar.h | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h index 1707b464..3b68fa40 100644 --- a/src/gui/progressbar.h +++ b/src/gui/progressbar.h @@ -26,15 +26,17 @@ #include <SDL_types.h> -class ImageRect; +#include <string> +class ImageRect; /** * A progress bar. * * \ingroup GUI */ -class ProgressBar : public gcn::Widget { +class ProgressBar : public gcn::Widget +{ public: /** * Constructor, initializes the progress with the given value. @@ -51,55 +53,60 @@ class ProgressBar : public gcn::Widget { /** * Performs progress bar logic (fading colors) */ - void - logic(); + void logic(); /** * Draws the progress bar. */ - void - draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics); /** * Sets the current progress. */ - void - setProgress(float progress); + void setProgress(float progress); /** * Returns the current progress. */ - float - getProgress() { return mProgress; } + float getProgress() const { return mProgress; } /** * Change the filling of the progress bar. */ - void - setColor(Uint8, Uint8 green, Uint8 blue); + void setColor(Uint8, Uint8 green, Uint8 blue); + + /** + * Returns the red value of color. + */ + Uint8 getRed() const { return mRed; } /** - * Get The red value of color + * Returns the red value of color. */ - Uint8 - getRed() { return mRed; } + Uint8 getGreen() const { return mGreen; } - /** - * Get The red value of color + /** + * Returns the red 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; |