Subversion Repositories Kolibri OS

Rev

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