Subversion Repositories Kolibri OS

Rev

Rev 7462 | Rev 7634 | 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
	bool kolibrios_exists=false;
7428 leency 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")) && (!kolibrios_exists) {
7428 leency 116
				kolibrios_exists=true;
117
				list.add("/kolibrios");
7422 leency 118
				dev_num++;
119
			}
120
		}
4225 punk_joker 121
	}
3363 leency 122
	free(devbuf);
5960 leency 123
}
3363 leency 124
125
 
6034 leency 126
{
3363 leency 127
	char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len;
5753 leency 128
	int draw_y, draw_x, draw_h;
6034 leency 129
3363 leency 130
 
5960 leency 131
6034 leency 132
 
7244 leency 133
	if (!two_panels.checked) { draw_y = 74; draw_x = 17; draw_h = 16; }
134
6034 leency 135
 
136
	{
3363 leency 137
		strcpy(#dev_name, list.get(i));
6034 leency 138
		GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
139
		if (strstr(#path, #dev_name)-#path==0) is_active=true; else is_active=false;
6637 leency 140
		if (two_panels.checked)
7244 leency 141
		{
3363 leency 142
			name_len = strlen(#dev_name)-1*8;
6034 leency 143
			DrawBar(draw_x, draw_y, name_len + 31, draw_h, 0xFFFFFF);
144
			DefineButton(draw_x+2, draw_y, name_len + 27, draw_h-1, 100+i+BT_HIDE,0xFFFFFF);
145
			_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*6+dev_icon*17*18*3+#devices);
146
			WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1);
147
			draw_x += name_len + 31;
148
			if (draw_x>=Form.cwidth-100) && (Form.cwidth) {
7611 leency 149
				DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF);
6034 leency 150
				draw_x = 2;
151
				draw_y += draw_h;
152
			}
153
		}
3363 leency 154
		else
6034 leency 155
		{
5633 leency 156
			DrawBar(draw_x,draw_y,6,draw_h+1,0xFFFFFF);
6034 leency 157
			DrawBar(draw_x+6+18,draw_y,160-6-18,draw_h+1,0xFFFFFF);
158
			DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF);
159
			if (show_dev_name.checked)
7244 leency 160
			{
5698 leency 161
				strcat(#disc_name, #dev_name);
162
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
6034 leency 163
				WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);			}
7244 leency 164
			else
5698 leency 165
			{
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*6+dev_icon*17*18*3+#devices);
6034 leency 170
			draw_y += draw_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, draw_h, 0xFFFFFF);
6034 leency 176
		DefineButton(Form.cwidth - 23, draw_y+2, 17,16, 60+BT_HIDE, 0xCCCccc);
177
		_PutImage(Form.cwidth - 21, draw_y+4, 14,13, 2*14*13*3+#factions);
178
		files.y = draw_y + draw_h + 17;
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
	DrawBar(17,y,160,1,0xEFEDEE);
212
	DrawFilledBarInner(17, y+1, 160, 16);
7462 leency 213
	WriteText(25,y+5,0x80,0x000000,caption);
6191 leency 214
	if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
6034 leency 215
	WriteText(165,y+5,0x80,0x000000,arrow); //arrow
6191 leency 216
	DrawBar(17,y+17,160,1,0x7E87A3);
7462 leency 217
}
6034 leency 218
219
 
3434 leency 220
{
3363 leency 221
	int i;
7422 leency 222
	int actions_y= SystemDiscs.list.count*16+108, lineh=16;
6034 leency 223
	Tip(actions_y-18, T_ACTIONS, 77, ""); //
3848 punk_joker 224
	for (i=0; actions[i*3]!=0; i++, actions_y+=lineh)
3434 leency 225
	{
3363 leency 226
		DrawBar(17,actions_y,160,lineh,0xFFFFFF); //
3434 leency 227
		DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1);
228
		WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
229
		WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
230
		_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
5149 leency 231
	}
3363 leency 232
}
233
234
 
5441 leency 235
{
3363 leency 236
	int actions_y = SystemDiscs.list.count*16;
6034 leency 237
	int start_y = actions_y+156;
3434 leency 238
	int area_h;
6987 leency 239
	DrawBar(2,41,190,15,col_lpanel);		      //  -  
3363 leency 240
	DrawBar(17,actions_y+75,160,15,col_lpanel); //  -  
241
	PutShadow(17,actions_y+75,160,1,1,3);
3877 leency 242
	PutShadow(18,actions_y+75+1,158,1,1,1);
3434 leency 243
	DrawBar(2,56,15,actions_y+103,col_lpanel);	          //  - 
3363 leency 244
	DrawBar(177,56,15,actions_y+103,col_lpanel);            //  - 
245
	area_h = Form.cheight-start_y-2 - status_bar_h;
6987 leency 246
	if (area_h < 268)
247
	{
5743 leency 248
		PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #blue_hl_pal);
6987 leency 249
	}
5743 leency 250
	else
3363 leency 251
	{
252
		DrawBar(2,start_y,190, area_h-268, col_lpanel);
6987 leency 253
		PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #blue_hl_pal);
254
	}
3363 leency 255
	PutShadow(17,start_y,160,1,1,3);
3877 leency 256
	PutShadow(18,start_y+1,158,1,1,1);
3434 leency 257
}
5698 leency 258
>