2013-03-20 23:35:57 +01:00
|
|
|
|
//Leency 2008-2013
|
|
|
|
|
|
2013-08-04 01:35:59 +02:00
|
|
|
|
#ifdef LANG_RUS
|
2013-11-14 01:22:55 +01: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 03:44:30 +02: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-08-04 01:35:59 +02:00
|
|
|
|
#else
|
2013-11-14 01:22:55 +01:00
|
|
|
|
?define T_DEVICES "Devices"
|
|
|
|
|
?define T_ACTIONS "Actions"
|
|
|
|
|
char *actions[] = {
|
|
|
|
|
57, "New file", "F7",
|
|
|
|
|
56, "New folder", "F6",
|
2015-02-19 08:42:42 +01:00
|
|
|
|
60, "Settings", "F10",
|
2013-11-14 01:22:55 +01:00
|
|
|
|
0,0,0
|
|
|
|
|
};
|
2015-07-16 03:44:30 +02: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 01:35:59 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
2016-01-06 21:50:19 +01:00
|
|
|
|
struct _SystemDiscs
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2016-01-06 21:50:19 +01:00
|
|
|
|
collection list;
|
|
|
|
|
void Get();
|
|
|
|
|
void Draw();
|
|
|
|
|
void Click();
|
|
|
|
|
} SystemDiscs;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
|
|
|
|
|
2016-01-06 21:50:19 +01:00
|
|
|
|
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, disc_name)
|
|
|
|
|
{
|
|
|
|
|
switch(disk_first_letter)
|
|
|
|
|
{
|
|
|
|
|
case 'k':
|
|
|
|
|
ESBYTE[dev_icon]=0;
|
|
|
|
|
strcpy(disc_name, T_PROG);
|
|
|
|
|
break;
|
|
|
|
|
case 'r':
|
|
|
|
|
ESBYTE[dev_icon]=0;
|
|
|
|
|
strcpy(disc_name, T_SYS);
|
|
|
|
|
break;
|
|
|
|
|
case 'c':
|
|
|
|
|
ESBYTE[dev_icon]=1;
|
|
|
|
|
strcpy(disc_name, T_CD);
|
|
|
|
|
break;
|
|
|
|
|
case 'f':
|
|
|
|
|
ESBYTE[dev_icon]=2;
|
|
|
|
|
strcpy(disc_name, T_FD);
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
case 'b':
|
|
|
|
|
ESBYTE[dev_icon]=3;
|
|
|
|
|
strcpy(disc_name, T_HD);
|
|
|
|
|
break;
|
|
|
|
|
case 's':
|
|
|
|
|
ESBYTE[dev_icon]=3;
|
|
|
|
|
strcpy(disc_name, T_SATA);
|
|
|
|
|
break;
|
|
|
|
|
case 'u':
|
|
|
|
|
ESBYTE[dev_icon]=5;
|
|
|
|
|
strcpy(disc_name, T_USB);
|
|
|
|
|
break;
|
|
|
|
|
case 't':
|
|
|
|
|
ESBYTE[dev_icon]=4;
|
|
|
|
|
strcpy(disc_name, T_RAM);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ESBYTE[dev_icon]=3;
|
|
|
|
|
strcpy(disc_name, T_UNC);
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-30 22:44:45 +02:00
|
|
|
|
|
2016-01-06 21:50:19 +01:00
|
|
|
|
void _SystemDiscs::Get()
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2014-10-31 00:20:36 +01:00
|
|
|
|
char dev_name[10], sys_discs[10];
|
2015-12-13 14:52:19 +01:00
|
|
|
|
int i1, j1, dev_num, dev_disc_num;
|
2015-08-17 15:45:24 +02:00
|
|
|
|
dword temp_file_count, tempbuf;
|
2015-12-13 14:52:19 +01:00
|
|
|
|
dword devbuf;
|
2015-08-17 15:45:24 +02:00
|
|
|
|
|
2016-01-06 21:50:19 +01:00
|
|
|
|
list.drop();
|
2015-12-13 14:52:19 +01:00
|
|
|
|
devbuf = malloc(10000);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
ReadDir(19, devbuf, "/");
|
|
|
|
|
dev_num = EBX;
|
|
|
|
|
for (i1=0; i1<dev_num; i1++)
|
|
|
|
|
{
|
2015-07-16 03:44:30 +02:00
|
|
|
|
sprintf(#dev_name,"/%s/",i1*304+ devbuf+72);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
Open_Dir(#dev_name, ONLY_OPEN);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
dev_disc_num = files.count;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
for (j1=0; j1<dev_disc_num; j1++;)
|
|
|
|
|
{
|
2015-12-13 14:52:19 +01:00
|
|
|
|
sprintf(#sys_discs,"%s%s/",#dev_name,j1*304+ buf+72);
|
2016-01-06 21:50:19 +01:00
|
|
|
|
list.add(#sys_discs);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2015-12-13 14:52:19 +01:00
|
|
|
|
if (!strcmp(#sys_discs, "/rd/1/"))
|
2013-09-30 22:44:45 +02:00
|
|
|
|
{
|
2015-08-17 15:45:24 +02:00
|
|
|
|
GetDir(#tempbuf, #temp_file_count, "/kolibrios/", DIRS_ONLYREAL);
|
2016-01-06 21:50:19 +01:00
|
|
|
|
if (temp_file_count) list.add("/kolibrios/");
|
2015-08-17 15:45:24 +02:00
|
|
|
|
free(tempbuf);
|
2013-11-14 01:22:55 +01:00
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2015-12-13 14:52:19 +01:00
|
|
|
|
free(devbuf);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 21:50:19 +01:00
|
|
|
|
void _SystemDiscs::Draw()
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2015-08-20 17:04:18 +02:00
|
|
|
|
char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len;
|
2016-01-06 21:50:19 +01:00
|
|
|
|
int draw_y, draw_x, draw_h;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2015-12-13 14:52:19 +01:00
|
|
|
|
for (i=0; i<30; i++) DeleteButton(100+i);
|
2016-01-06 21:50:19 +01:00
|
|
|
|
|
|
|
|
|
if ( two_panels) { draw_y = 41; draw_x = 2; draw_h = 21; }
|
|
|
|
|
if (!two_panels) { draw_y = 74; draw_x = 17; draw_h = 16; }
|
|
|
|
|
|
|
|
|
|
for (i=0;i<list.count;i++)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2016-01-06 21:50:19 +01:00
|
|
|
|
strcpy(#dev_name, list.get(i));
|
2013-03-11 19:16:24 +01:00
|
|
|
|
dev_name[strlen(#dev_name)-1]=NULL;
|
2016-01-06 21:50:19 +01:00
|
|
|
|
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
|
|
|
|
|
if (strstr(#path, #dev_name)) is_active=true; else is_active=false;
|
|
|
|
|
if (two_panels)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2016-01-06 21:50:19 +01:00
|
|
|
|
name_len = strlen(#dev_name)-1*8;
|
|
|
|
|
DrawBar(draw_x, draw_y, name_len + 31, draw_h, 0xFFFFFF);
|
|
|
|
|
DefineButton(draw_x+2, draw_y, name_len + 27, draw_h-1, 100+i+BT_HIDE,0xFFFFFF);
|
|
|
|
|
_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*6+dev_icon*17*18*3+#devices);
|
|
|
|
|
WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1);
|
|
|
|
|
draw_x += name_len + 31;
|
|
|
|
|
if (draw_x>=Form.width-35) && (Form.width) {
|
|
|
|
|
DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF);
|
|
|
|
|
draw_x = 2;
|
|
|
|
|
draw_y += draw_h;
|
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2016-01-06 21:50:19 +01:00
|
|
|
|
else
|
2015-07-31 01:11:23 +02:00
|
|
|
|
{
|
2016-01-06 21:50:19 +01:00
|
|
|
|
DrawBar(draw_x,draw_y,6,draw_h+1,0xFFFFFF);
|
|
|
|
|
DrawBar(draw_x+6+18,draw_y,160-6-18,draw_h+1,0xFFFFFF);
|
|
|
|
|
DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF);
|
2015-08-09 21:08:57 +02:00
|
|
|
|
if (show_dev_name)
|
|
|
|
|
{
|
|
|
|
|
strcat(#disc_name, #dev_name);
|
2016-01-06 21:50:19 +01:00
|
|
|
|
if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
|
|
|
|
|
WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);
|
2015-08-09 21:08:57 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-01-06 21:50:19 +01:00
|
|
|
|
if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name);
|
|
|
|
|
WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name);
|
2015-08-09 21:08:57 +02:00
|
|
|
|
}
|
2016-01-06 21:50:19 +01:00
|
|
|
|
_PutImage(draw_x+6,draw_y, 18,17, is_active*6+dev_icon*17*18*3+#devices);
|
|
|
|
|
draw_y += draw_h;
|
2015-07-31 01:11:23 +02:00
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2015-08-10 00:26:14 +02:00
|
|
|
|
if (two_panels)
|
|
|
|
|
{
|
2016-01-06 21:50:19 +01:00
|
|
|
|
DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF);
|
|
|
|
|
DefineButton(Form.cwidth - 23, draw_y+2, 17,16, 60+BT_HIDE, 0xCCCccc);
|
|
|
|
|
_PutImage(Form.cwidth - 21, draw_y+4, 14,13, 2*14*13*3+#factions);
|
|
|
|
|
files.y = draw_y + draw_h + 17;
|
2015-08-10 00:26:14 +02:00
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 21:50:19 +01:00
|
|
|
|
void _SystemDiscs::Click(int n)
|
|
|
|
|
{
|
|
|
|
|
strcpy(#path, list.get(n));
|
|
|
|
|
files.KeyHome();
|
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DrawDeviceAndActionsLeftPanel()
|
|
|
|
|
{
|
|
|
|
|
Tip(56, T_DEVICES, 55, "=");
|
|
|
|
|
SystemDiscs.Draw();
|
|
|
|
|
ActionsDraw();
|
|
|
|
|
DrawLeftPanelBg();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Tip(int y, dword caption, id, arrow)
|
|
|
|
|
{
|
|
|
|
|
DrawBar(17,y,160,1,0xEFEDEE);
|
|
|
|
|
DrawFilledBar(17, y+1, 160, 16);
|
2016-02-11 02:07:04 +01:00
|
|
|
|
WriteText(25,y+5,0x80,0x000000,caption);
|
2016-01-06 21:50:19 +01:00
|
|
|
|
if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
|
2016-02-11 02:07:04 +01:00
|
|
|
|
WriteText(165,y+5,0x80,0x000000,arrow); //arrow
|
|
|
|
|
DrawBar(17,y+17,160,1,col_graph);
|
2016-01-06 21:50:19 +01:00
|
|
|
|
}
|
2015-08-09 21:08:57 +02:00
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
|
void ActionsDraw()
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2016-01-06 21:50:19 +01:00
|
|
|
|
int actions_y= SystemDiscs.list.count*16+108, lineh=16;
|
2013-08-04 01:35:59 +02:00
|
|
|
|
Tip(actions_y-18, T_ACTIONS, 77, ""); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-03-31 22:25:54 +02:00
|
|
|
|
for (i=0; actions[i*3]!=0; i++, actions_y+=lineh)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02: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-29 22:59:44 +01:00
|
|
|
|
_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-21 13:24:30 +01:00
|
|
|
|
void DrawLeftPanelBg()
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2016-01-06 21:50:19 +01:00
|
|
|
|
int actions_y = SystemDiscs.list.count*16;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
int start_y = actions_y+156;
|
2015-08-18 17:02:42 +02:00
|
|
|
|
int onTop1;
|
2013-03-11 19:16:24 +01: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 20:33:48 +02:00
|
|
|
|
PutShadow(17,actions_y+75,160,1,1,3);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
PutShadow(18,actions_y+75+1,158,1,1,1);
|
2013-03-11 19:16:24 +01: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>
|
2016-08-28 01:44:17 +02:00
|
|
|
|
onTop1 = Form.cheight-start_y-2;
|
2015-08-18 17:02:42 +02:00
|
|
|
|
if (onTop1 < 268)
|
|
|
|
|
{
|
2016-08-28 01:44:17 +02:00
|
|
|
|
if (show_status_bar) onTop1 = Form.cheight-start_y-2-16;
|
2015-08-18 17:02:42 +02:00
|
|
|
|
PutPaletteImage(#blue_hl, 190, onTop1, 2, start_y, 8, #blue_hl_pal);
|
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
2015-08-18 17:02:42 +02:00
|
|
|
|
DrawBar(2,start_y,190, onTop1-268, col_lpanel);
|
2016-08-28 01:44:17 +02:00
|
|
|
|
if (show_status_bar) onTop1 = Form.cheight-start_y-2-16;
|
2015-08-18 17:02:42 +02:00
|
|
|
|
PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270, 8, #blue_hl_pal);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2013-08-31 20:33:48 +02:00
|
|
|
|
PutShadow(17,start_y,160,1,1,3);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
PutShadow(18,start_y+1,158,1,1,1);
|
2015-08-09 21:08:57 +02:00
|
|
|
|
}
|