Rev 7422 | Rev 7532 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7422 | Rev 7491 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | #include "../lib/obj/libimg.h" |
14 | #include "../lib/obj/libimg.h" |
15 | #include "../lib/obj/libini.h" |
15 | #include "../lib/obj/libini.h" |
Line 16... | Line 16... | ||
16 | 16 | ||
17 | //===================================================// |
17 | //===================================================// |
18 | // // |
- | |
19 | // SENSOR // |
- | |
20 | // // |
- | |
21 | //===================================================// |
- | |
22 | - | ||
23 | #define MIN_PB_BLOCK_W 19 |
- | |
24 | #define LOAD_CPU 0x2460C8 |
- | |
25 | #define PROGRESS_ACTIVE 0x489FE4 |
- | |
26 | #define PROGRESS_BG 0xFFFfff |
- | |
27 | #define PROGRESS_BG_TEXT 0x696969 |
- | |
28 | - | ||
29 | struct sensor { |
- | |
30 | int x,y,w,h; |
- | |
31 | void set_size(); |
- | |
32 | void draw_wrapper(); |
- | |
33 | void draw_progress(); |
- | |
34 | }; |
- | |
35 | - | ||
36 | void sensor::set_size(dword _x, _y, _w, _h) |
- | |
37 | { |
- | |
38 | x=_x+2; |
- | |
39 | y=_y; |
- | |
40 | w=_w; |
- | |
41 | h=_h; |
- | |
42 | draw_wrapper(); |
- | |
43 | } |
- | |
44 | - | ||
45 | void sensor::draw_wrapper() |
- | |
46 | { |
- | |
47 | DrawRectangle(x-1, y-1, w+1, h+1, system.color.work_graph); |
- | |
48 | DrawRectangle3D(x-2, y-2, w+3, h+3, system.color.work_dark, system.color.work_light); |
- | |
49 | } |
- | |
50 | - | ||
51 | void sensor::draw_progress(dword progress_w, active_value, bg_value, mesure) |
- | |
52 | { |
- | |
53 | if (progress_w < MIN_PB_BLOCK_W) progress_w = MIN_PB_BLOCK_W; |
- | |
54 | if (progress_w > w-MIN_PB_BLOCK_W) progress_w = w-MIN_PB_BLOCK_W; |
- | |
55 | - | ||
56 | - | ||
57 | DrawBar(x, y, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, PROGRESS_BG, 200)); |
- | |
58 | DrawBar(x, y+1, w-progress_w, h-2, PROGRESS_ACTIVE); |
- | |
59 | DrawBar(x, y+h-1, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, system.color.work_graph, 200)); |
- | |
60 | - | ||
61 | - | ||
62 | sprintf(#param, "%i%s", active_value, mesure); |
- | |
63 | WriteText(w-progress_w- calc(strlen(#param)*8) /2 + x, h/2-7+y, 0x90, PROGRESS_BG, #param); |
- | |
64 | - | ||
65 | DrawBar(x+w-progress_w, y, progress_w, h, PROGRESS_BG); |
- | |
66 | sprintf(#param, "%i%s", bg_value, mesure); |
- | |
67 | WriteText(-progress_w - calc(strlen(#param)*8)/2 + w+x, h/2-7+y, 0x90, PROGRESS_BG_TEXT, #param); |
- | |
68 | } |
- | |
69 | - | ||
70 | //===================================================// |
- | |
71 | // // |
18 | // // |
72 | // DATA // |
19 | // DATA // |
73 | // // |
20 | // // |
Line 74... | Line 21... | ||
74 | //===================================================// |
21 | //===================================================// |