Subversion Repositories Kolibri OS

Rev

Rev 8779 | Rev 8833 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3399 leency 1
 
3848 punk_joker 2
	?define T_DEVICES "Устройства"
4225 punk_joker 3
	?define T_ACTIONS "Действия"
4
	char *actions[] = {
5
		57, "Новый файл", "F9",
8826 leency 6
		56, "Новая папка", "F7",
7
		60, "Настройки", "F10",
4225 punk_joker 8
		0,0,0
9
	};
10
	?define T_PROG "Программы "
5576 pavelyakov 11
	?define T_SYS  "Система "
12
	?define T_UNC  "Неизвестно "
13
	?define T_CD   "CD-ROM "
14
	?define T_FD   "Дискета "
15
	?define T_HD   "Жесткий диск "
16
	?define T_SATA "SATA диск "
17
	?define T_USB  "USB диск "
18
	?define T_RAM  "RAM диск "
19
#else
3848 punk_joker 20
	?define T_DEVICES "Devices"
4225 punk_joker 21
	?define T_ACTIONS "Actions"
22
	char *actions[] = {
23
		57, "New file", "F9",
8826 leency 24
		56, "New folder", "F7",
25
		60, "Settings", "F10",
5428 leency 26
		0,0,0
4225 punk_joker 27
	};
28
	?define T_PROG "Programs "
5576 pavelyakov 29
	?define T_SYS  "System "
30
	?define T_UNC  "Unknown "
31
	?define T_CD   "CD-ROM "
32
	?define T_FD   "Floppy disk "
33
	?define T_HD   "Hard disk "
34
	?define T_SATA "SATA disk "
7210 leency 35
	?define T_USB  "USB disk "
36
	?define T_RAM  "RAM disk "
37
#endif
3848 punk_joker 38
39
 
6034 leency 40
{
41
	collection list;
42
	int dev_num;
7422 leency 43
	void Get();
44
	void Draw();
6034 leency 45
	void Click();
46
} SystemDiscs=0;
7972 leency 47
3848 punk_joker 48
 
7989 leency 49
#define DEV_H_HOR 21
50
6034 leency 51
 
52
{
3363 leency 53
	switch(disk_first_letter)
6034 leency 54
	{
55
		case 'r':
56
			ESBYTE[dev_icon]=0;
57
			strcpy(disc_name, T_SYS);
58
			break;
59
		case 'k':
7989 leency 60
			ESBYTE[dev_icon]=1;
6034 leency 61
			strcpy(disc_name, T_PROG);
7989 leency 62
			break;
6034 leency 63
		case 'f':
64
			ESBYTE[dev_icon]=2;
65
			strcpy(disc_name, T_FD);
66
			break;
67
		case 'c':
7989 leency 68
			ESBYTE[dev_icon]=3;
69
			strcpy(disc_name, T_CD);
70
			break;
71
		case 'h':
6034 leency 72
		case 'b':
73
			ESBYTE[dev_icon]=4;
7989 leency 74
			strcpy(disc_name, T_HD);
6034 leency 75
			break;
76
		case 's':
77
			ESBYTE[dev_icon]=4;
7989 leency 78
			strcpy(disc_name, T_SATA);
6034 leency 79
			break;
80
		case 't':
7989 leency 81
			ESBYTE[dev_icon]=5;
82
			strcpy(disc_name, T_RAM);
83
			break;
84
		case 'u':
6034 leency 85
			ESBYTE[dev_icon]=6;
7989 leency 86
			strcpy(disc_name, T_USB);
6034 leency 87
			break;
88
		default:
89
			ESBYTE[dev_icon]=5;
7989 leency 90
	}
6034 leency 91
}
3363 leency 92
7422 leency 93
 
