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.h75
1 files changed, 41 insertions, 34 deletions
diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h
index 0b1616f5..49bc3edd 100644
--- a/src/gui/progressbar.h
+++ b/src/gui/progressbar.h
@@ -1,26 +1,28 @@
/*
* The Mana World
- * Copyright 2004 The Mana World Development Team
+ * Copyright (C) 2004 The Mana World Development Team
*
* This file is part of The Mana World.
*
- * The Mana World is free software; you can redistribute it and/or modify
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
- * The Mana World is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with The Mana World; if not, write to the Free Software
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _TMW_PROGRESSBAR_H
-#define _TMW_PROGRESSBAR_H
+#ifndef PROGRESSBAR_H
+#define PROGRESSBAR_H
+
+#include <string>
#include <guichan/widget.hpp>
@@ -28,13 +30,13 @@
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,63 +53,65 @@ 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 green value of color.
*/
- Uint8
- getRed() { return mRed; }
+ Uint8 getGreen() const { return mGreen; }
- /**
- * Get The red value of color
+ /**
+ * Returns the blue value of color.
*/
- Uint8
- getGreen() { return mGreen; }
+ Uint8 getBlue() const { return mBlue; }
/**
- * Get The red value of color
+ * Sets the text shown on the progress bar.
*/
- Uint8
- getBlue() { return mBlue; }
+ void setText(const std::string &text)
+ { mText = text; }
/**
- * Set wether the progress is moved smoothly
+ * Returns the text shown on the progress bar.
*/
- void
- setSmoothProgress(bool smoothProgress)
+ const std::string &text() const
+ { return mText; }
+
+ /**
+ * Set wether the progress is moved smoothly.
+ */
+ void setSmoothProgress(bool smoothProgress)
{ mSmoothProgress = smoothProgress; }
/**
- * Set wether the color changing is made smoothly
+ * Set wether the color changing is made smoothly.
*/
- void
- setSmoothColorChange(bool smoothColorChange)
+ void setSmoothColorChange(bool smoothColorChange)
{ mSmoothColorChange = smoothColorChange; }
@@ -119,8 +123,11 @@ class ProgressBar : public gcn::Widget {
Uint8 mRedToGo, mGreenToGo, mBlueToGo;
bool mSmoothColorChange;
+ std::string mText;
+
static ImageRect mBorder;
static int mInstances;
+ static float mAlpha;
};
#endif