FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
gcn::PercentageBar Class Reference

A simple percentage bar. More...

#include <percentagebar.h>

Inherits Widget.

+ Collaboration diagram for gcn::PercentageBar:

Public Types

enum  Orientation { HORIZONTAL = 0, VERTICAL }
 

Public Member Functions

 PercentageBar ()
 Constructor. More...
 
virtual ~PercentageBar ()
 
virtual void draw (Graphics *graphics)
 
void setForegroundImage (Image *image)
 
void setOrientation (Orientation orientation)
 Sets the orientation of the percentage bar. More...
 
Orientation getOrientation () const
 Gets the orientation of the percentage bar. More...
 
int32_t getValue () const
 Gets the value of the percentage bar. More...
 
void setValue (int32_t value)
 Sets the value of the percentage bar. More...
 

Protected Attributes

Image * mImage
 
double mValue
 Holds the current value of the percentage bar. More...
 
Orientation mOrientation
 Holds the orientation of the percentage bar. More...
 

Detailed Description

A simple percentage bar.

Definition at line 45 of file percentagebar.h.

Member Enumeration Documentation

Enumerator
HORIZONTAL 
VERTICAL 

Definition at line 49 of file percentagebar.h.

Constructor & Destructor Documentation

gcn::PercentageBar::PercentageBar ( )

Constructor.

Definition at line 41 of file percentagebar.cpp.

References HORIZONTAL, mImage, setOrientation(), and setValue().

virtual gcn::PercentageBar::~PercentageBar ( )
inlinevirtual

Definition at line 60 of file percentagebar.h.

Member Function Documentation

void gcn::PercentageBar::draw ( Graphics *  graphics)
virtual

Definition at line 49 of file percentagebar.cpp.

References getOrientation(), HORIZONTAL, mImage, and mValue.

PercentageBar::Orientation gcn::PercentageBar::getOrientation ( ) const

Gets the orientation of the percentage bar.

Returns
The orientation of the percentage bar.
See Also
setOrientation

Definition at line 104 of file percentagebar.cpp.

References mOrientation.

Referenced by draw().

+ Here is the caller graph for this function:

int32_t gcn::PercentageBar::getValue ( ) const

Gets the value of the percentage bar.

Returns
The value of the percentage bar.

Definition at line 94 of file percentagebar.cpp.

References mValue.

void gcn::PercentageBar::setForegroundImage ( Image *  image)

Definition at line 68 of file percentagebar.cpp.

References mImage.

void gcn::PercentageBar::setOrientation ( PercentageBar::Orientation  orientation)

Sets the orientation of the percentage bar.

Parameters
orientationThe orientation of the percentage bar.
See Also
getOrientation

Definition at line 99 of file percentagebar.cpp.

References mOrientation.

Referenced by PercentageBar().

+ Here is the caller graph for this function:

void gcn::PercentageBar::setValue ( int32_t  value)

Sets the value of the percentage bar.

Parameters
valueIn the range of 0-100.

Definition at line 77 of file percentagebar.cpp.

References mValue.

Referenced by PercentageBar().

+ Here is the caller graph for this function:

Member Data Documentation

Image* gcn::PercentageBar::mImage
protected

Definition at line 106 of file percentagebar.h.

Referenced by draw(), PercentageBar(), and setForegroundImage().

Orientation gcn::PercentageBar::mOrientation
protected

Holds the orientation of the percentage bar.

A percentage bar can be drawn vertically or horizontally.

Definition at line 117 of file percentagebar.h.

Referenced by getOrientation(), and setOrientation().

double gcn::PercentageBar::mValue
protected

Holds the current value of the percentage bar.

Definition at line 111 of file percentagebar.h.

Referenced by draw(), getValue(), and setValue().


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