00001 #include <GLICT/progressbar.h>
00002 #include <GLICT/globals.h>
00003 #include <GLICT/types.h>
00004 glictProgressBar::glictProgressBar () {
00005 percent = 0;
00006 }
00007
00008 glictProgressBar::~glictProgressBar () {
00009
00010 }
00011
00012 void glictProgressBar::Paint() {
00013 static glictColor white(1,1,1,1);
00014 static glictColor green(0,1,0,1);
00015 glictGlobals.PaintRect(this->x+glictGlobals.translation.x, this->x+this->width+glictGlobals.translation.x,
00016 this->y+glictGlobals.translation.y, this->y+this->height+glictGlobals.translation.y, white);
00017
00018 glictGlobals.PaintRect(this->x+glictGlobals.translation.x +2, this->x+this->width+glictGlobals.translation.x -2,
00019 this->y+glictGlobals.translation.y +2, this->y+this->height+glictGlobals.translation.y -2, green);
00020
00021
00022 this->CPaint();
00023
00024
00025 this->SetScissor();
00026
00027 }
00028
00029 void glictProgressBar::SetValue(float newpcnt) {
00030 percent = newpcnt;
00031 }
00032
00033 void glictProgressBar::AddValue(float newpcnt) {
00034 percent += newpcnt;
00035 }
00036
00037 float glictProgressBar::GetValue() {
00038 return percent;
00039 }
00040