Subversion Repositories Kolibri OS

Rev

Rev 3877 | Rev 4057 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3877 Rev 3933
1
//Leency 2008-2013
1
//Leency 2008-2013
2
 
2
 
3
#ifdef LANG_RUS
3
#ifdef LANG_RUS
4
char *actions[] = {
4
char *actions[] = {
5
	57, "®¢ë© ä ©«", "F7",
5
	57, "®¢ë© ä ©«", "F7",
6
	56, "®¢ ï ¯ ¯ª ", "F6",
6
	56, "®¢ ï ¯ ¯ª ", "F6",
7
	60, " áâனª¨", "F10",
7
	60, " áâனª¨", "F10",
8
	0,0,0
8
	0,0,0
9
};
9
};
10
?define T_DEVICES "“áâனá⢠"
10
?define T_DEVICES "“áâனá⢠"
11
?define T_ACTIONS "„¥©á⢨ï"
11
?define T_ACTIONS "„¥©á⢨ï"
-
 
12
 
-
 
13
#elif LANG_EST
-
 
14
char *actions[] = {
-
 
15
	57, "Uus fail", "F7",
-
 
16
	56, "Uus kataloog", "F6",
-
 
17
	60, "Seaded", "F10",
-
 
18
	0,0,0
-
 
19
};
-
 
20
 
-
 
21
?define T_DEVICES "Seadmed"
-
 
22
?define T_ACTIONS "Toimingud"
12
 
23
 
13
#else
24
#else
14
char *actions[] = {
25
char *actions[] = {
15
	57, "New file", "F7",
26
	57, "New file", "F7",
16
	56, "New folder", "F6",
27
	56, "New folder", "F6",
17
	60, "Options", "F10",
28
	60, "Options", "F10",
18
	0,0,0
29
	0,0,0
19
};
30
};
20
 
31
 
21
?define T_DEVICES "Devices"
32
?define T_DEVICES "Devices"
22
?define T_ACTIONS "Actions"
33
?define T_ACTIONS "Actions"
23
#endif
34
#endif
24
 
35
 
25
 
36
 
26
void Tip(int y, dword caption, id, arrow)
37
void Tip(int y, dword caption, id, arrow)
27
{
38
{
28
	int i;
39
	int i;
29
	DrawBar(17,y,160,1,0xEFEDEE);
40
	DrawBar(17,y,160,1,0xEFEDEE);
30
	DrawFilledBar(17, y+1, 160, 16);
41
	DrawFilledBar(17, y+1, 160, 16);
31
	WriteText(25,y+5,0x80,0,caption);
42
	WriteText(25,y+5,0x80,0,caption);
32
	IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //êíîïà äëÿ ñòðåëêè
43
	IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //êíîïà äëÿ ñòðåëêè
33
	WriteText(165,y+5,0x80,0,arrow); //ñòðåëêà âíèç
44
	WriteText(165,y+5,0x80,0,arrow); //ñòðåëêà âíèç
34
	DrawBar(17,y+17,160,1,col_border);		//ïîä÷¸ðêèâàíèå
45
	DrawBar(17,y+17,160,1,col_border);		//ïîä÷¸ðêèâàíèå
35
}
46
}
36
 
47
 
37
 
48
 
38
path_string disk_list[30];
49
path_string disk_list[30];
39
int disc_num;
50
int disc_num;
40
dword devbuf;
51
dword devbuf;
41
 
52
 
