2013-03-21 02:35:57 +04:00
|
|
|
|
//Leency 2008-2013
|
|
|
|
|
|
2013-08-04 03:35:59 +04:00
|
|
|
|
#ifdef LANG_RUS
|
2013-11-14 04:22:55 +04:00
|
|
|
|
?define T_DEVICES "<EFBFBD><EFBFBD><EFBFBD>ன<EFBFBD>⢠"
|
|
|
|
|
?define T_ACTIONS "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢨<EFBFBD>"
|
|
|
|
|
char *actions[] = {
|
|
|
|
|
57, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>", "F7",
|
|
|
|
|
56, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>", "F6",
|
|
|
|
|
60, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ன<EFBFBD><EFBFBD>", "F10",
|
|
|
|
|
0,0,0
|
|
|
|
|
};
|
2015-07-16 04:44:30 +03:00
|
|
|
|
?define T_PROG "<EFBFBD>ணࠬ<EFBFBD><EFBFBD> "
|
|
|
|
|
?define T_SYS "<EFBFBD><EFBFBD><EFBFBD>⥬<EFBFBD> "
|
|
|
|
|
?define T_UNC "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⭮ "
|
|
|
|
|
?define T_CD "CD-ROM "
|
|
|
|
|
?define T_FD "<EFBFBD><EFBFBD>᪥<EFBFBD><EFBFBD> "
|
|
|
|
|
?define T_HD "<EFBFBD><EFBFBD><EFBFBD>⪨<EFBFBD> <20><><EFBFBD><EFBFBD> "
|
|
|
|
|
?define T_SATA "SATA <20><><EFBFBD><EFBFBD> "
|
|
|
|
|
?define T_USB "USB <20><><EFBFBD><EFBFBD> "
|
|
|
|
|
?define T_RAM "RAM <20><><EFBFBD><EFBFBD> "
|
2013-09-24 22:50:05 +04:00
|
|
|
|
#elif LANG_EST
|
2013-11-14 04:22:55 +04:00
|
|
|
|
?define T_DEVICES "Seadmed"
|
|
|
|
|
?define T_ACTIONS "Toimingud"
|
|
|
|
|
char *actions[] = {
|
|
|
|
|
57, "Uus fail", "F7",
|
|
|
|
|
56, "Uus kataloog", "F6",
|
|
|
|
|
60, "Seaded", "F10",
|
|
|
|
|
0,0,0
|
|
|
|
|
};
|
2015-07-16 04:44:30 +03:00
|
|
|
|
?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"
|
2013-08-04 03:35:59 +04:00
|
|
|
|
#else
|
2013-11-14 04:22:55 +04:00
|
|
|
|
?define T_DEVICES "Devices"
|
|
|
|
|
?define T_ACTIONS "Actions"
|
|
|
|
|
char *actions[] = {
|
|
|
|
|
57, "New file", "F7",
|
|
|
|
|
56, "New folder", "F6",
|
2015-02-19 10:42:42 +03:00
|
|
|
|
60, "Settings", "F10",
|
2013-11-14 04:22:55 +04:00
|
|
|
|
0,0,0
|
|
|
|
|
};
|
2015-07-16 04:44:30 +03:00
|
|
|
|
?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"
|
2013-08-04 03:35:59 +04:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2013-03-11 22:16:24 +04:00
|
|
|
|
void Tip(int y, dword caption, id, arrow)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
DrawBar(17,y,160,1,0xEFEDEE);
|
|
|
|
|
DrawFilledBar(17, y+1, 160, 16);
|
2015-08-04 17:36:07 +03:00
|
|
|
|
WriteText(25,y+5,0x80,system.color.work_text,caption);
|
2015-07-30 18:49:09 +03:00
|
|
|
|
if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
|
2015-08-04 17:36:07 +03:00
|
|
|
|
WriteText(165,y+5,0x80,system.color.work_text,arrow); //arrow
|
|
|
|
|
DrawBar(17,y+17,160,1,system.color.work_graph);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-12-13 16:52:19 +03:00
|
|
|
|
collection disk_list;
|
2013-10-01 00:44:45 +04:00
|
|
|
|
|
2015-02-21 15:24:30 +03:00
|
|
|
|
void GetSystemDiscs()
|
2013-03-11 22:16:24 +04:00
|
|
|
|
{
|
2014-10-31 02:20:36 +03:00
|
|
|
|
char dev_name[10], sys_discs[10];
|
2015-12-13 16:52:19 +03:00
|
|
|
|
int i1, j1, dev_num, dev_disc_num;
|
2015-08-17 16:45:24 +03:00
|
|
|
|
dword temp_file_count, tempbuf;
|
2015-12-13 16:52:19 +03:00
|
|
|
|
dword devbuf;
|
2015-08-17 16:45:24 +03:00
|
|
|
|
|
2015-12-13 16:52:19 +03:00
|
|
|
|
disk_list.init(4096);
|
|
|
|
|
devbuf = malloc(10000);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
ReadDir(19, devbuf, "/");
|
|
|
|
|
dev_num = EBX;
|
|
|
|
|
for (i1=0; i1<dev_num; i1++)
|
|
|
|
|
{
|
2015-07-16 04:44:30 +03:00
|
|
|
|
sprintf(#dev_name,"/%s/",i1*304+ devbuf+72);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
Open_Dir(#dev_name, ONLY_OPEN);
|
2013-04-01 00:25:54 +04:00
|
|
|
|
dev_disc_num = files.count;
|
2013-03-11 22:16:24 +04:00
|
|
|
|
for (j1=0; j1<dev_disc_num; j1++;)
|
|
|
|
|
{
|
2015-12-13 16:52:19 +03:00
|
|
|
|
sprintf(#sys_discs,"%s%s/",#dev_name,j1*304+ buf+72);
|
|
|
|
|
disk_list.add(#sys_discs);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
2015-12-13 16:52:19 +03:00
|
|
|
|
if (!strcmp(#sys_discs, "/rd/1/"))
|
2013-10-01 00:44:45 +04:00
|
|
|
|
{
|
2015-08-17 16:45:24 +03:00
|
|
|
|
GetDir(#tempbuf, #temp_file_count, "/kolibrios/", DIRS_ONLYREAL);
|
2015-12-13 16:52:19 +03:00
|
|
|
|
if (temp_file_count) disk_list.add("/kolibrios/");
|
2015-08-17 16:45:24 +03:00
|
|
|
|
free(tempbuf);
|
2013-11-14 04:22:55 +04:00
|
|
|
|
}
|
2015-12-13 16:52:19 +03:00
|
|
|
|
else if (!strcmp(#sys_discs, "/fd/1/")) CMD_ENABLE_SAVE_IMG = true;
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
2015-12-13 16:52:19 +03:00
|
|
|
|
free(devbuf);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-02-21 15:24:30 +03:00
|
|
|
|
void DrawSystemDiscs()
|
2013-03-11 22:16:24 +04:00
|
|
|
|
{
|
2015-08-20 18:04:18 +03:00
|
|
|
|
char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len;
|
2015-08-10 01:26:14 +03:00
|
|
|
|
int pos_y, pos_x=2;
|
2013-03-11 22:16:24 +04:00
|
|
|
|
|
2015-12-13 16:52:19 +03:00
|
|
|
|
for (i=0; i<30; i++) DeleteButton(100+i);
|
|
|
|
|
for (i=0;i<disk_list.count;i++)
|
2013-03-11 22:16:24 +04:00
|
|
|
|
{
|
2015-12-13 16:52:19 +03:00
|
|
|
|
strcpy(#dev_name, disk_list.get(i));
|
2013-03-11 22:16:24 +04:00
|
|
|
|
dev_name[strlen(#dev_name)-1]=NULL;
|
|
|
|
|
switch(dev_name[1])
|
|
|
|
|
{
|
2013-10-01 00:44:45 +04:00
|
|
|
|
case 'k':
|
|
|
|
|
dev_icon=0;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_PROG);
|
2013-10-01 00:44:45 +04:00
|
|
|
|
break;
|
2013-03-11 22:16:24 +04:00
|
|
|
|
case 'r':
|
|
|
|
|
dev_icon=0;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_SYS);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
break;
|
|
|
|
|
case 'c':
|
|
|
|
|
dev_icon=1;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_CD);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
break;
|
|
|
|
|
case 'f':
|
|
|
|
|
dev_icon=2;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_FD);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
case 'b':
|
|
|
|
|
dev_icon=3;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_HD);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
break;
|
2013-03-21 02:35:57 +04:00
|
|
|
|
case 's':
|
|
|
|
|
dev_icon=3;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_SATA);
|
2013-03-21 02:35:57 +04:00
|
|
|
|
break;
|
2013-03-11 22:16:24 +04:00
|
|
|
|
case 'u':
|
|
|
|
|
dev_icon=5;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_USB);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
break;
|
|
|
|
|
case 't':
|
|
|
|
|
dev_icon=4;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_RAM);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
break;
|
|
|
|
|
default:
|
2015-08-09 22:08:57 +03:00
|
|
|
|
dev_icon=3;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
strcpy(#disc_name, T_UNC);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
2015-07-31 14:57:51 +03:00
|
|
|
|
if (strstr(#path, #dev_name)) is_active=true; else is_active=false;
|
2015-08-09 22:08:57 +03:00
|
|
|
|
if (!two_panels)
|
2015-07-31 02:11:23 +03:00
|
|
|
|
{
|
2015-08-09 22:08:57 +03:00
|
|
|
|
pos_y = i*16+74;
|
|
|
|
|
DrawBar(17,pos_y,6,17,0xFFFFFF);
|
|
|
|
|
DrawBar(17+6+18,pos_y,160-6-18,17,0xFFFFFF);
|
|
|
|
|
DefineButton(17,pos_y,159,16,100+i+BT_HIDE,0xFFFFFF);
|
|
|
|
|
if (show_dev_name)
|
|
|
|
|
{
|
|
|
|
|
strcat(#disc_name, #dev_name);
|
|
|
|
|
if (is_active) WriteText(46+1,pos_y+5,0x80,0x555555,#disc_name);
|
|
|
|
|
WriteText(46,pos_y+5,0x80,0,#disc_name);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (is_active) WriteText(46+1,pos_y+5,0x80,0x555555,#dev_name);
|
|
|
|
|
WriteText(46,pos_y+5,0x80,0,#dev_name);
|
|
|
|
|
}
|
|
|
|
|
_PutImage(23,pos_y, 18,17, is_active*6+dev_icon*17*18*3+#devices);
|
2015-07-31 02:11:23 +03:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-08-10 01:26:14 +03:00
|
|
|
|
pos_y = 43;
|
2015-08-20 18:04:18 +03:00
|
|
|
|
name_len = strlen(#dev_name)-1*8;
|
|
|
|
|
DrawBar(pos_x, pos_y, name_len + 31, 17, 0xFFFFFF);
|
|
|
|
|
DefineButton(pos_x+2, pos_y, name_len + 27, 16, 100+i+BT_HIDE,0xFFFFFF);
|
2015-08-09 22:08:57 +03:00
|
|
|
|
_PutImage(pos_x + 5, pos_y, 18,17, is_active*6+dev_icon*17*18*3+#devices);
|
2015-08-20 18:04:18 +03:00
|
|
|
|
WriteText(pos_x + 24, pos_y+1, 10110000b, 0, #dev_name+1);
|
|
|
|
|
pos_x += name_len + 31;
|
2015-07-31 02:11:23 +03:00
|
|
|
|
}
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
2015-08-10 01:26:14 +03:00
|
|
|
|
if (two_panels)
|
|
|
|
|
{
|
|
|
|
|
DrawBar(pos_x, pos_y, Form.cwidth - pos_x - 2, 17, 0xFFFFFF);
|
|
|
|
|
DrawBar(2, pos_y-2, Form.cwidth - 4, 2, 0xFFFFFF);
|
|
|
|
|
DrawBar(2, pos_y+17, Form.cwidth - 4, 2, 0xFFFFFF);
|
2015-08-14 17:47:36 +03:00
|
|
|
|
DefineButton(Form.cwidth - 23, pos_y, 17,16, 60+BT_HIDE, 0xCCCccc);
|
|
|
|
|
_PutImage(Form.cwidth - 21, pos_y+2, 14,13, 2*14*13*3+#factions);
|
2015-08-10 01:26:14 +03:00
|
|
|
|
}
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-09 22:08:57 +03:00
|
|
|
|
|
2013-04-01 00:25:54 +04:00
|
|
|
|
void ActionsDraw()
|
2013-03-11 22:16:24 +04:00
|
|
|
|
{
|
2015-12-13 16:52:19 +03:00
|
|
|
|
int actions_y=disk_list.count*16+108, lineh=16;
|
2013-08-04 03:35:59 +04:00
|
|
|
|
Tip(actions_y-18, T_ACTIONS, 77, ""); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-04-01 00:25:54 +04:00
|
|
|
|
for (i=0; actions[i*3]!=0; i++, actions_y+=lineh)
|
2013-03-11 22:16:24 +04:00
|
|
|
|
{
|
2013-04-01 00:25:54 +04:00
|
|
|
|
DrawBar(17,actions_y,160,lineh,0xFFFFFF); //<2F><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1);
|
|
|
|
|
WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
|
|
|
|
|
WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
|
2014-10-30 00:59:44 +03:00
|
|
|
|
_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-02-21 15:24:30 +03:00
|
|
|
|
void DrawLeftPanelBg()
|
2013-03-11 22:16:24 +04:00
|
|
|
|
{
|
2015-12-13 16:52:19 +03:00
|
|
|
|
int actions_y=disk_list.count*16;
|
2013-04-01 00:25:54 +04:00
|
|
|
|
int start_y = actions_y+156;
|
2015-08-18 18:02:42 +03:00
|
|
|
|
int onTop1;
|
2013-03-11 22:16:24 +04:00
|
|
|
|
DrawBar(2,41,190,15,col_lpanel); //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
DrawBar(17,actions_y+75,160,15,col_lpanel); //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-08-31 22:33:48 +04:00
|
|
|
|
PutShadow(17,actions_y+75,160,1,1,3);
|
2013-04-01 00:25:54 +04:00
|
|
|
|
PutShadow(18,actions_y+75+1,158,1,1,1);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
DrawBar(2,56,15,actions_y+103,col_lpanel); //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
DrawBar(177,56,15,actions_y+103,col_lpanel); //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-08-18 18:02:42 +03:00
|
|
|
|
onTop1 = Form.cheight-start_y-2;
|
|
|
|
|
if (onTop1 < 268)
|
|
|
|
|
{
|
|
|
|
|
PutPaletteImage(#blue_hl, 190, onTop1, 2, start_y, 8, #blue_hl_pal);
|
|
|
|
|
}
|
2013-03-11 22:16:24 +04:00
|
|
|
|
else
|
|
|
|
|
{
|
2015-08-18 18:02:42 +03:00
|
|
|
|
DrawBar(2,start_y,190, onTop1-268, col_lpanel);
|
|
|
|
|
PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270, 8, #blue_hl_pal);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
2013-08-31 22:33:48 +04:00
|
|
|
|
PutShadow(17,start_y,160,1,1,3);
|
2013-04-01 00:25:54 +04:00
|
|
|
|
PutShadow(18,start_y+1,158,1,1,1);
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-08-14 17:47:36 +03:00
|
|
|
|
void DrawDeviceAndActionsLeftPanel()
|
2013-03-11 22:16:24 +04:00
|
|
|
|
{
|
2015-07-31 02:11:23 +03:00
|
|
|
|
Tip(56, T_DEVICES, 55, "=");
|
2015-02-21 15:24:30 +03:00
|
|
|
|
DrawSystemDiscs();
|
2013-04-01 00:25:54 +04:00
|
|
|
|
ActionsDraw();
|
2015-02-21 15:24:30 +03:00
|
|
|
|
DrawLeftPanelBg();
|
2013-03-11 22:16:24 +04:00
|
|
|
|
}
|
2015-08-09 22:08:57 +03:00
|
|
|
|
|
|
|
|
|
|
2015-12-13 16:52:19 +03:00
|
|
|
|
void ClickOnDisk(int n)
|
2015-08-09 22:08:57 +03:00
|
|
|
|
{
|
2015-12-13 16:52:19 +03:00
|
|
|
|
strcpy(#path, disk_list.get(n));
|
2015-08-09 22:08:57 +03:00
|
|
|
|
files.KeyHome();
|
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
|
|
|
|
}
|