1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
/*
$Id: progressbar.h,v 1.10 2001/12/28 00:00:55 sphair Exp $
------------------------------------------------------------------------
ClanLib, the platform independent game SDK.
This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
version 2. See COPYING for details.
For a total list of contributers see CREDITS.
See http://www.clanlib.org
------------------------------------------------------------------------
*/
//! clanGUI="Controls"
//! header=gui.h
#ifndef header_progressbar
#define header_progressbar
#include "component.h"
class CL_ComponentOptions;
class CL_Rect;
class CL_ProgressBar_Generic;
//: ProgressBar component
class CL_ProgressBar : public CL_Component
{
//! Construction:
public:
//: ProgressBar Constructor
CL_ProgressBar(
CL_Component *parent,
CL_StyleManager *style = NULL);
//: ProgressBar Constructor
CL_ProgressBar(
const CL_Rect &pos,
int steps,
CL_Component *parent,
CL_StyleManager *style = NULL);
//: ProgressBar Destructor
virtual ~CL_ProgressBar();
//! Attributes:
public:
//: Returns the total number of steps.
int get_steps() const;
//: Returns the current amount of progress.
int get_progress() const;
//: Returns the current amount of progress in percentage.
float get_percentage() const;
//! Operations:
public:
//: Sets the total number of steps to total_steps.
void set_steps(int total_steps);
//: Sets the current amount of progress of the total number of steps.
void set_progress(int progress);
//: Progresses the bar with steps.
void increase(int steps = 1);
//: Reset the progress bar. The progress bar `rewinds'.
void reset();
//! Signals:
public:
//! Implementation:
private:
CL_ProgressBar(const CL_ProgressBar ©) : CL_Component(NULL, NULL) { return; } // disallow copy construction.
CL_ProgressBar_Generic *impl;
};
#endif
|