Subversion Repositories Kolibri OS

Rev

Rev 7311 | Rev 7428 | 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, "Ќ®ўл© д ©«", "F7",
6
		56, "Ќ®ў п Ї ЇЄ ", "F6",
7
		60, "Ќ бва®©ЄЁ", "F10",
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", "F7",
24
		56, "New folder", "F6",
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;
47
3848 punk_joker 48
 
6034 leency 49
 
50
{
3363 leency 51
	switch(disk_first_letter)
6034 leency 52
	{
53
		case 'k':
54
			ESBYTE[dev_icon]=0;
55
			strcpy(disc_name, T_PROG);
56
			break;
57
		case 'r':
58
			ESBYTE[dev_icon]=0;
59
			strcpy(disc_name, T_SYS);
60
			break;
61
		case 'c':
62
			ESBYTE[dev_icon]=1;
63
			strcpy(disc_name, T_CD);
64
			break;
65
		case 'f':
66
			ESBYTE[dev_icon]=2;
67
			strcpy(disc_name, T_FD);
68
			break;
69
		case 'h':
70
		case 'b':
71
			ESBYTE[dev_icon]=3;
72
			strcpy(disc_name, T_HD);
73
			break;
74
		case 's':
75
			ESBYTE[dev_icon]=3;
76
			strcpy(disc_name, T_SATA);
77
			break;
78
		case 'u':
79
			ESBYTE[dev_icon]=5;
80
			strcpy(disc_name, T_USB);
81
			break;
82
		case 't':
83
			ESBYTE[dev_icon]=4;
84
			strcpy(disc_name, T_RAM);
85
			break;
86
		default:
87
			ESBYTE[dev_icon]=3;
88
			strcpy(disc_name, T_UNC);
89
	}
90
}
3363 leency 91
7422 leency 92
 
