/programs/cmm/lib/gui/sensor.h |
---|
24,22 → 24,18 |
:void sensor::draw_wrapper() |
{ |
DrawRectangle(x-1, y-1, w+1, h+1, sc.work_graph); |
DrawRectangle3D(x-2, y-2, w+3, h+3, sc.work_dark, sc.work_light); |
DrawRectangle3D(x-2, y-2, w+3, h+3, sc.work, sc.work_light); |
} |
:void sensor::draw_progress(dword progress_w, active_value, bg_value, mesure) |
:void sensor::draw_progress(dword progress_w) |
{ |
if (progress_w < MIN_PB_BLOCK_W) progress_w = MIN_PB_BLOCK_W; |
if (progress_w > w-MIN_PB_BLOCK_W) progress_w = w-MIN_PB_BLOCK_W; |
char textp[16]; |
DrawBar(x, y, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, PROGRESS_BG, 200)); |
DrawBar(x, y+1, w-progress_w, h-2, PROGRESS_ACTIVE); |
DrawBar(x, y+h-1, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, sc.work_graph, 200)); |
DrawBar(x+w-progress_w, y, progress_w, h, PROGRESS_BG); |
sprintf(#param, "%i%s", active_value, mesure); |
WriteText(w-progress_w- calc(strlen(#param)*8) /2 + x, h/2-7+y, 0x90, PROGRESS_BG, #param); |
DrawBar(x+w-progress_w, y, progress_w, h, PROGRESS_BG); |
sprintf(#param, "%i%s", bg_value, mesure); |
WriteText(-progress_w - calc(strlen(#param)*8)/2 + w+x, h/2-7+y, 0x90, PROGRESS_BG_TEXT, #param); |
strcpy(#textp, itoa(w-progress_w*100/w)); |
chrcat(#textp, '%'); |
WriteText(-strlen(#textp)*8 + w / 2 + x, h/2-7+y, 0x90, 0x000000, #textp); |
} |
/programs/cmm/lib/gui/tabs.h |
---|
1,5 → 1,7 |
#ifndef TAB_PADDING |
#define TAB_PADDING 15 |
#endif |
#define TAB_PADDING 15 |
#define TAB_HEIGHT 28 |
:struct _tabs |
6,7 → 8,7 |
{ |
int active_tab; |
int x,y,w,h; |
void draw_button(); |
dword draw_button(); |
int click(); |
void draw_wrapper(); |
}; |
14,10 → 16,10 |
:void _tabs::draw_wrapper() |
{ |
DrawRectangle(x,y+TAB_HEIGHT,w-1,h-TAB_HEIGHT, sc.work_graph); |
DrawRectangle(x+1,y+1+TAB_HEIGHT,w-3,h-2-TAB_HEIGHT, sc.work_light); |
DrawBar(x+1,y+1+TAB_HEIGHT,w-3,1, sc.work_light); |
} |
:void _tabs::draw_button(dword xx, but_id, text) |
:dword _tabs::draw_button(dword xx, but_id, text) |
{ |
dword col_bg, col_text; |
dword ww=strlen(text)*8, hh=TAB_HEIGHT; |
36,6 → 38,7 |
WriteText(xx, y+6, 0x90, col_text, text); |
DrawBar(xx, y+hh-3, ww, 3, col_bg); |
//DrawStandartCaptButton(xx, y, but_id, text); //GetFreeButtonId() |
return xx; |
} |
:int _tabs::click(int N) |
/programs/cmm/lib/patterns/libimg_load_skin.h |
---|
43,4 → 43,15 |
if (icon_n>=0) img_draw stdcall(icons32draw.image, x, y, 32, 32, 0, icon_n*32); |
} |
:libimg_image icons16draw; |
:void DrawIcon16(dword x,y, bg, icon_n) { |
//load_dll(libimg, #libimg_init,1); |
if (!icons16draw.image) { |
Libimg_LoadImage(#icons16draw, "/sys/icons16.png"); |
Libimg_ReplaceColor(icons16draw.image, icons16draw.w, icons16draw.h, 0xffFFFfff, bg); |
Libimg_ReplaceColor(icons16draw.image, icons16draw.w, icons16draw.h, 0xffCACBD6, MixColors(bg, 0, 220)); |
} |
if (icon_n>=0) img_draw stdcall(icons16draw.image, x, y, 16, 16, 0, icon_n*16); |
} |
#endif |