Subversion Repositories Kolibri OS

Rev

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

Rev 2799 Rev 2803
Line 4... Line 4...
4
#define ITEM_WIDTH  138
4
#define ITEM_WIDTH  138
Line 5... Line 5...
5
 
5
 
6
char *ITEMS_LIST[]={
6
char *ITEMS_LIST[]={
7
"View in Tinypad   F3",
7
"View in Tinypad   F3",
8
"View in TextEdit  F4",
-
 
-
 
8
"View in TextEdit  F4",
9
"--------------------", //ñäåëàòü îïðåäåëåíèå òàêèõ ëèíèé è ðèñîâàòü èõ
9
"-",
10
"KOI-8         Ctrl+K",
10
"KOI-8         Ctrl+K",
11
"UTF           Ctrl+U",
11
"UTF           Ctrl+U",
Line 12... Line 12...
12
0}; 
12
0}; 
Line 17... Line 17...
17
void menu_rmb()
17
void menu_rmb()
18
{
18
{
Line 19... Line 19...
19
 
19
 
20
	mouse mm;
20
	mouse mm;
21
	int items_num, items_cur;
21
	int items_num, items_cur;
Line 22... Line 22...
22
	byte id, key;
22
	int id1, key;
Line 23... Line 23...
23
	
23
	
24
	SetEventMask(100111b); 
24
	SetEventMask(100111b); 
25
	
25
	
26
	loop() switch(WaitEvent())
26
	loop() switch(WaitEvent())
27
	{
-
 
28
		case evMouse:
-
 
Line -... Line 27...
-
 
27
	{
-
 
28
	case evMouse:
-
 
29
				mm.get();
-
 
30
 
29
				mm.get();
31
				GetProcessInfo(#MenuForm, SelfInfo);
30
				if (mm.lkm) || (mm.pkm)
32
				id1=GetSlot(MenuForm.ID);
31
					if (mm.x>ITEM_WIDTH) || (mm.y>items_num*ITEM_HEIGHT+1) ExitProcess();
33
				if (id1<>ActiveProcess()) ExitProcess();			
32
				
34
				
33
				id=mm.y/ITEM_HEIGHT;
35
				id1=mm.y/ITEM_HEIGHT;
34
				if (id<0) || (id+1>items_num) break;
36
				if (id1<0) || (id1+1>items_num) || (mm.x<0) || (mm.x>ITEM_WIDTH) break;
35
				if (items_cur<>id)
37
				if (items_cur<>id1)
Line 36... Line 38...
36
				{
38
				{
Line 37... Line 39...
37
					items_cur=id;
39
					items_cur=id1;
38
					goto _ITEMS_DRAW;
40
					goto _ITEMS_DRAW;
39
				}
-
 
40
				
-
 
41
				break;
-
 
42
				
-
 
43
		case evButton: 
-
 
44
				id=GetButtonID();
-
 
45
				if (id==1) ExitProcess();
-
 
46
				_BUTTON_MARK:
-
 
47
				if (id==10) WB1.Scan(52); //View html code
-
 
48
				if (id==11) WB1.Scan(53); //View html code
41
				}
Line 49... Line 42...
49
				if (id==12) break;
42
				
50
				if (id==13) WB1.Scan(11); //KOI
43
				break;
51
				if (id==14) WB1.Scan(21); //UTF
44
				
Line 66... Line 59...
66
					items_cur++;
59
					items_cur++;
67
					goto _ITEMS_DRAW;
60
					goto _ITEMS_DRAW;
68
				}
61
				}
69
				if (key==13)
62
				if (key==13)
70
				{
63
				{
71
					id=items_cur+10;
64
					ItemProcess(items_cur+10);
72
					//WriteDebug(IntToStr(id));
-
 
73
					goto _BUTTON_MARK;
-
 
74
				}
65
				}
75
				break;
66
				break;
Line 76... Line 67...
76
				
67
				
77
		case evReDraw:
68
		case evReDraw:
Line 80... Line 71...
80
 
71
 
81
				DrawRegion(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //îáîäîê
72
				DrawRegion(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //îáîäîê
82
				_ITEMS_DRAW:
73
				_ITEMS_DRAW:
83
				for (i=0; i
74
				for (i=0; i
-
 
75
				{
-
 
76
					if (!strcmp(ITEMS_LIST[i],"-"))
-
 
77
					{
-
 
78
						DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, 0xFFFFFF);
-
 
79
						DrawBar(1, i*ITEM_HEIGHT+1+9, ITEM_WIDTH-1, 1, 0x999999);
-
 
80
						continue;
84
				{
81
					}
85
					DefineButton(0, i*ITEM_HEIGHT, ITEM_WIDTH, ITEM_HEIGHT, i+10+BT_HIDE, 0xFFFFFF);
82
					DefineButton(0, i*ITEM_HEIGHT, ITEM_WIDTH, ITEM_HEIGHT, i+10+BT_HIDE, 0xFFFFFF);
86
					if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE;
83
					if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE;
87
					DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX);
84
					DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX);
88
					WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i],0);
85
					WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i],0);
89
				}
86
				}
90
	}
87
	}
91
}
88
}
-
 
89
 
-
 
90
void ItemProcess(int num_id)
-
 
91
{
-
 
92
	if (num_id==10) WB1.Scan(52);
-
 
93
	if (num_id==11) WB1.Scan(53);
-
 
94
	//-----------------------
-
 
95
	if (num_id==13) WB1.Scan(11); //KOI
-
 
96
	if (num_id==14) WB1.Scan(21); //UTF
-
 
97
	ExitProcess();
-
 
98
}
-
 
99
>
-
 
100
-
 
101
-
 
102
-
 
103