1,42 → 1,4 |
|
#ifdef LANG_RUS |
?define T_DEVICES "áâனá⢠" |
?define T_ACTIONS "¥©á⢨ï" |
char *actions[] = { |
59, "®¢ë© ä ©«", "F9", |
57, "®¢ ï ¯ ¯ª ", "F7", |
60, " áâனª¨", "F10", |
0,0,0 |
}; |
?define T_PROG "à®£à ¬¬ë " |
?define T_SYS "¨á⥬ " |
?define T_UNC "¥¨§¢¥áâ® " |
?define T_CD "CD-ROM " |
?define T_FD "¨áª¥â " |
?define T_HD "¥á⪨© ¤¨áª " |
?define T_SATA "SATA ¤¨áª " |
?define T_USB "USB ¤¨áª " |
?define T_RAM "RAM ¤¨áª " |
#else |
?define T_DEVICES "Devices" |
?define T_ACTIONS "Actions" |
char *actions[] = { |
59, "New file", "F9", |
57, "New folder", "F7", |
60, "Settings", "F10", |
0,0,0 |
}; |
?define T_PROG "Programs " |
?define T_SYS "System " |
?define T_UNC "Unknown " |
?define T_CD "CD-ROM " |
?define T_FD "Floppy disk " |
?define T_HD "Hard disk " |
?define T_SATA "SATA disk " |
?define T_USB "USB disk " |
?define T_RAM "RAM disk " |
#endif |
|
struct _SystemDiscs |
{ |
collection list; |
48,51 → 10,6 |
void Click(); |
} SystemDiscs=0; |
|
#define DEV_H 17 |
#define DEV_H_HOR 20 |
|
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, disc_name) |
{ |
switch(disk_first_letter) |
{ |
case 'r': |
ESBYTE[dev_icon]=0; |
strcpy(disc_name, T_SYS); |
break; |
case 'k': |
ESBYTE[dev_icon]=1; |
strcpy(disc_name, T_PROG); |
break; |
case 'f': |
ESBYTE[dev_icon]=2; |
strcpy(disc_name, T_FD); |
break; |
case 'c': |
ESBYTE[dev_icon]=3; |
strcpy(disc_name, T_CD); |
break; |
case 'h': |
case 'b': |
ESBYTE[dev_icon]=4; |
strcpy(disc_name, T_HD); |
break; |
case 's': |
ESBYTE[dev_icon]=4; |
strcpy(disc_name, T_SATA); |
break; |
case 't': |
ESBYTE[dev_icon]=5; |
strcpy(disc_name, T_RAM); |
break; |
case 'u': |
ESBYTE[dev_icon]=6; |
strcpy(disc_name, T_USB); |
break; |
default: |
ESBYTE[dev_icon]=5; |
} |
} |
|
void _SystemDiscs::Get() |
{ |
bool kolibrios_exists=false; |
126,23 → 43,35 |
free(diskbuf); |
} |
|
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, dword disc_name) |
{ |
int i; |
for (i=0; devinfo[i]!=0; i+=3) { |
if (disk_first_letter == ESBYTE[devinfo[i]]) { |
ESBYTE[dev_icon] = devinfo[i+1]; |
strcpy(disc_name, devinfo[i+2]); |
return; |
} |
} |
ESBYTE[dev_icon]=5; |
strcpy(disc_name, T_UNC); |
} |
|
#define DEV_H 17 |
#define DDW 120 |
#define KFM2_DEVH 20 |
|
void _SystemDiscs::Draw() |
{ |
char dev_name[15], disc_name[100], i, dev_icon, is_active=0; |
char dev_name[15], disc_name[100], i, dev_icon; |
bool is_active=0; |
int draw_y, draw_x; |
|
for (i=0; i<30; i++) DeleteButton(100+i); |
|
if (efm) { |
if (active_panel==0) { |
DrawSelect(Form.cwidth/2-DDW, 10, #path, KFM_DEV_DROPDOWN_1); |
DrawSelect(Form.cwidth-DDW-2, 10, #inactive_path, KFM_DEV_DROPDOWN_2); |
} else { |
DrawSelect(Form.cwidth/2-DDW, 10, #inactive_path, KFM_DEV_DROPDOWN_1); |
DrawSelect(Form.cwidth-DDW-2, 10, #path, KFM_DEV_DROPDOWN_2); |
} |
DrawSelect(Form.cwidth/2-DDW, KFM_DEV_DROPDOWN_1, location[0]); |
DrawSelect(Form.cwidth-DDW-2, KFM_DEV_DROPDOWN_2, location[sizeof(dword)]); |
files.y = 40 + 17; |
} else { |
draw_y = 74; |
150,11 → 79,11 |
for (i=0;i<list.count;i++) { |
strcpy(#dev_name, list.get(i)); |
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); |
if (strstr(#path, #dev_name)==#path) is_active=true; else is_active=false; |
if (strstr(path, #dev_name)==path) is_active=true; else is_active=false; |
|
DrawBar(draw_x,draw_y,6,DEV_H+1,0xFFFFFF); |
DrawBar(draw_x+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF); |
DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF); |
DefineHiddenButton(draw_x,draw_y,159,16,100+i); |
if (show_dev_name.checked) |
{ |
strcat(#disc_name, #dev_name); |
174,59 → 103,59 |
} |
} |
|
void _SystemDiscs::DrawSelect(int draw_x, draw_y, path1, btid) |
void _SystemDiscs::DrawSelect(int draw_x, btid, dword _path) |
{ |
char dev_name[15], disc_name[100], i, dev_icon, is_active=0; |
if (ESBYTE[path1+1]=='\0') { |
#define SELECTY 10 |
char dev_name[15], disc_name[100], i, dev_icon; |
|
if (ESBYTE[_path+1]=='\0') { |
strcpy(#dev_name, "/root"); |
dev_icon = 0; |
} else if (chrnum(path1, '/')==1) { |
strcpy(#dev_name, path1); |
} else if (chrnum(_path, '/')==1) { |
strcpy(#dev_name, _path); |
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); |
} else for (i=0;i<list.count;i++) { |
strcpy(#dev_name, list.get(i)); |
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); |
if (strstr(path1, #dev_name)-path1==0) break; |
if (strstr(_path, #dev_name)-_path==0) break; |
} |
DrawRectangle(draw_x-1, draw_y-1, DDW+2-DEV_H_HOR, DEV_H_HOR+1, sc.work_graph); |
DrawBar(draw_x, draw_y, DDW+1-DEV_H_HOR, DEV_H_HOR, 0xFFFFFF); |
_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*7+dev_icon*17*18*3+#devices); |
kfont.WriteIntoWindow(draw_x + 24, draw_y+2, 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1); |
DefineButton(draw_x, draw_y, DDW-1, DEV_H_HOR-1, btid+1+BT_HIDE,0xFFFFFF); |
DrawFlatButtonSmall(draw_x+DDW-DEV_H_HOR+1, draw_y-1, DEV_H_HOR-1, DEV_H_HOR+1, btid, "\x19"); |
|
draw_x += DDW + 1; |
//DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, sc.work); |
DrawRectangle(draw_x-1, SELECTY-1, DDW+2-KFM2_DEVH, KFM2_DEVH+1, sc.work_graph); |
DrawBar(draw_x, SELECTY, DDW+1-KFM2_DEVH, KFM2_DEVH, 0xFFFFFF); |
_PutImage(draw_x + 5, SELECTY+2, 18,17, dev_icon*17*18*3+#devices); |
kfont.WriteIntoWindow(draw_x + 24, math.max(KFM2_DEVH-kfont.height/2+SELECTY,0), 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1); |
DefineHiddenButton(draw_x, SELECTY, DDW-1, KFM2_DEVH-1, btid+1); |
DrawFlatButtonSmall(draw_x+DDW-KFM2_DEVH+1, SELECTY-1, KFM2_DEVH-1, KFM2_DEVH+1, btid, "\x19"); |
} |
|
void _SystemDiscs::DrawOptions(int draw_x, draw_y) |
void _SystemDiscs::DrawOptions(int draw_x) |
{ |
int optionsy = SELECTY+KFM2_DEVH+1; |
char dev_name[15], disc_name[100], i, dev_icon, is_active=0; |
|
for (i=0; i<30; i++) DeleteButton(100+i); |
|
DrawPopup(draw_x, draw_y, DDW, list.count*DEV_H_HOR, 1, -1, sc.work_graph); |
DrawPopup(draw_x, optionsy, DDW, list.count*KFM2_DEVH, 1, -1, sc.work_graph); |
|
for (i=0;i<list.count;i++) { |
strcpy(#dev_name, list.get(i)); |
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); |
if (strstr(#path, #dev_name)!=0) is_active=true; else is_active=false; |
if (strstr(path, #dev_name)!=0) is_active=true; else is_active=false; |
|
DrawBar(draw_x, draw_y, DDW, DEV_H_HOR, 0xFFFFFF); |
DefineButton(draw_x, draw_y, DDW, DEV_H_HOR-1, 100+i+BT_HIDE,0xFFFFFF); |
_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*7+dev_icon*17*18*3+#devices); |
DrawBar(draw_x, optionsy, DDW, KFM2_DEVH, 0xFFFFFF); |
DefineButton(draw_x, optionsy, DDW, KFM2_DEVH-1, 100+i+BT_HIDE,0xFFFFFF); |
_PutImage(draw_x + 5, optionsy+2, 18,17, is_active*7+dev_icon*17*18*3+#devices); |
if (is_active) kfont.bold = true; |
kfont.WriteIntoWindow(draw_x + 24, draw_y+2, 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1); |
kfont.WriteIntoWindow(draw_x + 24, optionsy+2, 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1); |
kfont.bold = false; |
draw_y += DEV_H_HOR; |
optionsy += KFM2_DEVH; |
} |
} |
|
void _SystemDiscs::Click(int n) |
{ |
strcpy(#path, list.get(n)); |
strcpy(path, list.get(n)); |
files.KeyHome(); |
Open_Dir(#path,WITH_REDRAW); |
Open_Dir(path,WITH_REDRAW); |
} |
|
|
286,11 → 215,9 |
int start_y = actions_y+159; |
int area_h; |
DrawBar(2,41,190,15,waves_pal[0]); //above devices block |
DrawBar(17,actions_y+75,160,15,waves_pal[0]); //below devices block |
PutShadow(17,actions_y+75,160,1,1,3); |
PutShadow(18,actions_y+75+1,158,1,1,1); |
DrawBar(2,56,15,actions_y+103,waves_pal[0]); //on the left |
DrawBar(177,56,15,actions_y+103,waves_pal[0]); //on the right |
DrawBar(17,actions_y+75,160,15,EDX); //below devices block |
DrawBar(2,56,15,actions_y+103,EDX); //on the left |
DrawBar(177,56,15,actions_y+103,EDX); //on the right |
area_h = Form.cheight-start_y-2 - status_bar_h; |
if (area_h < 268){ |
PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #waves_pal); |
298,6 → 225,8 |
DrawBar(2,start_y,190, area_h-268, waves_pal[0]); |
PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #waves_pal); |
} |
PutShadow(17,actions_y+75,160,1,1,3); |
PutShadow(18,actions_y+75+1,158,1,1,1); |
PutShadow(17,start_y,160,1,1,3); |
PutShadow(18,start_y+1,158,1,1,1); |
} |