25
25
///////////////////////////////////////////////////////////////////////////////
26
26
// Makros / Defines
27
27
#if defined _WIN32 && defined _DEBUG && defined _MSC_VER
28
#define new new(_NORMAL_BLOCK, THIS_FILE, __LINE__)
30
static char THIS_FILE[] = __FILE__;
28
#define new new(_NORMAL_BLOCK, THIS_FILE, __LINE__)
30
static char THIS_FILE[] = __FILE__;
33
33
///////////////////////////////////////////////////////////////////////////////
39
ctrlPercent::ctrlPercent(Window *parent,
44
unsigned short height,
46
unsigned int text_color,
47
glArchivItem_Font *font,
48
const unsigned short *percentage)
49
: Window(x, y, id, parent, width, height),
50
tc(tc), text_color(text_color), font(font), percentage(percentage)
39
ctrlPercent::ctrlPercent(Window* parent,
44
unsigned short height,
46
unsigned int text_color,
47
glArchivItem_Font* font,
48
const unsigned short* percentage)
49
: Window(x, y, id, parent, width, height),
50
tc(tc), text_color(text_color), font(font), percentage(percentage)
62
62
bool ctrlPercent::Draw_(void)
64
// Wenn der Prozentsatzpointer = 0, dann wird 0 angezeigt und es soll nich abst�rzen!
65
unsigned short percentage = (this->percentage ? *this->percentage : 0);
68
unsigned int color = 0xFFFF0000;
73
// Farbe w�hlen je nachdem wie viel Prozent
76
else if(percentage >= 30)
78
else if(percentage >= 20)
82
Draw3D(GetX(), GetY(), width, height, tc, 2);
84
// Fortschritt zeichnen
85
DrawRectangle(GetX()+4, GetY()+4, (width-8)*percentage/100, height-8, color);
89
sprintf(caption,"%u%%",percentage);
90
font->Draw(GetX() + width/2, GetY() + height/2, caption, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_VCENTER, text_color);
64
// Wenn der Prozentsatzpointer = 0, dann wird 0 angezeigt und es soll nich abst�rzen!
65
unsigned short percentage = (this->percentage ? *this->percentage : 0);
68
unsigned int color = 0xFFFF0000;
73
// Farbe w�hlen je nachdem wie viel Prozent
76
else if(percentage >= 30)
78
else if(percentage >= 20)
82
Draw3D(GetX(), GetY(), width, height, tc, 2);
84
// Fortschritt zeichnen
85
DrawRectangle(GetX() + 4, GetY() + 4, (width - 8)*percentage / 100, height - 8, color);
89
sprintf(caption, "%u%%", percentage);
90
font->Draw(GetX() + width / 2, GetY() + height / 2, caption, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_VCENTER, text_color);