94
{
3363 leency 95
	bool kolibrios_exists=false;
7428 leency 96
	char dev_name[10], sys_discs[10];
5150 leency 97
	int i1, j1, dev_num_i, dev_disc_num;
7422 leency 98
	dword devbuf;
5960 leency 99
5734 leency 100
 
6034 leency 101
	devbuf = malloc(10000);
5960 leency 102
	ReadDir(19, devbuf, "/");
3363 leency 103
	dev_num = dev_num_i = EBX;
7422 leency 104
	for (i1=0; i1
105
	{
7310 pavelyakov 106
		sprintf(#dev_name,"/%s",i1*304+ devbuf+72);
6635 leency 107
		Open_Dir(#dev_name, ONLY_OPEN);
3363 leency 108
		dev_disc_num = files.count;
3434 leency 109
		for (j1=0; j1
3363 leency 110
		{
111
			sprintf(#sys_discs,"%s/%s",#dev_name,j1*304+ buf+72);
6635 leency 112
			if (sys_discs[1]=='c') || (dir_exists(#sys_discs)) list.add(#sys_discs);
7992 leency 113
		}
3363 leency 114
		if (!strcmp(#sys_discs, "/rd/1"))
6635 leency 115
		{
3956 leency 116
			if (dir_exists("/kolibrios")) && (!kolibrios_exists) {
7428 leency 117
				kolibrios_exists=true;
118
				list.add("/kolibrios");
7422 leency 119
				dev_num++;
120
			}
121
		}
4225 punk_joker 122
	}
3363 leency 123
	free(devbuf);
5960 leency 124
}
3363 leency 125
126
 
6034 leency 127
{
3363 leency 128
	char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len;
5753 leency 129
	int draw_y, draw_x;
7989 leency 130
3363 leency 131
 
5960 leency 132
6034 leency 133
 
8779 leency 134
	                   else { draw_y = 74; draw_x = 17; }
135
6034 leency 136
 
137
	{
3363 leency 138
		strcpy(#dev_name, list.get(i));
6034 leency 139
		GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
140
		if (strstr(#path, #dev_name)-#path==0) is_active=true; else is_active=false;
6637 leency 141
		if (two_panels.checked)
7244 leency 142
		{
3363 leency 143
			name_len = strlen(#dev_name)-1*8;
6034 leency 144
			DrawBar(draw_x, draw_y, name_len + 31, DEV_H_HOR, 0xFFFFFF);
7989 leency 145
			DefineButton(draw_x+2, draw_y, name_len + 27, DEV_H_HOR-1, 100+i+BT_HIDE,0xFFFFFF);
146
			_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*7+dev_icon*17*18*3+#devices);
147
			WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1);
6034 leency 148
			draw_x += name_len + 31;
149
			if (draw_x>=Form.cwidth-100) && (Form.cwidth) {
7611 leency 150
				DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, 0xFFFFFF);
7989 leency 151
				draw_x = 2;
6034 leency 152
				draw_y += DEV_H_HOR;
7989 leency 153
			}
6034 leency 154
		}
3363 leency 155
		else
6034 leency 156
		{
5633 leency 157
			DrawBar(draw_x,draw_y,6,DEV_H+1,0xFFFFFF);
7989 leency 158
			DrawBar(draw_x+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF);
159
			DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF);
6034 leency 160
			if (show_dev_name.checked)
7244 leency 161
			{
5698 leency 162
				strcat(#disc_name, #dev_name);
163
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
6034 leency 164
				WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);
7806 leency 165
			} else {
166
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name);
6034 leency 167
				WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name);
168
			}
5698 leency 169
			_PutImage(draw_x+6,draw_y, 18,17, is_active*7+dev_icon*17*18*3+#devices);
7989 leency 170
			draw_y += DEV_H;
171
		}
5633 leency 172
	}
3363 leency 173
	if (two_panels.checked)
7244 leency 174
	{
5703 leency 175
		DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, 0xFFFFFF);
7989 leency 176
		files.y = draw_y + DEV_H_HOR + 17;
177
	} else {
178
		DrawBar(draw_x+6, draw_y, 18, 1, 0xFFFfff);
179
	}
5703 leency 180
}
3363 leency 181
182
 
6034 leency 183
{
184
	strcpy(#path, list.get(n));
185
	files.KeyHome();
186
	Open_Dir(#path,WITH_REDRAW);
187
}
188
5698 leency 189
 
6034 leency 190
 
191
 
192
{
193
	Tip(56, T_DEVICES, 55, "=");
194
	SystemDiscs.Draw();
195
	ActionsDraw();
196
	DrawLeftPanelBg();
197
}
198
199
 
7462 leency 200
	0xDFDCDD,0xE1DDDE,0xE2DEE0,0xE4DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1};
201
void DrawFilledBarInner(dword x, y, w, h)
202
{
203
	int i, fill_h;
204
	if (h <= 14) fill_h = h; else fill_h = 14;
205
	for (i=0; i
206
	DrawBar(x, y+i, w, h-fill_h, col_palette_inner[14-i]);
207
}
208
209
 
6034 leency 210
{
211
	if (col.def) {
7647 leency 212
		DrawBar(17,y,160,1,0xEFEDEE);
213
		DrawFilledBarInner(17, y+1, 160, 16);
214
		DrawBar(17,y+17,160,1,0x7E87A3);
215
	} else {
216
		DrawBar(17,y,160,1,sc.work_graph);
7806 leency 217
		DrawBar(17,y+1,160,16,col.list_bg);
7647 leency 218
		DrawBar(17,y+17,160,1,sc.work_graph);
7806 leency 219
	}
7647 leency 220
	WriteText(25,y+5,0x80,col.list_gb_text,caption);
221
	if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
6034 leency 222
	WriteText(165,y+5,0x80,col.list_gb_text,arrow); //arrow
7647 leency 223
}
6034 leency 224
225
 
3434 leency 226
{
3363 leency 227
	int i;
7422 leency 228
	int actions_y= SystemDiscs.list.count*DEV_H+108;
7989 leency 229
	Tip(actions_y-18, T_ACTIONS, 77, "");
8240 leency 230
	for (i=0; actions[i*3]!=0; i++, actions_y+=DEV_H)
7989 leency 231
	{
3363 leency 232
		DrawBar(17,actions_y,160,DEV_H,0xFFFFFF); //схыюх
7989 leency 233
		DefineButton(17,actions_y,159,DEV_H,actions[i*3]+BT_HIDE,0xE4DFE1);
234
		WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
3434 leency 235
		WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
236
		_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
5149 leency 237
	}
3363 leency 238
}
239
240
 
5441 leency 241
{
3363 leency 242
	int actions_y = SystemDiscs.list.count*DEV_H;
7989 leency 243
	int start_y = actions_y+159;
244
	int area_h;
6987 leency 245
	int i;
8240 leency 246
	DrawBar(2,41,190,15,waves_pal[0]);		      //above devices block
247
	DrawBar(17,actions_y+75,160,15,waves_pal[0]); //below devices block
248
	PutShadow(17,actions_y+75,160,1,1,3);
3877 leency 249
	PutShadow(18,actions_y+75+1,158,1,1,1);
3434 leency 250
	DrawBar(2,56,15,actions_y+103,waves_pal[0]);	          //on the left
8240 leency 251
	DrawBar(177,56,15,actions_y+103,waves_pal[0]);            //on the right
252
	area_h = Form.cheight-start_y-2 - status_bar_h;
6987 leency 253
	if (area_h < 268){
8240 leency 254
		PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #waves_pal);
255
	} else {
256
		DrawBar(2,start_y,190, area_h-268, waves_pal[0]);
257
		PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #waves_pal);
258
	}
5743 leency 259
	PutShadow(17,start_y,160,1,1,3);
3877 leency 260
	PutShadow(18,start_y+1,158,1,1,1);
3434 leency 261
}
5698 leency 262
>