Subversion Repositories Kolibri OS

Rev

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

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