summaryrefslogtreecommitdiff
path: root/src/gui/progressbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/progressbar.h')
-rw-r--r--src/gui/progressbar.h33
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;