Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ProgressBar Class Reference

A progress bar. More...

#include <progressbar.h>

Inheritance diagram for ProgressBar:

Public Member Functions

 ProgressBar (float progress=0.0f, int width=40, int height=7, int color=-1)
 Constructor, initializes the progress with the given value.
 
void logic () override
 Performs progress bar logic (fading colors)
 
void draw (gcn::Graphics *graphics) override
 Draws the progress bar.
 
void setProgress (float progress)
 Sets the current progress.
 
float getProgress () const
 Returns the current progress.
 
void setProgressPalette (int progressPalette)
 Change the ProgressPalette for this ProgressBar to follow or -1 to disable this and manage color manually.
 
void setColor (const gcn::Color &color)
 Change the color of the progress bar.
 
const gcn::Color & getColor () const
 Returns the color of the progress bar.
 
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 whether the progress is moved smoothly.
 
void setSmoothColorChange (bool smoothColorChange)
 Set whether the color changing is made smoothly.
 

Private Attributes

float mProgress
 
float mProgressToGo
 
bool mSmoothProgress = true
 
int mProgressPalette
 
gcn::Color mColor
 < Entry in ProgressPalette or -1 for none.
 
gcn::Color mColorToGo
 
bool mSmoothColorChange = true
 
std::string mText
 

Detailed Description

A progress bar.

Definition at line 33 of file progressbar.h.

Constructor & Destructor Documentation

◆ ProgressBar()

ProgressBar::ProgressBar ( float  progress = 0.0f,
int  width = 40,
int  height = 7,
int  color = -1 
)

Constructor, initializes the progress with the given value.

Definition at line 32 of file progressbar.cpp.

Member Function Documentation

◆ draw()

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

Draws the progress bar.

Definition at line 78 of file progressbar.cpp.

◆ getColor()

const gcn::Color & ProgressBar::getColor ( ) const
inline

Returns the color of the progress bar.

Definition at line 77 of file progressbar.h.

◆ getProgress()

float ProgressBar::getProgress ( ) const
inline

Returns the current progress.

Definition at line 61 of file progressbar.h.

◆ logic()

void ProgressBar::logic ( )
override

Performs progress bar logic (fading colors)

Definition at line 49 of file progressbar.cpp.

◆ setColor()

void ProgressBar::setColor ( const gcn::Color &  color)

Change the color of the progress bar.

Definition at line 119 of file progressbar.cpp.

◆ setProgress()

void ProgressBar::setProgress ( float  progress)

Sets the current progress.

Definition at line 98 of file progressbar.cpp.

◆ setProgressPalette()

void ProgressBar::setProgressPalette ( int  progressPalette)

Change the ProgressPalette for this ProgressBar to follow or -1 to disable this and manage color manually.

Definition at line 110 of file progressbar.cpp.

◆ setSmoothColorChange()

void ProgressBar::setSmoothColorChange ( bool  smoothColorChange)
inline

Set whether the color changing is made smoothly.

Definition at line 100 of file progressbar.h.

◆ setSmoothProgress()

void ProgressBar::setSmoothProgress ( bool  smoothProgress)
inline

Set whether the progress is moved smoothly.

Definition at line 94 of file progressbar.h.

◆ setText()

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

Sets the text shown on the progress bar.

Definition at line 82 of file progressbar.h.

◆ text()

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

Returns the text shown on the progress bar.

Definition at line 88 of file progressbar.h.

Member Data Documentation

◆ mColor

gcn::Color ProgressBar::mColor
private

< Entry in ProgressPalette or -1 for none.

Definition at line 108 of file progressbar.h.

◆ mColorToGo

gcn::Color ProgressBar::mColorToGo
private

Definition at line 109 of file progressbar.h.

◆ mProgress

float ProgressBar::mProgress
private

Definition at line 104 of file progressbar.h.

◆ mProgressPalette

int ProgressBar::mProgressPalette
private

Definition at line 107 of file progressbar.h.

◆ mProgressToGo

float ProgressBar::mProgressToGo
private

Definition at line 104 of file progressbar.h.

◆ mSmoothColorChange

bool ProgressBar::mSmoothColorChange = true
private

Definition at line 110 of file progressbar.h.

◆ mSmoothProgress

bool ProgressBar::mSmoothProgress = true
private

Definition at line 105 of file progressbar.h.

◆ mText

std::string ProgressBar::mText
private

Definition at line 112 of file progressbar.h.


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