Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

progressbar.cpp

Go to the documentation of this file.
00001 /*
00002         ClanGUI, copyrights by various people. Have a look in the CREDITS file.
00003         
00004         This sourcecode is distributed using the Library GNU Public Licence,
00005         version 2 or (at your option) any later version. Please read LICENSE
00006         for details.
00007 */
00008 
00009 #include "precomp.h"
00010 #include "API/GUI/progressbar.h"
00011 #include "API/GUI/component_options.h"
00012 #include "API/GUI/stylemanager.h"
00013 #include "progressbar_generic.h"
00014 
00016 // Construction:
00017 
00018 CL_ProgressBar::CL_ProgressBar(
00019         const CL_ComponentOptions &options,
00020         CL_Component *parent,
00021         CL_StyleManager *style)
00022 :
00023         CL_Component(options, parent, style),
00024         impl(NULL)
00025 {
00026         impl = new CL_ProgressBar_Generic(this, options, get_style_manager());
00027         get_style_manager()->connect_styles("progressbar", options, this);
00028 }
00029 
00030 CL_ProgressBar::CL_ProgressBar(
00031         const CL_Rect &pos,
00032         int steps,
00033         CL_Component *parent,
00034         CL_StyleManager *style)
00035 :
00036         CL_Component(
00037                 CL_ProgressBar_Generic::create_options(pos, steps),
00038                 parent,
00039                 style),
00040         impl(NULL)
00041 {
00042         CL_ComponentOptions options = CL_ProgressBar_Generic::create_options(pos, steps);
00043         impl = new CL_ProgressBar_Generic(this, options, get_style_manager());
00044         get_style_manager()->connect_styles("progressbar", options, this);
00045 }
00046 
00047 CL_ProgressBar::~CL_ProgressBar()
00048 {
00049         delete impl;
00050 }
00051 
00053 // Attributes:
00054 
00055 int CL_ProgressBar::get_progress() const
00056 {
00057         return impl->progress;
00058 }
00059 
00060 int CL_ProgressBar::get_steps() const
00061 {
00062         return impl->steps;
00063 }
00064 
00065 float CL_ProgressBar::get_percentage() const
00066 {
00067         return impl->get_percentage();
00068 }
00069 
00071 // Operations:
00072 
00073 void CL_ProgressBar::set_steps(int total_steps)
00074 {
00075         impl->set_steps(total_steps);
00076 }
00077 
00078 void CL_ProgressBar::set_progress(int progress)
00079 {
00080         impl->set_progress(progress);
00081 }
00082 
00083 void CL_ProgressBar::increase(int steps)
00084 {
00085         impl->increase(steps);
00086 }
00087 
00088 void CL_ProgressBar::reset()
00089 {
00090         impl->reset();
00091 }
00092 
00094 // Signals:

Generated at Wed Apr 4 19:54:02 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001