Subversion Repositories Kolibri OS

Rev

Rev 4074 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3992 leency 1
//Leency - 2012-2013
3067 leency 2
 
3
char *ITEMS_LIST[]={
3992 leency 4
"WIN                  F5",54,
5
"DOS              Ctrl+D",04,
6
"KOI              Ctrl+K",11,
7
"UTF              Ctrl+U",21,
8
#ifdef LANG_RUS
9
"Исходник страницы    F3",52,
10
"Очистить кэш картинок"  ,02,
11
#else
12
"View source          F3",52,
13
"Free image cache"       ,02,
14
#endif
3067 leency 15
0};
16
 
17
 
18
void menu_rmb()
19
{
20
	mouse mm;
4026 leency 21
	proc_info MenuForm;
22
	llist menu;
23
	int overid, key, N;
24
	dword col_work    = 0xE4DFE1;
25
	dword col_border  = 0x9098B0;
26
 
4077 leency 27
	menu.first = menu.current = 0;
28
	while (ITEMS_LIST[menu.count*2]) {menu.count++; menu.visible++;}
29
	menu.line_h = 19;
4026 leency 30
	menu.w = 165;
4077 leency 31
	menu.h = menu.count * menu.line_h;
3067 leency 32
	SetEventMask(100111b);
33
 
34
	loop() switch(WaitEvent())
35
	{
36
	case evMouse:
4026 leency 37
				GetProcessInfo(#MenuForm, SelfInfo);
38
				N=GetProcessSlot(MenuForm.ID);
39
				if (N<>GetActiveProcess()) ExitProcess();
3067 leency 40
 
4077 leency 41
				mm.get();
42
				if (menu.ProcessMouse(mm.x, mm.y)) goto _ITEMS_DRAW;
43
				if (mm.lkm) || (mm.pkm) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); }
3067 leency 44
				break;
45
 
46
		case evKey:
47
				key = GetKey();
48
				if (key==27) ExitProcess();
4074 leency 49
				if (menu.ProcessKey(key)) goto _ITEMS_DRAW;
3067 leency 50
				if (key==13)
51
				{
4026 leency 52
					action_buf = ITEMS_LIST[menu.current*2+1];
3067 leency 53
					ExitProcess();
54
				}
55
				break;
56
 
57
		case evReDraw:
4026 leency 58
				DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.count*menu.line_h+4,0x01, 0, 0, 0x01fffFFF);
59
				DrawPopup(0,0,menu.w,menu.count*menu.line_h+3,0, col_work,col_border);
3067 leency 60
 
61
				_ITEMS_DRAW:
4026 leency 62
				for (N=0; N
3067 leency 63
				{
4026 leency 64
					if (N==menu.current)
65
						DrawBar(2, N*menu.line_h+2, menu.w-3, menu.line_h, 0x94AECE);
66
					else
67
					{
68
						DrawBar(2, N*menu.line_h+2, menu.w-3, menu.line_h, col_work);
69
						WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N*2]);
70
					}
71
					WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N*2]);
3067 leency 72
				}
4026 leency 73
				DrawBar(7, cur_encoding*menu.line_h+9, 4, 4, 0x444444); //show current encoding
3067 leency 74
	}
75
}
76