From 65da3d5cd5c8cf40abc1e6d31b04eada615fe307 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 25 Jan 2009 21:30:47 +0100 Subject: Made the labels on the progress bars more readable --- src/gui/progressbar.h | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'src/gui/progressbar.h') 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 -class ImageRect; +#include +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; -- cgit v1.2.3-70-g09d2