Subversion Repositories Kolibri OS

Rev

Rev 4077 | 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
 
4081 leency 17
llist menu;
18
dword col_work    = 0xE4DFE1;
19
dword col_border  = 0x9098B0;
3067 leency 20
 
21
void menu_rmb()
22
{
23
	mouse mm;
4026 leency 24
	proc_info MenuForm;
4081 leency 25
	int key;
4026 leency 26
 
4077 leency 27
	menu.first = menu.current = 0;
4081 leency 28
	while (ITEMS_LIST[menu.count*2]) menu.count++;
29
	menu.SetSizes(2,2,165,menu.count*19,0,19);
3067 leency 30
	SetEventMask(100111b);
31
 
32
	loop() switch(WaitEvent())
33
	{
34
	case evMouse:
4026 leency 35
				GetProcessInfo(#MenuForm, SelfInfo);
4081 leency 36
				if (!CheckActiveProcess(MenuForm.ID)) ExitProcess();
3067 leency 37
 
4077 leency 38
				mm.get();
4081 leency 39
				if (menu.ProcessMouse(mm.x, mm.y)) DrawMenuList();
4077 leency 40
				if (mm.lkm) || (mm.pkm) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); }
3067 leency 41
				break;
42
 
43
		case evKey:
44
				key = GetKey();
45
				if (key==27) ExitProcess();
4081 leency 46
				if (menu.ProcessKey(key)) DrawMenuList();
3067 leency 47
				if (key==13)
48
				{
4026 leency 49
					action_buf = ITEMS_LIST[menu.current*2+1];
3067 leency 50
					ExitProcess();
51
				}
52
				break;
53
 
54
		case evReDraw:
4081 leency 55
				DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.h+4,0x01, 0, 0, 0x01fffFFF);
56
				DrawPopup(0,0,menu.w,menu.h+3,0, col_work,col_border);
57
				DrawMenuList();
3067 leency 58
	}
59
}
60
 
4081 leency 61
void DrawMenuList()
62
{
63
	int N;
3067 leency 64
 
4081 leency 65
	for (N=0; N
66
	{
67
		if (N==menu.current)
68
			DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, 0x94AECE);
69
		else
70
		{
71
			DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, col_work);
72
			WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N*2]);
73
		}
74
		WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N*2]);
75
	}
76
	DrawBar(7, cur_encoding*menu.line_h+9, 4, 4, 0x444444); //show current encoding
77
}