Rev 2532 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2532 | mario79 | 1 | ;------------------------------------------------------------------------------ |
2 | align 4 |
||
870 | barsuk | 3 | context_menu_start: |
2532 | mario79 | 4 | mcall 40,00100111b |
5 | mov ecx, [ctx_menu_PID] |
||
6 | mcall 18,21 |
||
7 | mov ecx, eax |
||
8 | mcall 18,3 |
||
9 | call draw_ctx_menu |
||
10 | ;------------------------------------------------------------------------------ |
||
11 | align 4 |
||
12 | ctx_menu_still: |
||
13 | mcall 10 |
||
14 | cmp eax, 2 |
||
15 | jz ctx_menu_key |
||
602 | Rus | 16 | |
2532 | mario79 | 17 | cmp eax, 3 |
18 | jz ctx_menu_button |
||
602 | Rus | 19 | |
2532 | mario79 | 20 | cmp eax, 6 |
21 | jz ctx_menu_mouse |
||
602 | Rus | 22 | |
2532 | mario79 | 23 | call draw_ctx_menu |
24 | jmp ctx_menu_still |
||
25 | ;------------------------------------------------------------------------------ |
||
26 | align 4 |
||
27 | ctx_menu_key: |
||
28 | mcall 2 |
||
29 | ;-------------------------------------- |
||
30 | align 4 |
||
31 | ctx_menu_button: |
||
32 | mcall 17 |
||
33 | cmp ah, 1 |
||
34 | jne @f |
||
602 | Rus | 35 | |
2532 | mario79 | 36 | mov eax, 18 |
37 | mov ebx, 2 |
||
38 | mov ecx, [n_slot] |
||
39 | jmp .lllxxx |
||
40 | ;-------------------------------------- |
||
41 | align 4 |
||
633 | diamond | 42 | @@: |
2532 | mario79 | 43 | cmp ah, 2 |
44 | jne ctx_menu_still |
||
45 | mov eax, 18 |
||
46 | mov ebx, 22 |
||
47 | mov edx, [n_slot] |
||
48 | xor ecx, ecx |
||
602 | Rus | 49 | |
2532 | mario79 | 50 | test [procinfo_for_detect+70],byte 2 |
51 | setnz cl |
||
52 | add cl, cl |
||
53 | ;-------------------------------------- |
||
54 | align 4 |
||
55 | .lllxxx: |
||
56 | mcall |
||
57 | jmp ctx_menu_exit |
||
58 | ;-------------------------------------- |
||
59 | align 4 |
||
60 | ctx_menu_mouse: |
||
61 | mcall 37,2 |
||
62 | xchg eax,ecx ; Если не одна из кнопок не нажата возвращаемся |
||
63 | ; в главный цикл потока |
||
64 | jecxz ctx_menu_still |
||
602 | Rus | 65 | |
2532 | mario79 | 66 | mcall 37,1 |
602 | Rus | 67 | |
2532 | mario79 | 68 | cmp ax, 0 ; Тут проверяем произошёл-ли клик за пределами окна контекстного |
69 | jb ctx_menu_exit ; меню, если за пределами то закрываем контекстное меню |
||
602 | Rus | 70 | |
2532 | mario79 | 71 | cmp ax, 60 ; 41 |
72 | ja ctx_menu_exit |
||
602 | Rus | 73 | |
2532 | mario79 | 74 | shr eax, 16 |
75 | cmp ax, 0 |
||
76 | jb ctx_menu_exit |
||
602 | Rus | 77 | |
2532 | mario79 | 78 | cmp ax, 133 |
79 | ja ctx_menu_exit |
||
870 | barsuk | 80 | |
2532 | mario79 | 81 | jmp ctx_menu_still |
82 | ;-------------------------------------- |
||
83 | align 4 |
||
84 | ctx_menu_exit: |
||
85 | or eax,-1 |
||
86 | mcall |
||
87 | ;------------------------------------------------------------------------------ |
||
88 | align 4 |
||
89 | ;func draw_ctx_menu |
||
90 | draw_ctx_menu: |
||
91 | mcall 12, 1 |
||
602 | Rus | 92 | |
2532 | mario79 | 93 | xor eax, eax |
94 | movzx ebx, [x_coord] |
||
95 | shl ebx, 16 |
||
96 | add ebx, 133 |
||
97 | movzx ecx, [y_coord] |
||
98 | sub ecx, 60 ; 41 |
||
99 | shl ecx, 16 |
||
100 | add ecx, 60 ; 41 |
||
101 | mov esi, [system_colours + 4] ; sc.grab |
||
102 | or esi, 0x81000000 |
||
2630 | mario79 | 103 | mcall ,,,[system_colours + 20],,[system_colours] |
602 | Rus | 104 | |
2532 | mario79 | 105 | mcall 8,<0,133>,<22,17>,0x40000001 |
602 | Rus | 106 | |
2532 | mario79 | 107 | inc edx |
108 | mcall ,,<40,17> |
||
2195 | leency | 109 | |
2532 | mario79 | 110 | mov ecx, [system_colours + 16] ; sc.grab_text |
111 | or ecx, 0x10000000 |
||
112 | mcall 4,<36,7>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title |
||
602 | Rus | 113 | |
2532 | mario79 | 114 | add ebx, 1 * 65536 |
115 | mcall |
||
633 | diamond | 116 | |
2532 | mario79 | 117 | mcall ,<4,28>,0x80000000,ctx_menu_text |
602 | Rus | 118 | |
2532 | mario79 | 119 | mov edx, ctx_menu_text2 |
602 | Rus | 120 | |
2532 | mario79 | 121 | test byte [procinfo_for_detect+70], 2 |
122 | jz @f |
||
123 | mov edx, ctx_menu_text3 |
||
124 | ;-------------------------------------- |
||
125 | align 4 |
||
633 | diamond | 126 | @@: |
2532 | mario79 | 127 | add bx, 18 |
128 | mcall |
||
2195 | leency | 129 | |
2532 | mario79 | 130 | mcall 12,2 |
131 | ret |
||
132 | ;endf |
||
133 | ;------------------------------------------------------------------------------ |
||
134 | align 4 |
||
602 | Rus | 135 | x_coord rw 1 |
136 | y_coord rw 1 |
||
137 | n_slot rd 1 |
||
2532 | mario79 | 138 | ctx_menu_PID rd 1 |
139 | ;------------------------------------------------------------------------------ |
||
602 | Rus | 140 | lsz ctx_menu_text,\ |
633 | diamond | 141 | ru, <"X Закрыть Alt + F4",0>,\ |
142 | en, <"X Close Alt + F4",0>,\ |
||
2532 | mario79 | 143 | ;------------------------------------------------------------------------------ |
633 | diamond | 144 | lsz ctx_menu_text2,\ |
145 | ru, <25," Свернуть ",0>,\ |
||
146 | en, <25," Minimize ",0>,\ |
||
2532 | mario79 | 147 | ;------------------------------------------------------------------------------ |
633 | diamond | 148 | lsz ctx_menu_text3,\ |
149 | ru, <24," Восстановить ",0>,\ |
||
150 | en, <24," Restore ",0> |
||
2532 | mario79 | 151 | ;------------------------------------------------------------------------------ |
602 | Rus | 152 | ctx_menu_title: |
2532 | mario79 | 153 | db 'KolibriOS' |
870 | barsuk | 154 | ctx_menu_title_end: |
2532 | mario79 | 155 | ;------------------------------------------------------------------------------24,">24,">25,">25,">"X>"X>4,28>36,7>40,17>22,17>0,133> |