Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
4412 leency 1
//Leency - 2012-2013
2
 
3
char *ITEMS_LIST[]={
4718 leency 4
"WIN                Ctrl+E",05,
5
"DOS                Ctrl+D",04,
6
"KOI                Ctrl+K",11,
7
"UTF                Ctrl+U",21,
4412 leency 8
#ifdef LANG_RUS
4718 leency 9
"Посмотреть исходник    F3",52,
10
"Редактировать исходник F4",53,
11
"Очистить кэш картинок"    ,02,
12
"История"                  ,03,
5493 leency 13
"Менеджер загрузок"        ,06,
4412 leency 14
#else
4718 leency 15
"View source            F3",52,
16
"Edit source            F4",53,
17
"Free image cache"         ,09,
18
"History"                  ,03,
5493 leency 19
"Download Manager"         ,06,
4412 leency 20
#endif
21
0};
22
 
23
llist menu;
24
 
25
void menu_rmb()
26
{
27
	mouse mm;
28
	proc_info MenuForm;
29
	int key;
30
 
31
	menu.first = menu.current = 0;
32
	while (ITEMS_LIST[menu.count*2]) menu.count++;
4718 leency 33
	menu.SetSizes(2,2,177,menu.count*19,0,19);
4412 leency 34
	SetEventMask(100111b);
35
 
36
	loop() switch(WaitEvent())
37
	{
38
	case evMouse:
39
				GetProcessInfo(#MenuForm, SelfInfo);
40
				if (!CheckActiveProcess(MenuForm.ID)) ExitProcess();
41
 
42
				mm.get();
43
				if (menu.ProcessMouse(mm.x, mm.y)) DrawMenuList();
44
				if (mm.lkm) || (mm.pkm) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); }
45
				break;
46
 
47
		case evKey:
48
				key = GetKey();
49
				if (key==27) ExitProcess();
50
				if (menu.ProcessKey(key)) DrawMenuList();
51
				if (key==13)
52
				{
53
					action_buf = ITEMS_LIST[menu.current*2+1];
54
					ExitProcess();
55
				}
56
				break;
57
 
58
		case evReDraw:
5408 leency 59
				DefineAndDrawWindow(Form.left+m.x-6,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.h+4,0x01, 0, 0, 0x01fffFFF);
4677 leency 60
				DrawPopup(0,0,menu.w,menu.h+3,0, col_bg,border_color);
4412 leency 61
				DrawMenuList();
62
	}
63
}
64
 
65
void DrawMenuList()
66
{
67
	int N;
68
 
69
	for (N=0; N
70
	{
71
		if (N==menu.current)
72
			DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, 0x94AECE);
73
		else
74
		{
4677 leency 75
			DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, col_bg);
4412 leency 76
			WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N*2]);
77
		}
78
		WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N*2]);
79
	}
4644 leency 80
	if (cur_encoding!=_DEFAULT)
81
	{
82
		DrawBar(7, cur_encoding*menu.line_h+9, 4, 4, 0x444444); //show current encoding
83
	}
84
	else DrawBar(7, _DOS*menu.line_h+9, 4, 4, 0x444444); //show current encoding
4412 leency 85
}