Subversion Repositories Kolibri OS

Rev

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

Rev 3458 Rev 3695
Line 3... Line 3...
3
char *captions[] = {
3
char *captions[] = {
4
	"Open",          "Enter",
4
	"Open",          "Enter",
5
	"Open with...",  "CrlEnt",
5
	"Open with...",  "CrlEnt",
6
	"View as text",  "F3",
6
	"View as text",  "F3",
7
	"View as HEX",   "F4",
7
	"View as HEX",   "F4",
-
 
8
	//
-
 
9
	"Copy",          "Crl+C",
-
 
10
	"Cut",           "Crl+X",
-
 
11
	"Paste",         "Crl+V",
8
	"Rename",        "F2",
12
	"Rename",        "F2",
9
	"Delete",        "Del",
13
	"Delete",        "Del",
10
	//"Refresh",       "F5",
14
	//"Refresh",       "F5",
11
	0};
15
	0, 0};
-
 
16
 
-
 
17
proc_info MenuForm;
Line 12... Line 18...
12
 
18
 
13
void FileMenu()
19
void FileMenu()
14
{
-
 
15
	proc_info MenuForm;
20
{
16
	mouse mm;
21
	mouse mm;
17
	word id, key, slot;
22
	word id, key, slot, index;
18
	int ccount=0, cur, newi, linew=10, lineh=18, texty;
23
	int ccount=0, cur, newi, linew=10, lineh=18, texty;
19
	for (i=0; captions[i]!=0; i+=2)
24
	for (index=0; captions[index]!=0; index+=2)
20
	{
25
	{
21
		ccount++;
26
		ccount++;
22
		if (strlen(captions[i])>linew) linew = strlen(captions[i]);
27
		if (strlen(captions[index])>linew) linew = strlen(captions[index]);
23
	}
28
	}
24
	linew = linew + 3 * 6 + 50;
29
	linew = linew + 3 * 6 + 50;
25
	texty = lineh/2-4;
30
	texty = lineh/2-4;
Line 43... Line 48...
43
 
48
 
44
		case evButton: 
49
		case evButton: 
45
				id=GetButtonID();
50
				id=GetButtonID();
46
				if (id==100) Open();
51
				if (id==100) Open();
47
				if (id==101) notify("Not compleated yet");
52
				if (id==101) notify("Not compleated yet");
48
				if (id==102) FnProcess(3);
53
				if (id==102) FnProcess(3); //F3
-
 
54
				if (id==103) FnProcess(4); //F4
-
 
55
				if (id==104) Copy(#file_path, NOCUT);
-
 
56
				if (id==105) Copy(#file_path, CUT);
49
				if (id==103) FnProcess(4);
57
				if (id==106) CreateThread(#Paste,#copy_stak);
50
				if (id==104) FnProcess(2);
58
				if (id==107) FnProcess(2);
51
				if (id==105) Del_Form();
59
				if (id==108) Del_Form();
52
				if (id==106) FnProcess(5);
-
 
53
				SwitchToAnotherThread();
60
				if (id==109) FnProcess(5);
54
				ExitProcess();
61
				ExitProcess();
Line 55... Line 62...
55
				break;
62
				break;
56
				
63
				
57
		case evKey:
64
		case evKey:
Line 58... Line 65...
58
				IF (GetKey()==27) ExitProcess();
65
				IF (GetKey()==27) ExitProcess();
59
				break;
66
				break;
60
				
67
				
61
		case evReDraw: _MENU_DRAW:
-
 
62
				DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+3,ccount*lineh+6,0x01, 0, 0, 0x01fffFFF);
68
		case evReDraw: _MENU_DRAW:
63
				GetProcessInfo(#MenuForm, SelfInfo);
69
				DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+3,ccount*lineh+6,0x01, 0, 0, 0x01fffFFF);
64
				/* _PutImage(1,23, 16,44, #factions); //èêîíêè	*/
70
				GetProcessInfo(#MenuForm, SelfInfo);
65
				DrawRectangle(0,0,linew+1,ccount*lineh+2,col_border);
71
				DrawRectangle(0,0,linew+1,ccount*lineh+2,col_border);
66
				DrawBar(1,1,linew,1,0xFFFfff);
72
				DrawBar(1,1,linew,1,0xFFFfff);
67
				PutShadow(linew+2,1,1,ccount*lineh+2,0,2);
73
				PutShadow(linew+2,1,1,ccount*lineh+2,0,2);
Line 68... Line 74...
68
				PutShadow(linew+3,2,1,ccount*lineh+2,0,1);
74
				PutShadow(linew+3,2,1,ccount*lineh+2,0,1);
69
				PutShadow(1,ccount*lineh+3,linew+2,1,0,2);
75
				PutShadow(1,ccount*lineh+3,linew+2,1,0,2);
-
 
76
				PutShadow(2,ccount*lineh+4,linew+1,1,0,1);
-
 
77
 
-
 
78
				_ITEMS_DRAW:
-
 
79
				for (index=0; captions[index*2]!=0; index++)
70
				PutShadow(2,ccount*lineh+4,linew+1,1,0,1);
80
				{
71
 
81
					DefineButton(1,index*lineh+1,linew,lineh-1,index+100+BT_HIDE+BT_NOFRAME,0xFFFFFF);
-
 
82
					DrawBar(1,index*lineh+2,1,lineh,0xFFFfff);
-
 
83
					if (index==cur)
-
 
84
					{
72
				_ITEMS_DRAW:
85
						DrawBar(2,index*lineh+2,linew-1,lineh,0xFFFfff);
73
				for (i=0; captions[i*2]!=0; i++)
86
					}
-
 
87
					else
74
				{
88
					{
75
					DefineButton(1,i*lineh+1,linew,lineh-1,i+100+BT_HIDE+BT_NOFRAME,0xFFFFFF);
89
						DrawBar(2,index*lineh+2,linew-1,lineh,col_work);
76
					DrawBar(1,i*lineh+2,1,lineh,0xFFFfff);
90
						WriteText(8,index*lineh+texty+3,0x80,0xf2f2f2,captions[index*2]);
77
					if (i==cur) DrawBar(2,i*lineh+2,linew-1,lineh,0xFFFfff); else DrawBar(2,i*lineh+2,linew-1,lineh,col_work);
91
					}
78
					WriteText(7,i*lineh+texty+2,0x80,0x000000,captions[i*2]);
92
					WriteText(7,index*lineh+texty+2,0x80,0x000000,captions[index*2]);
79
					WriteText(-strlen(captions[i*2+1])*6-6+linew,i*lineh+texty+2,0x80,0x999999,captions[i*2+1]);
93
					WriteText(-strlen(captions[index*2+1])*6-6+linew,index*lineh+texty+2,0x80,0x888888,captions[index*2+1]);