Subversion Repositories Kolibri OS

Rev

Rev 3991 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3991 Rev 3997
Line 1... Line 1...
1
//Leency 2008-2013
1
//Leency 2008-2013
Line -... Line 2...
-
 
2
 
2
 
3
//pay attension: >200 this is only file actions, not supported by folders
3
#ifdef LANG_RUS
4
#ifdef LANG_RUS
4
char *captions[] = {
5
char *file_captions[] = {
5
	"Žâªàëâì",               "Enter",
6
	"Žâªàëâì",               "Enter",100,
6
	"Žâªàëâì á ¯®¬®éìî...",  "CrlEnt",
7
	"Žâªàëâì á ¯®¬®éìî...",  "CrlEnt",201,
7
	"Žâªàëâì ª ª ⥪áâ",     "F3",
8
	"Žâªàëâì ª ª ⥪áâ",     "F3",202,
8
	"Žâªàëâì ª ª HEX",       "F4",
-
 
9
	//
9
	"Žâªàëâì ª ª HEX",       "F4",203,
10
	"Š®¯¨à®¢ âì",            "Crl+C",
10
	"Š®¯¨à®¢ âì",            "Crl+C",104,
11
	"‚ë१ âì",              "Crl+X",
11
	"‚ë१ âì",              "Crl+X",105,
12
	"‚áâ ¢¨âì",              "Crl+V",
12
	"‚áâ ¢¨âì",              "Crl+V",106,
13
	"¥à¥¨¬¥­®¢ âì",         "F2",
13
	"¥à¥¨¬¥­®¢ âì",         "F2",107,
14
	"“¤ «¨âì",               "Del",
14
	"“¤ «¨âì",               "Del",108,
15
	"Ž¡­®¢¨âì",              "F5",
15
	"Ž¡­®¢¨âì",              "F5",109,
16
	0, 0};
16
	0, 0, 0};
17
#elif LANG_EST
17
#elif LANG_EST
18
char *captions[] = {
18
char *file_captions[] = {
19
	"Ava",            "Enter",
19
	"Ava",            "Enter",100,
20
	"Ava ...",        "CrlEnt",
20
	"Ava ...",        "CrlEnt",201,
21
	"Vaata tekstina", "F3",
21
	"Vaata tekstina", "F3",202,
22
	"Vaata HEX",      "F4",
-
 
23
	//
22
	"Vaata HEX",      "F4",203,
24
	"Kopeeri",        "Crl+C",
23
	"Kopeeri",        "Crl+C",104,
25
	"Lõika",          "Crl+X",
24
	"Lõika",          "Crl+X",105,
26
	"Aseta",          "Crl+V",
25
	"Aseta",          "Crl+V",106,
27
	"Nimeta ümber",   "F2",
26
	"Nimeta ümber",   "F2",107,
28
	"Kustuta",        "Del",
27
	"Kustuta",        "Del",108,
29
	"Värskenda",      "F5",
28
	"Värskenda",      "F5",109,
30
	0, 0};
29
	0, 0, 0};
31
#else
30
#else
32
char *captions[] = {
31
char *file_captions[] = {
33
	"Open",          "Enter",
32
	"Open",          "Enter",100,
34
	"Open with...",  "CrlEnt",
33
	"Open with...",  "CrlEnt",201,
35
	"View as text",  "F3",
34
	"View as text",  "F3",202,
36
	"View as HEX",   "F4",
-
 
37
	//
35
	"View as HEX",   "F4",203,
38
	"Copy",          "Crl+C",
36
	"Copy",          "Crl+C",104,
39
	"Cut",           "Crl+X",
37
	"Cut",           "Crl+X",105,
40
	"Paste",         "Crl+V",
38
	"Paste",         "Crl+V",106,
41
	"Rename",        "F2",
39
	"Rename",        "F2",107,
42
	"Delete",        "Del",
40
	"Delete",        "Del",108,
43
	"Refresh",       "F5",
41
	"Refresh",       "F5",109,
44
	0, 0};
42
	0, 0, 0};
Line 45... Line -...
45
#endif
-
 
Line 46... Line 43...
46
 
43
#endif
47
proc_info MenuForm;
44
 
48
 
45
 
49
void FileMenu()
46
void FileMenu()
-
 
