Subversion Repositories Kolibri OS

Rev

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