Subversion Repositories Kolibri OS

Rev

Rev 4677 | 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,
4412 leency 13
#else
4718 leency 14
"View source            F3",52,
15
"Edit source            F4",53,
16
"Free image cache"         ,09,
17
"History"                  ,03,
4412 leency 18
#endif
19
0};
20
 
21
llist menu;
22
 
23
void menu_rmb()
24
{
25
	mouse mm;
26
	proc_info MenuForm;
27
	int key;
28
 
29
	menu.first = menu.current = 0;
30
	while (ITEMS_LIST[menu.count*2]) menu.count++;
4718 leency 31
	menu.SetSizes(2,2,177,menu.count*19,0,19);
4412 leency 32
	SetEventMask(100111b);
33
 
34
	loop() switch(WaitEvent())
35
	{
36
	case evMouse:
37
				GetProcessInfo(#MenuForm, SelfInfo);
38
				if (!CheckActiveProcess(MenuForm.ID)) ExitProcess();
39
 
40
				mm.get();
41
				if (menu.ProcessMouse(mm.x, mm.y)) DrawMenuList();
42
				if (mm.lkm) || (mm.pkm) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); }
43
				break;
44
 
45
		case evKey:
46
				key = GetKey();
47
				if (key==27) ExitProcess();
48
				if (menu.ProcessKey(key)) DrawMenuList();
49
				if (key==13)
50
				{
51
					action_buf = ITEMS_LIST[menu.current*2+1];
52
					ExitProcess();
53
				}
54
				break;
55
 
56
		case evReDraw:
57
				DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.h+4,0x01, 0, 0, 0x01fffFFF);
4677 leency 58
				DrawPopup(0,0,menu.w,menu.h+3,0, col_bg,border_color);
4412 leency 59
				DrawMenuList();
60
	}
61
}
62
 
63
void DrawMenuList()
64
{
65
	int N;
66
 
67
	for (N=0; N
68
	{
69
		if (N==menu.current)
70
			DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, 0x94AECE);
71
		else
72
		{
4677 leency 73
			DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, col_bg);
4412 leency 74
			WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N*2]);
75
		}
76
		WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N*2]);
77
	}
4644 leency 78
	if (cur_encoding!=_DEFAULT)
79
	{
80
		DrawBar(7, cur_encoding*menu.line_h+9, 4, 4, 0x444444); //show current encoding
81
	}
82
	else DrawBar(7, _DOS*menu.line_h+9, 4, 4, 0x444444); //show current encoding
4412 leency 83
}