42
void SystemDiscsGet()
53
void SystemDiscsGet()
43
{
54
{
44
	unsigned char dev_name[10], sys_discs[10];
55
	unsigned char dev_name[10], sys_discs[10];
45
	unsigned int i1, j1, dev_num, dev_disc_num;
56
	unsigned int i1, j1, dev_num, dev_disc_num;
46
	
57
	
47
	disc_num=0;
58
	disc_num=0;
48
	if (devbuf) free(devbuf);
59
	if (devbuf) free(devbuf);
49
	devbuf = malloc(10000); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè
60
	devbuf = malloc(10000); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè
50
	ReadDir(19, devbuf, "/");
61
	ReadDir(19, devbuf, "/");
51
	dev_num = EBX;
62
	dev_num = EBX;
52
	for (i1=0; i1
63
	for (i1=0; i1
53
	{
64
	{
54
		strcpy(#dev_name, "/");                                 // /
65
		strcpy(#dev_name, "/");                                 // /
55
		strcat(#dev_name, i1*304+ devbuf+72); // /rd
66
		strcat(#dev_name, i1*304+ devbuf+72); // /rd
56
		strcat(#dev_name, "/");               // /rd/
67
		strcat(#dev_name, "/");               // /rd/
57
		Open_Dir(#dev_name, ONLY_OPEN);
68
		Open_Dir(#dev_name, ONLY_OPEN);
58
		dev_disc_num = files.count;
69
		dev_disc_num = files.count;
59
		//if (files.count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else
70
		//if (files.count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else
60
		for (j1=0; j1
71
		for (j1=0; j1
61
		{
72
		{
62
			strcpy(#sys_discs, #dev_name);                              // /rd/
73
			strcpy(#sys_discs, #dev_name);                              // /rd/
63
			strcat(#sys_discs, j1*304+ buf+72);      // /rd/1
74
			strcat(#sys_discs, j1*304+ buf+72);      // /rd/1
64
			strcat(#sys_discs, "/");                 // /rd/1/
75
			strcat(#sys_discs, "/");                 // /rd/1/
65
			strcpy(#disk_list[disc_num].Item, #sys_discs);
76
			strcpy(#disk_list[disc_num].Item, #sys_discs);
66
			disc_num++;
77
			disc_num++;
67
		}
78
		}
68
	}
79
	}
69
}
80
}
70
 
81
 
71
 
82
 
72
void SystemDiscsDraw()
83
void SystemDiscsDraw()
73
{    
84
{    
74
	char dev_name[10], disc_name[100];
85
	char dev_name[10], disc_name[100];
75
	int i, dev_icon;
86
	int i, dev_icon;
76
	
87
	
77
	Tip(56, T_DEVICES, 55, "=");
88
	Tip(56, T_DEVICES, 55, "=");
78
	for (i=0; i<20; i++) DeleteButton(100+i);
89
	for (i=0; i<20; i++) DeleteButton(100+i);
79
	for (i=0;i
90
	for (i=0;i
80
	{
91
	{
81
		DrawBar(17,i*16+74,160,17,0xFFFFFF);
92
		DrawBar(17,i*16+74,160,17,0xFFFFFF);
82
		DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xFFFFFF);
93
		DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xFFFFFF);
83
		strcpy(#dev_name, #disk_list[i].Item);
94
		strcpy(#dev_name, #disk_list[i].Item);
84
		dev_name[strlen(#dev_name)-1]=NULL;
95
		dev_name[strlen(#dev_name)-1]=NULL;
85
		switch(dev_name[1])
96
		switch(dev_name[1])
86
		{
97
		{
87
			case 'r':
98
			case 'r':
88
				dev_icon=0;
99
				dev_icon=0;
89
				strcpy(#disc_name, "SYS disk ");
100
				strcpy(#disc_name, "SYS disk ");
90
				break;
101
				break;
91
			case 'c':
102
			case 'c':
92
				dev_icon=1;
103
				dev_icon=1;
93
				strcpy(#disc_name, "CD-ROM ");
104
				strcpy(#disc_name, "CD-ROM ");
94
				break;
105
				break;
95
			case 'f':
106
			case 'f':
96
				dev_icon=2;
107
				dev_icon=2;
97
				strcpy(#disc_name, "Floppy disk ");
108
				strcpy(#disc_name, "Floppy disk ");
98
				break;
109
				break;
99
			case 'h':
110
			case 'h':
100
			case 'b':
111
			case 'b':
101
				dev_icon=3;
112
				dev_icon=3;
102
				strcpy(#disc_name, "Hard disk ");
113
				strcpy(#disc_name, "Hard disk ");
103
				break;
114
				break;
104
			case 's':
115
			case 's':
105
				dev_icon=3;
116
				dev_icon=3;
106
				strcpy(#disc_name, "SATA disk ");
117
				strcpy(#disc_name, "SATA disk ");
107
				break;
118
				break;
108
			case 'u':
119
			case 'u':
109
				dev_icon=5;
120
				dev_icon=5;
110
				strcpy(#disc_name, "USB flash ");
121
				strcpy(#disc_name, "USB flash ");
111
				break;
122
				break;
112
			case 't':
123
			case 't':
113
				dev_icon=4;
124
				dev_icon=4;
114
				strcpy(#disc_name, "RAM disk ");				
125
				strcpy(#disc_name, "RAM disk ");				
115
				DefineButton(17+143,i*16+74,16,16,i+130+BT_HIDE+BT_NOFRAME,0xFFFFFF);
126
				DefineButton(17+143,i*16+74,16,16,i+130+BT_HIDE+BT_NOFRAME,0xFFFFFF);
116
				WriteText(45+121,i*16+79,0x80,0xD63535,"-");
127
				WriteText(45+121,i*16+79,0x80,0xD63535,"-");
117
				WriteText(45+121,i*16+79+1,0x80,0xBC2424,"-");
128
				WriteText(45+121,i*16+79+1,0x80,0xBC2424,"-");
118
				break;
129
				break;
119
			default:
130
			default:
120
				dev_icon=3; //ïî-óìîë÷àíèþ óñòðîéñòâî âûãëÿäèò êàê æåñòÿê íî ýòî íåïðàâèëüíî
131
				dev_icon=3; //ïî-óìîë÷àíèþ óñòðîéñòâî âûãëÿäèò êàê æåñòÿê íî ýòî íåïðàâèëüíî
121
				strcpy(#disc_name, "Unknown ");				
132
				strcpy(#disc_name, "Unknown ");				
122
		}
133
		}
123
		strcat(#disc_name, #dev_name);
134
		strcat(#disc_name, #dev_name);
124
		if (show_dev_name) WriteText(45,i*16+79,0x80,0,#disc_name);
135
		if (show_dev_name) WriteText(45,i*16+79,0x80,0,#disc_name);
125
			else WriteText(45,i*16+79,0x80,0,#dev_name);
136
			else WriteText(45,i*16+79,0x80,0,#dev_name);
126
		_PutImage(21,i*16+76, 14,13, dev_icon*14*13*3+#devices);
137
		_PutImage(21,i*16+76, 14,13, dev_icon*14*13*3+#devices);
127
	}
138
	}
128
}
139
}
129
 
140
 
130
void ActionsDraw()
141
void ActionsDraw()
131
{
142
{
132
	int actions_y=disc_num*16+108, lineh=16;
143
	int actions_y=disc_num*16+108, lineh=16;
133
	Tip(actions_y-18, T_ACTIONS, 77, ""); //çàãîëîâîê
144
	Tip(actions_y-18, T_ACTIONS, 77, ""); //çàãîëîâîê
134
	for (i=0; actions[i*3]!=0; i++, actions_y+=lineh)
145
	for (i=0; actions[i*3]!=0; i++, actions_y+=lineh)
135
	{
146
	{
136
		DrawBar(17,actions_y,160,lineh,0xFFFFFF); //áåëîå
147
		DrawBar(17,actions_y,160,lineh,0xFFFFFF); //áåëîå
137
		DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1);
148
		DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1);
138
		WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
149
		WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
139
		WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
150
		WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
140
		_PutImage(21,actions_y+2, 14,13, i*14*13*3+#factions);
151
		_PutImage(21,actions_y+2, 14,13, i*14*13*3+#factions);
141
	}
152
	}
142
}
153
}
143
 
154
 
144
 
155
 
145
void LeftPanelBgDraw()
156
void LeftPanelBgDraw()
146
{
157
{
147
	int actions_y=disc_num*16;
158
	int actions_y=disc_num*16;
148
	int start_y = actions_y+156;
159
	int start_y = actions_y+156;
149
	DrawBar(2,41,190,15,col_lpanel);		      //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè
160
	DrawBar(2,41,190,15,col_lpanel);		      //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè
150
	DrawBar(17,actions_y+75,160,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè
161
	DrawBar(17,actions_y+75,160,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè
151
	PutShadow(17,actions_y+75,160,1,1,3);
162
	PutShadow(17,actions_y+75,160,1,1,3);
152
	PutShadow(18,actions_y+75+1,158,1,1,1);
163
	PutShadow(18,actions_y+75+1,158,1,1,1);
153
	DrawBar(2,56,15,actions_y+103,col_lpanel);	          //ñèíèé ïðÿìîóãîëüíèê - ñëåâà       
164
	DrawBar(2,56,15,actions_y+103,col_lpanel);	          //ñèíèé ïðÿìîóãîëüíèê - ñëåâà       
154
	DrawBar(177,56,15,actions_y+103,col_lpanel);            //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà
165
	DrawBar(177,56,15,actions_y+103,col_lpanel);            //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà
155
	if (onTop(start_y, 6) < 268)
166
	if (onTop(start_y, 6) < 268)
156
		PutPaletteImage(#blue_hl, 190, onTop(start_y, 6), 2, start_y, 8, #blue_hl_pal);
167
		PutPaletteImage(#blue_hl, 190, onTop(start_y, 6), 2, start_y, 8, #blue_hl_pal);
157
	else
168
	else
158
	{
169
	{
159
		DrawBar(2,start_y,190,onTop(start_y,6+268),col_lpanel);
170
		DrawBar(2,start_y,190,onTop(start_y,6+268),col_lpanel);
160
		PutPaletteImage(#blue_hl, 190, 268, 2, onTop(268,6), 8, #blue_hl_pal);
171
		PutPaletteImage(#blue_hl, 190, 268, 2, onTop(268,6), 8, #blue_hl_pal);
161
	}
172
	}
162
	PutShadow(17,start_y,160,1,1,3);
173
	PutShadow(17,start_y,160,1,1,3);
163
	PutShadow(18,start_y+1,158,1,1,1);
174
	PutShadow(18,start_y+1,158,1,1,1);
164
}
175
}
165
 
176
 
166
 
177
 
167
void DrawLeftPanel()
178
void DrawLeftPanel()
168
{
179
{
169
	SystemDiscsDraw();
180
	SystemDiscsDraw();
170
	ActionsDraw();
181
	ActionsDraw();
171
	LeftPanelBgDraw();
182
	LeftPanelBgDraw();
172
}
183
}
173
>
184
>