93
{
3363 leency 94
	byte ret = 0;
7310 pavelyakov 95
	char dev_name[10], sys_discs[10];
5150 leency 96
	int i1, j1, dev_num_i, dev_disc_num;
7422 leency 97
	dword devbuf;
5960 leency 98
5734 leency 99
 
6034 leency 100
	devbuf = malloc(10000);
5960 leency 101
	ReadDir(19, devbuf, "/");
3363 leency 102
	dev_num = dev_num_i = EBX;
7422 leency 103
	for (i1=0; i1
104
	{
7310 pavelyakov 105
		sprintf(#dev_name,"/%s",i1*304+ devbuf+72);
6635 leency 106
		Open_Dir(#dev_name, ONLY_OPEN);
3363 leency 107
		dev_disc_num = files.count;
3434 leency 108
		for (j1=0; j1
3363 leency 109
		{
110
			sprintf(#sys_discs,"%s/%s",#dev_name,j1*304+ buf+72);
6635 leency 111
			list.add(#sys_discs);
6034 leency 112
		}
3363 leency 113
		if (!strcmp(#sys_discs, "/rd/1"))
6635 leency 114
		{
3956 leency 115
			if (dir_exists("/kolibrios")) {
7422 leency 116
				list.add("/kolibrios");
117
				dev_num++;
118
			}
119
		}
4225 punk_joker 120
	}
3363 leency 121
	free(devbuf);
5960 leency 122
}
3363 leency 123
124
 
6034 leency 125
{
3363 leency 126
	char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len;
5753 leency 127
	int draw_y, draw_x, draw_h;
6034 leency 128
3363 leency 129
 
5960 leency 130
6034 leency 131
 
7244 leency 132
	if (!two_panels.checked) { draw_y = 74; draw_x = 17; draw_h = 16; }
133
6034 leency 134
 
135
	{
3363 leency 136
		strcpy(#dev_name, list.get(i));
6034 leency 137
		GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
138
		if (strstr(#path, #dev_name)-#path==0) is_active=true; else is_active=false;
6637 leency 139
		if (two_panels.checked)
7244 leency 140
		{
3363 leency 141
			name_len = strlen(#dev_name)-1*8;
6034 leency 142
			DrawBar(draw_x, draw_y, name_len + 31, draw_h, 0xFFFFFF);
143
			DefineButton(draw_x+2, draw_y, name_len + 27, draw_h-1, 100+i+BT_HIDE,0xFFFFFF);
144
			_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*6+dev_icon*17*18*3+#devices);
145
			WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1);
146
			draw_x += name_len + 31;
147
			if (draw_x>=Form.width-35) && (Form.width) {
148
				DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF);
149
				draw_x = 2;
150
				draw_y += draw_h;
151
			}
152
		}
3363 leency 153
		else
6034 leency 154
		{
5633 leency 155
			DrawBar(draw_x,draw_y,6,draw_h+1,0xFFFFFF);
6034 leency 156
			DrawBar(draw_x+6+18,draw_y,160-6-18,draw_h+1,0xFFFFFF);
157
			DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF);
158
			if (show_dev_name.checked)
7244 leency 159
			{
5698 leency 160
				strcat(#disc_name, #dev_name);
161
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
6034 leency 162
				WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);			}
7244 leency 163
			else
5698 leency 164
			{
165
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name);
6034 leency 166
				WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name);
167
			}
5698 leency 168
			_PutImage(draw_x+6,draw_y, 18,17, is_active*6+dev_icon*17*18*3+#devices);
6034 leency 169
			draw_y += draw_h;
170
		}
5633 leency 171
	}
3363 leency 172
	if (two_panels.checked)
7244 leency 173
	{
5703 leency 174
		DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF);
6034 leency 175
		DefineButton(Form.cwidth - 23, draw_y+2, 17,16, 60+BT_HIDE, 0xCCCccc);
176
		_PutImage(Form.cwidth - 21, draw_y+4, 14,13, 2*14*13*3+#factions);
177
		files.y = draw_y + draw_h + 17;
178
	}
5703 leency 179
}
3363 leency 180
181
 
6034 leency 182
{
183
	strcpy(#path, list.get(n));
184
	files.KeyHome();
185
	Open_Dir(#path,WITH_REDRAW);
186
}
187
5698 leency 188
 
6034 leency 189
 
190
 
191
{
192
	Tip(56, T_DEVICES, 55, "=");
193
	SystemDiscs.Draw();
194
	ActionsDraw();
195
	DrawLeftPanelBg();
196
}
197
198
 
199
{
200
	DrawBar(17,y,160,1,0xEFEDEE);
201
	DrawFilledBar(17, y+1, 160, 16);
202
	WriteText(25,y+5,0x80,0x000000,caption);
6191 leency 203
	if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
6034 leency 204
	WriteText(165,y+5,0x80,0x000000,arrow); //arrow
6191 leency 205
	DrawBar(17,y+17,160,1,col_graph);
206
}
6034 leency 207
208
 
3434 leency 209
{
3363 leency 210
	int i;
7422 leency 211
	int actions_y= SystemDiscs.list.count*16+108, lineh=16;
6034 leency 212
	Tip(actions_y-18, T_ACTIONS, 77, ""); //заголовок
3848 punk_joker 213
	for (i=0; actions[i*3]!=0; i++, actions_y+=lineh)
3434 leency 214
	{
3363 leency 215
		DrawBar(17,actions_y,160,lineh,0xFFFFFF); //белое
3434 leency 216
		DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1);
217
		WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
218
		WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
219
		_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
5149 leency 220
	}
3363 leency 221
}
222
223
 
5441 leency 224
{
3363 leency 225
	int actions_y = SystemDiscs.list.count*16;
6034 leency 226
	int start_y = actions_y+156;
3434 leency 227
	int area_h;
6987 leency 228
	DrawBar(2,41,190,15,col_lpanel);		      //синий прямоугольник - над девайсами
3363 leency 229
	DrawBar(17,actions_y+75,160,15,col_lpanel); //синий прямоугольник - под девайсами
230
	PutShadow(17,actions_y+75,160,1,1,3);
3877 leency 231
	PutShadow(18,actions_y+75+1,158,1,1,1);
3434 leency 232
	DrawBar(2,56,15,actions_y+103,col_lpanel);	          //синий прямоугольник - слева
3363 leency 233
	DrawBar(177,56,15,actions_y+103,col_lpanel);            //синий прямоугольник - справа
234
	area_h = Form.cheight-start_y-2 - status_bar_h;
6987 leency 235
	if (area_h < 268)
236
	{
5743 leency 237
		PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #blue_hl_pal);
6987 leency 238
	}
5743 leency 239
	else
3363 leency 240
	{
241
		DrawBar(2,start_y,190, area_h-268, col_lpanel);
6987 leency 242
		PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #blue_hl_pal);
243
	}
3363 leency 244
	PutShadow(17,start_y,160,1,1,3);
3877 leency 245
	PutShadow(18,start_y+1,158,1,1,1);
3434 leency 246
}
5698 leency 247
>