Rev 3114 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3114 | Rev 3225 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | //#include "strings.h" |
1 | //#include "strings.h" |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | void DrawRectangle(dword x,y,width,height,color1) |
3 | void DrawRectangle(dword x,y,w,h,color1) |
- | 4 | { |
|
4 | { |
5 | if (w<=0) || (h<=0) return; |
5 | DrawBar(x,y,width,1,color1); |
6 | DrawBar(x,y,w,1,color1); |
6 | DrawBar(x,y+height,width,1,color1); |
7 | DrawBar(x,y+h,w,1,color1); |
7 | DrawBar(x,y,1,height,color1); |
8 | DrawBar(x,y,1,h,color1); |
8 | DrawBar(x+width,y,1,height+1,color1); |
9 | DrawBar(x+w,y,1,h+1,color1); |
Line 9... | Line 10... | ||
9 | } |
10 | } |
10 | 11 | ||
- | 12 | void DrawRectangle3D(dword x,y,w,h,color1,color2) |
|
11 | void DrawRectangle3D(dword x,y,width,height,color1,color2) |
13 | { |
12 | { |
14 | if (w<=0) || (h<=0) return; |
13 | DrawBar(x,y,width+1,1,color1); |
15 | DrawBar(x,y,w+1,1,color1); |
14 | DrawBar(x,y+1,1,height-1,color1); |
16 | DrawBar(x,y+1,1,h-1,color1); |
15 | DrawBar(x+width,y+1,1,height,color2); |
17 | DrawBar(x+w,y+1,1,h,color2); |
Line 16... | Line 18... | ||
16 | DrawBar(x,y+height,width,1,color2); |
18 | DrawBar(x,y+h,w,1,color2); |
17 | } |
19 | } |
18 | 20 | ||
19 | void DrawCaptButton(dword x,y,width,height,id,color_b, color_t,text) |
21 | void DrawCaptButton(dword x,y,w,h,id,color_b, color_t,text) |
20 | { |
22 | { |
Line 21... | Line 23... | ||
21 | DefineButton(x,y,width,height,id,color_b); |
23 | DefineButton(x,y,w,h,id,color_b); |
22 | WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,color_t,text); |
24 | WriteText(-strlen(text)*6+w/2+x+1,h/2-3+y,0x80,color_t,text); |
23 | } |
25 | } |
Line 58... | Line 60... | ||
58 | } |
60 | } |
59 | } |
61 | } |
Line 60... | Line 62... | ||
60 | 62 | ||
61 | void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent, status_text) |
63 | void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent, status_text) |
62 | { |
64 | { |
63 | int progress_w = progress_percent * st_w / 100 - 3; |
65 | int progress_w; |
Line 64... | Line 66... | ||
64 | static int fill_old; |
66 | static int fill_old; |
Line 65... | Line 67... | ||
65 | 67 | ||
66 | if (!progress_percent) {DrawBar(st_x,st_y, st_x + st_y + fill_old + 15,st_h+1, col_fon); return;} |
68 | if (progress_percent<=0) {DrawBar(st_x,st_y, st_x + st_w + fill_old + 15,st_h+1, col_fon); fill_old=0; return;} |
- | 69 | ||
- | 70 | DrawRectangle(st_x, st_y, st_w,st_h, col_border); |
|
- | 71 | DrawRectangle3D(st_x+1, st_y+1, st_w-2,st_h-2, 0xFFFfff, 0xFFFfff); |
|
- | 72 | ||
67 | 73 | if (progress_percent>0) && (progress_percent<=100) |
|
68 | DrawRectangle(st_x, st_y, st_w,st_h, col_border); |
74 | { |
- | 75 | progress_w = st_w - 3 * progress_percent / 100; |
|
Line 69... | Line 76... | ||
69 | DrawRectangle3D(st_x+1, st_y+1, st_w-2,st_h-2, 0xFFFfff, 0xFFFfff); |
76 | DrawBar(st_x+2, st_y+2, progress_w, st_h-3, col_fill); |
70 | if (progress_percent) DrawBar(st_x+2, st_y+2, progress_w, st_h-3, col_fill); |
77 | DrawBar(st_x+2+progress_w, st_y+2, st_w-progress_w-3, st_h-3, 0xFFFfff); |
71 | if (progress_percent<100) DrawBar(st_x+2+progress_w, st_y+2, st_w-progress_w-3, st_h-3, 0xFFFfff); |
78 | } |
72 | 79 |