Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5819 leency 1
char stak[4096];
2
 
3
byte action_buf;
4
 
5
llist menu;
6
 
7
void menu_rmb()
8
{
9
	proc_info MenuForm;
10
	menu.ClearList();
11
	while (charsets[menu.count]) menu.count++;
12
	menu.SetSizes(2,2,140,menu.count*19,19);
13
	SetEventMask(100111b);
14
	_BEGIN_APPLICATION_MENU:
15
	switch(WaitEvent())
16
	{
17
	case evMouse:
18
		GetProcessInfo(#MenuForm, SelfInfo);
19
		if (!CheckActiveProcess(MenuForm.ID)) ExitProcess();
20
		mouse.get();
21
		if (menu.ProcessMouse(mouse.x, mouse.y)) DrawMenuList();
22
		if (mouse.lkm)&&(mouse.up) ItemClick();
23
		break;
24
	case evKey:
25
		GetKeys();
26
		if (key_scancode==SCAN_CODE_ESC) ExitProcess();
27
		if (key_scancode==SCAN_CODE_ENTER) ItemClick();
28
		if (menu.ProcessKey(key_scancode)) DrawMenuList();
29
		break;
30
	case evReDraw:
31
		DefineAndDrawWindow(Form.left+104,Form.top+29+SKIN.height,menu.w+2,menu.h+4,0x01, 0, 0, 0x01fffFFF);
32
		DrawPopup(0,0,menu.w,menu.h+3,0, 0xE4DFE1,0x9098B0);
33
		DrawMenuList();
34
	}
35
	goto _BEGIN_APPLICATION_MENU;
36
}
37
 
38
void DrawMenuList()
39
{
40
	int N;
41
	for (N=0; N
42
	{
43
		if (N==menu.current)
44
			DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, 0xFFFfff);
45
		else
46
		{
47
			DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, 0xE4DFE1);
48
			WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,charsets[N]);
49
		}
50
		WriteText(18,N*menu.line_h+8,0x80,0x000000,charsets[N]);
51
	}
52
	WriteText(5, encoding*menu.line_h+7, 0x80, 0x777777, "\x10");
53
}
54
 
55
void ItemClick()
56
{
57
	if (encoding!=menu.current)
58
	{
59
		encoding = menu.current;
60
		action_buf = true;
61
	}
62
	ExitProcess();
63
}