47
{
50
{
48
	mouse mm;
51
	mouse mm;
49
	word id, key, slot, index, start_y;
52
	word id, key, slot, index;
50
	proc_info MenuForm;
-
 
51
	int ccount=0, cur=0, newi, linew=10, lineh=18, texty;
-
 
52
	for (index=0; file_captions[index]!=0; index+=3)
53
	int ccount=0, cur, newi, linew=10, lineh=18, texty;
53
	{
54
	for (index=0; captions[index]!=0; index+=2)
-
 
55
	{
54
		if (itdir) && (file_captions[index+2]>=200) continue;
56
		ccount++;
55
		if (strlen(file_captions[index])>linew) linew = strlen(file_captions[index]);
57
		if (strlen(captions[index])>linew) linew = strlen(captions[index]);
56
		ccount++;
58
	}
57
	}
Line 77... Line 76...
77
				break;
76
				break;
Line 78... Line 77...
78
 
77
 
79
		case evButton: 
78
		case evButton: 
80
				id=GetButtonID();
79
				id=GetButtonID();
81
				if (id==100) Open();
80
				if (id==100) Open();
82
				if (id==101) notify("Not compleated yet");
81
				if (id==201) notify("Not compleated yet");
83
				if (id==102) FnProcess(3); //F3
82
				if (id==202) FnProcess(3); //F3
84
				if (id==103) FnProcess(4); //F4
83
				if (id==203) FnProcess(4); //F4
85
				if (id==104) Copy(#file_path, NOCUT);
84
				if (id==104) Copy(#file_path, NOCUT);
86
				if (id==105) Copy(#file_path, CUT);
85
				if (id==105) Copy(#file_path, CUT);
87
				if (id==106) CreateThread(#Paste,#copy_stak);
86
				if (id==106) CreateThread(#Paste,#copy_stak);
88
				if (id==107) FnProcess(2);
87
				if (id==107) FnProcess(2);
Line 101... Line 100...
101
				DrawRectangle(0,0,linew+1,ccount*lineh+2,col_border);
100
				DrawRectangle(0,0,linew+1,ccount*lineh+2,col_border);
102
				DrawBar(1,1,linew,1,0xFFFfff);
101
				DrawBar(1,1,linew,1,0xFFFfff);
103
				DrawPopupShadow(1,1,linew,ccount*lineh,0);
102
				DrawPopupShadow(1,1,linew,ccount*lineh,0);
Line 104... Line 103...
104
 
103
 
105
				_ITEMS_DRAW:
104
				_ITEMS_DRAW:
106
				for (index=0; captions[index*2]!=0; index++)
105
				for (index=0, start_y=0; file_captions[index*3]!=0; index++)
107
				{
106
				{
-
 
107
					DefineButton(1,start_y+1,linew,lineh-1,file_captions[index*3+2]+BT_HIDE+BT_NOFRAME,0xFFFFFF);
108
					DefineButton(1,index*lineh+1,linew,lineh-1,index+100+BT_HIDE+BT_NOFRAME,0xFFFFFF);
108
					if ((itdir) && (file_captions[index*3+2]>=200)) continue;
109
					DrawBar(1,index*lineh+2,1,lineh,0xFFFfff);
109
					DrawBar(1,start_y+2,1,lineh,0xFFFfff);
110
					if (index==cur)
110
					if (start_y/lineh==cur)
111
					{
111
					{
112
						DrawBar(2,index*lineh+2,linew-1,lineh,0xFFFfff);
112
						DrawBar(2,start_y+2,linew-1,lineh,0xFFFfff);
113
					}
113
					}
114
					else
114
					else
115
					{
115
					{
116
						DrawBar(2,index*lineh+2,linew-1,lineh,col_work);
116
						DrawBar(2,start_y+2,linew-1,lineh,col_work);
117
						WriteText(8,index*lineh+texty+3,0x80,0xf2f2f2,captions[index*2]);
117
						WriteText(8,start_y+texty+3,0x80,0xf2f2f2,file_captions[index*3]);
118
					}
118
					}
119
					WriteText(7,index*lineh+texty+2,0x80,0x000000,captions[index*2]);
119
					WriteText(7,start_y+texty+2,0x80,0x000000,file_captions[index*3]);
-
 
120
					WriteText(-strlen(file_captions[index*3+1])*6-6+linew,start_y+texty+2,0x80,0x888888,file_captions[index*3+1]);
120
					WriteText(-strlen(captions[index*2+1])*6-6+linew,index*lineh+texty+2,0x80,0x888888,captions[index*2+1]);
121
					start_y+=lineh;
121
				}
122
				}
122
	}
123
	}
123
}
124
}