ProgressBar Class Reference
[Core GUI related classes (widgets)]

#include <progressbar.h>

List of all members.


Detailed Description

A progress bar.

Definition at line 38 of file progressbar.h.


Public Member Functions

 ProgressBar (float progress=0.0f, unsigned int width=40, unsigned int height=7, Uint8 red=150, Uint8 green=150, Uint8 blue=150)
 Constructor, initializes the progress with the given value.
 ~ProgressBar ()
 Destructor.
void logic ()
 Performs progress bar logic (fading colors).
void draw (gcn::Graphics *graphics)
 Draws the progress bar.
void setProgress (float progress)
 Sets the current progress.
float getProgress () const
 Returns the current progress.
void setColor (Uint8, Uint8 green, Uint8 blue)
 Change the filling of the progress bar.
Uint8 getRed () const
 Returns the red value of color.
Uint8 getGreen () const
 Returns the green value of color.
Uint8 getBlue () const
 Returns the blue value of color.
void setText (const std::string &text)
 Sets the text shown on the progress bar.
const std::string & text () const
 Returns the text shown on the progress bar.
void setSmoothProgress (bool smoothProgress)
 Set wether the progress is moved smoothly.
void setSmoothColorChange (bool smoothColorChange)
 Set wether the color changing is made smoothly.

Private Attributes

float mProgress
float mProgressToGo
bool mSmoothProgress
Uint8 mRed
Uint8 mGreen
Uint8 mBlue
Uint8 mRedToGo
Uint8 mGreenToGo
Uint8 mBlueToGo
bool mSmoothColorChange
std::string mText
bool mUpdated

Static Private Attributes

static ImageRect mBorder
static int mInstances = 0
static float mAlpha = 1.0
static const gcn::Color TEXT_COLOR

Constructor & Destructor Documentation

ProgressBar::ProgressBar ( float  progress = 0.0f,
unsigned int  width = 40,
unsigned int  height = 7,
Uint8  red = 150,
Uint8  green = 150,
Uint8  blue = 150 
)

Constructor, initializes the progress with the given value.

Definition at line 40 of file progressbar.cpp.

ProgressBar::~ProgressBar (  ) 

Destructor.

Definition at line 79 of file progressbar.cpp.


Member Function Documentation

void ProgressBar::logic (  ) 

Performs progress bar logic (fading colors).

Definition at line 97 of file progressbar.cpp.

void ProgressBar::draw ( gcn::Graphics *  graphics  ) 

Draws the progress bar.

Definition at line 126 of file progressbar.cpp.

void ProgressBar::setProgress ( float  progress  ) 

Sets the current progress.

Definition at line 164 of file progressbar.cpp.

float ProgressBar::getProgress (  )  const [inline]

Returns the current progress.

Definition at line 71 of file progressbar.h.

void ProgressBar::setColor ( Uint8  red,
Uint8  green,
Uint8  blue 
)

Change the filling of the progress bar.

Definition at line 171 of file progressbar.cpp.

Uint8 ProgressBar::getRed (  )  const [inline]

Returns the red value of color.

Definition at line 81 of file progressbar.h.

Uint8 ProgressBar::getGreen (  )  const [inline]

Returns the green value of color.

Definition at line 86 of file progressbar.h.

Uint8 ProgressBar::getBlue (  )  const [inline]

Returns the blue value of color.

Definition at line 91 of file progressbar.h.

void ProgressBar::setText ( const std::string &  text  )  [inline]

Sets the text shown on the progress bar.

Definition at line 96 of file progressbar.h.

const std::string& ProgressBar::text (  )  const [inline]

Returns the text shown on the progress bar.

Definition at line 102 of file progressbar.h.

void ProgressBar::setSmoothProgress ( bool  smoothProgress  )  [inline]

Set wether the progress is moved smoothly.

Definition at line 108 of file progressbar.h.

void ProgressBar::setSmoothColorChange ( bool  smoothColorChange  )  [inline]

Set wether the color changing is made smoothly.

Definition at line 114 of file progressbar.h.


Member Data Documentation

float ProgressBar::mProgress [private]

Definition at line 119 of file progressbar.h.

float ProgressBar::mProgressToGo [private]

Definition at line 119 of file progressbar.h.

Definition at line 120 of file progressbar.h.

Uint8 ProgressBar::mRed [private]

Definition at line 122 of file progressbar.h.

Uint8 ProgressBar::mGreen [private]

Definition at line 122 of file progressbar.h.

Uint8 ProgressBar::mBlue [private]

Definition at line 122 of file progressbar.h.

Uint8 ProgressBar::mRedToGo [private]

Definition at line 123 of file progressbar.h.

Uint8 ProgressBar::mGreenToGo [private]

Definition at line 123 of file progressbar.h.

Uint8 ProgressBar::mBlueToGo [private]

Definition at line 123 of file progressbar.h.

Definition at line 124 of file progressbar.h.

std::string ProgressBar::mText [private]

Definition at line 126 of file progressbar.h.

bool ProgressBar::mUpdated [private]

Definition at line 127 of file progressbar.h.

ImageRect ProgressBar::mBorder [static, private]

Definition at line 129 of file progressbar.h.

int ProgressBar::mInstances = 0 [static, private]

Definition at line 130 of file progressbar.h.

float ProgressBar::mAlpha = 1.0 [static, private]

Definition at line 131 of file progressbar.h.

const gcn::Color ProgressBar::TEXT_COLOR [static, private]

Definition at line 133 of file progressbar.h.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5