Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PG_ProgressBar Class Reference

A progress bar. More...

#include <pgprogressbar.h>

Inheritance diagram for PG_ProgressBar:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PG_ProgressBar (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const std::string &style="Progressbar")
 ~PG_ProgressBar ()
void SetProgress (double p)
 Set the progress of the widget.
void LoadThemeStyle (const std::string &widgettype)
 Load a specific themestyle.
void SetDrawPercentage (bool drawit=true)
 Toggle drawing of the percentage text.

Protected Member Functions

void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst)
 overridable eventhandler to blit the widget contents to the screen

Detailed Description

A progress bar.

Author:
Alexander Pipelka
Displays progress by taking a percentage and sizing the bar appropriately.

Definition at line 49 of file pgprogressbar.h.


Constructor & Destructor Documentation

PG_ProgressBar::PG_ProgressBar PG_Widget parent,
const PG_Rect r = PG_Rect::null,
const std::string &  style = "Progressbar"
 

Definition at line 34 of file pgprogressbar.cpp.

References PG_Gradient::colors, LoadThemeStyle(), PG_Widget::my_bordersize, and PG_Draw::TILE.

PG_ProgressBar::~PG_ProgressBar  ) 
 

Definition at line 68 of file pgprogressbar.cpp.


Member Function Documentation

void PG_ProgressBar::eventBlit SDL_Surface *  surface,
const PG_Rect src,
const PG_Rect dst
[protected, virtual]
 

overridable eventhandler to blit the widget contents to the screen

Parameters:
surface pointer to SDL_Surface to be blitted
src source rectangle (client coordinates)
dst destination rectangle (screen coordinates) Override this eventhandler to perform custom blitting behaviour (without drawing onto the widget surface).

Reimplemented from PG_ThemeWidget.

Definition at line 95 of file pgprogressbar.cpp.

References PG_Draw::BlitSurface(), PG_ThemeWidget::CreateThemedSurface(), PG_ThemeWidget::DeleteThemedSurface(), PG_Widget::DrawText(), PG_ThemeWidget::eventBlit(), PG_Widget::GetClipRects(), PG_Application::GetScreen(), PG_Widget::GetTextSize(), PG_Rect::my_height, PG_Widget::my_text, PG_Rect::my_width, PG_Rect::my_xpos, and PG_Rect::my_ypos.

void PG_ProgressBar::LoadThemeStyle const std::string &  widgettype  ) 
 

Load a specific themestyle.

Parameters:
widgettype name of widget type to load

Reimplemented from PG_ThemeWidget.

Definition at line 78 of file pgprogressbar.cpp.

References PG_Theme::FindGradient(), PG_Theme::FindSurface(), PG_Theme::GetProperty(), PG_Application::GetTheme(), and PG_ThemeWidget::LoadThemeStyle().

Referenced by PG_ProgressBar().

void PG_ProgressBar::SetDrawPercentage bool  drawit = true  ) 
 

Toggle drawing of the percentage text.

Parameters:
drawit whether or not to draw the percentage

Definition at line 70 of file pgprogressbar.cpp.

References PG_Widget::Update().

void PG_ProgressBar::SetProgress double  p  ) 
 

Set the progress of the widget.

Note:
The progress, p, should be a double between 0.0 and 100.0.
Parameters:
p new progress

Definition at line 148 of file pgprogressbar.cpp.

References PG_Widget::Update().

Referenced by SetProgressBarAtts().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:19:15 2008 for Advanced Strategic Command by  doxygen 1.4.2