Rev 4077 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4077 | Rev 4081 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | "View source F3",52, |
12 | "View source F3",52, |
13 | "Free image cache" ,02, |
13 | "Free image cache" ,02, |
14 | #endif |
14 | #endif |
15 | 0}; |
15 | 0}; |
Line -... | Line 16... | ||
- | 16 | ||
- | 17 | llist menu; |
|
- | 18 | dword col_work = 0xE4DFE1; |
|
Line 16... | Line 19... | ||
16 | 19 | dword col_border = 0x9098B0; |
|
17 | 20 | ||
18 | void menu_rmb() |
21 | void menu_rmb() |
19 | { |
22 | { |
20 | mouse mm; |
23 | mouse mm; |
21 | proc_info MenuForm; |
- | |
22 | llist menu; |
- | |
23 | int overid, key, N; |
- | |
Line 24... | Line 24... | ||
24 | dword col_work = 0xE4DFE1; |
24 | proc_info MenuForm; |
25 | dword col_border = 0x9098B0; |
25 | int key; |
26 | - | ||
27 | menu.first = menu.current = 0; |
- | |
28 | while (ITEMS_LIST[menu.count*2]) {menu.count++; menu.visible++;} |
26 | |
29 | menu.line_h = 19; |
27 | menu.first = menu.current = 0; |
Line 30... | Line 28... | ||
30 | menu.w = 165; |
28 | while (ITEMS_LIST[menu.count*2]) menu.count++; |
31 | menu.h = menu.count * menu.line_h; |
29 | menu.SetSizes(2,2,165,menu.count*19,0,19); |
32 | SetEventMask(100111b); |
30 | SetEventMask(100111b); |
33 | 31 | ||
34 | loop() switch(WaitEvent()) |
- | |
35 | { |
32 | loop() switch(WaitEvent()) |
Line 36... | Line 33... | ||
36 | case evMouse: |
33 | { |
37 | GetProcessInfo(#MenuForm, SelfInfo); |
34 | case evMouse: |
38 | N=GetProcessSlot(MenuForm.ID); |
35 | GetProcessInfo(#MenuForm, SelfInfo); |
39 | if (N<>GetActiveProcess()) ExitProcess(); |
36 | if (!CheckActiveProcess(MenuForm.ID)) ExitProcess(); |
Line 40... | Line 37... | ||
40 | 37 | ||
41 | mm.get(); |
38 | mm.get(); |
42 | if (menu.ProcessMouse(mm.x, mm.y)) goto _ITEMS_DRAW; |
39 | if (menu.ProcessMouse(mm.x, mm.y)) DrawMenuList(); |
43 | if (mm.lkm) || (mm.pkm) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); } |
40 | if (mm.lkm) || (mm.pkm) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); } |
44 | break; |
41 | break; |
45 | 42 | ||
46 | case evKey: |
43 | case evKey: |
47 | key = GetKey(); |
44 | key = GetKey(); |
48 | if (key==27) ExitProcess(); |
45 | if (key==27) ExitProcess(); |
49 | if (menu.ProcessKey(key)) goto _ITEMS_DRAW; |
46 | if (menu.ProcessKey(key)) DrawMenuList(); |
Line 50... | Line 47... | ||
50 | if (key==13) |
47 | if (key==13) |
51 | { |
48 | { |
52 | action_buf = ITEMS_LIST[menu.current*2+1]; |
49 | action_buf = ITEMS_LIST[menu.current*2+1]; |
- | 50 | ExitProcess(); |
|
- | 51 | } |
|
- | 52 | break; |
|
- | 53 | ||
- | 54 | case evReDraw: |
|
- | 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); |
|
Line 53... | Line -... | ||
53 | ExitProcess(); |
- | |
54 | } |
57 | DrawMenuList(); |
55 | break; |
58 | } |
56 | 59 | } |
|
57 | case evReDraw: |
60 | |
58 | DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.count*menu.line_h+4,0x01, 0, 0, 0x01fffFFF); |
61 | void DrawMenuList() |
59 | DrawPopup(0,0,menu.w,menu.count*menu.line_h+3,0, col_work,col_border); |
62 | { |
60 | 63 | int N; |
|
61 | _ITEMS_DRAW: |
64 | |
62 | for (N=0; N |
65 | for (N=0; N |
63 | { |
66 | { |
64 | if (N==menu.current) |
67 | if (N==menu.current) |
65 | DrawBar(2, N*menu.line_h+2, menu.w-3, menu.line_h, 0x94AECE); |
68 | DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, 0x94AECE); |
66 | else |
69 | else |
67 | { |
- | |
68 | DrawBar(2, N*menu.line_h+2, menu.w-3, menu.line_h, col_work); |
- | |
69 | WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N*2]); |
- | |
70 | } |
- | |
71 | WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N*2]); |
- | |
72 | } |
- |