Rev 633 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
870 | barsuk | 1 | context_menu_start: |
602 | Rus | 2 | |
3 | mov eax, 40 |
||
4 | mov ebx, 00100111b |
||
5 | int 0x40 |
||
6 | |||
7 | ;call draw_ctx_menu |
||
8 | |||
633 | diamond | 9 | mov ebp, 2 ; 2 часто используется. |
10 | ; // Alver 26.08.2007 // { |
||
11 | ; xor ecx, ecx |
||
12 | ; mov edx, [ctx_menu_PID] |
||
13 | ; find_slot: |
||
14 | ; inc ecx |
||
15 | ; mov eax, 9 |
||
16 | ; mov ebx, process_info_buffer |
||
17 | ; int 0x40 |
||
18 | ; cmp dword [process_info_buffer + 30], edx |
||
19 | ; jne find_slot |
||
20 | mov ecx, [ctx_menu_PID] |
||
21 | mcall 18,21 |
||
22 | mov ecx, eax |
||
23 | ; } \\ Alver \\ |
||
602 | Rus | 24 | mov eax, 18 |
25 | mov ebx, 3 |
||
26 | ;mov ecx, ecx ; :) |
||
27 | int 0x40 |
||
28 | |||
29 | call draw_ctx_menu |
||
30 | |||
31 | ctx_menu_still: |
||
32 | mov eax, 10 |
||
33 | int 0x40 |
||
34 | |||
35 | cmp eax, ebp ; cmp eax, 2 |
||
36 | jz ctx_menu_key |
||
37 | cmp eax, 3 |
||
38 | jz ctx_menu_button |
||
39 | cmp eax, 6 |
||
40 | jz ctx_menu_mouse |
||
41 | |||
42 | call draw_ctx_menu |
||
43 | |||
44 | jmp ctx_menu_still |
||
45 | |||
46 | ctx_menu_key: |
||
47 | mov eax, ebp ; mov eax, 2 |
||
48 | int 0x40 |
||
49 | |||
50 | ctx_menu_button: |
||
51 | mov eax, 17 |
||
52 | int 0x40 |
||
870 | barsuk | 53 | |
602 | Rus | 54 | cmp ah, 1 |
633 | diamond | 55 | ; // Alver 26.08.2007 // { |
56 | ; jne ctx_menu_still |
||
57 | jne @f |
||
58 | ; } \\ Alver \\ |
||
602 | Rus | 59 | mov eax, 18 |
60 | mov ebx, ebp ; mov eax, 2 |
||
61 | mov ecx, [n_slot] |
||
633 | diamond | 62 | ; // Alver 26.08.2007 // { |
63 | jmp .lllxxx |
||
64 | @@: |
||
65 | cmp ah, 2 |
||
66 | jne ctx_menu_still |
||
67 | mov eax, 18 |
||
68 | mov ebx, 22 |
||
69 | mov edx, [n_slot] |
||
70 | xor ecx, ecx |
||
71 | ; \begin{diamond}[20.09.2007] |
||
72 | test byte [procinfo_for_detect+70], 2 |
||
73 | setnz cl |
||
74 | add cl, cl |
||
75 | ; \end{diamond}[20.09.2007] |
||
76 | .lllxxx: |
||
77 | ; } \\ Alver \\ |
||
602 | Rus | 78 | int 0x40 |
79 | jmp ctx_menu_exit |
||
80 | |||
81 | ctx_menu_mouse: |
||
82 | mov eax, 37 |
||
83 | mov ebx, ebp ; mov ebx, 2 |
||
84 | int 0x40 |
||
85 | |||
633 | diamond | 86 | xchg eax, ecx ; cmp eax, 0 Если не одна из кнопок не нажата возвращаемся |
87 | ; в главный цикл потока |
||
602 | Rus | 88 | jecxz ctx_menu_still |
89 | |||
90 | mov eax, 37 |
||
91 | xor ebx, ebx ; mov ebx, 1 |
||
92 | inc ebx |
||
93 | int 0x40 |
||
94 | |||
633 | diamond | 95 | cmp ax, 0 ; Тут проверяем произошёл-ли клик за пределами окна контекстного |
96 | jb ctx_menu_exit ; меню, если за пределами то закрываем контекстное меню |
||
97 | cmp ax, 60 ; 41 |
||
602 | Rus | 98 | ja ctx_menu_exit |
99 | shr eax, 16 |
||
100 | cmp ax, 0 |
||
101 | jb ctx_menu_exit |
||
102 | cmp ax, 133 |
||
103 | ja ctx_menu_exit |
||
104 | |||
105 | jmp ctx_menu_still |
||
106 | |||
107 | ctx_menu_exit: |
||
870 | barsuk | 108 | |
602 | Rus | 109 | xor eax, eax |
110 | dec eax ; mov eax, -1 |
||
111 | int 0x40 |
||
112 | |||
113 | func draw_ctx_menu |
||
114 | |||
115 | mov eax, 12 |
||
116 | xor ebx, ebx ; mov ebx, 1 |
||
117 | inc ebx |
||
118 | int 0x40 |
||
119 | |||
120 | xor eax, eax ; mov eax, 0 |
||
121 | movzx ebx, [x_coord] |
||
122 | shl ebx, 16 |
||
123 | add ebx, 133 |
||
124 | movzx ecx, [y_coord] |
||
633 | diamond | 125 | sub ecx, 60 ; 41 |
602 | Rus | 126 | shl ecx, 16 |
633 | diamond | 127 | add ecx, 60 ; 41 |
602 | Rus | 128 | mov edx, [system_colours + 20] ; sc.work |
129 | mov esi, [system_colours + 4] ; sc.grab |
||
130 | or esi, 0x81000000 |
||
131 | mov edi, [system_colours] ; sc.frame |
||
132 | int 0x40 |
||
133 | |||
134 | mov eax, 8 |
||
135 | mov ebx, 0 * 65536 + 133 |
||
633 | diamond | 136 | mov ecx, 22 * 65536 + 16 |
602 | Rus | 137 | mov edx, 0x40000001 |
138 | int 0x40 |
||
139 | |||
633 | diamond | 140 | mov eax, 8 |
141 | mov ebx, 0 * 65536 + 133 |
||
142 | mov ecx, 40 * 65536 + 18 |
||
143 | mov edx, 0x40000002 |
||
144 | int 0x40 |
||
145 | |||
602 | Rus | 146 | shr eax, 1 ; mov eax, 4 |
147 | mov ebx, 36 * 65536 + 7 |
||
148 | mov ecx, [system_colours + 16] ; sc.grab_text |
||
149 | or ecx, 0x10000000 |
||
150 | |||
151 | mov edx, ctx_menu_title |
||
633 | diamond | 152 | |
602 | Rus | 153 | mov esi, ctx_menu_title_end - ctx_menu_title |
154 | int 0x40 |
||
155 | |||
156 | add ebx, 1 * 65536 |
||
157 | int 0x40 |
||
158 | |||
159 | mov ebx, 4 * 65536 + 28 |
||
633 | diamond | 160 | mov ecx, 0x80000000 |
602 | Rus | 161 | mov edx, ctx_menu_text |
633 | diamond | 162 | ; // Alver 26.08.2007 // { |
602 | Rus | 163 | int 0x40 |
633 | diamond | 164 | add bx, 18 |
165 | mov edx, ctx_menu_text2 |
||
166 | ; \begin{diamond}[20.09.2007] |
||
167 | test byte [procinfo_for_detect+70], 2 |
||
168 | jz @f |
||
169 | mov edx, ctx_menu_text3 |
||
170 | @@: |
||
171 | ; \end{diamond}[20.09.2007] |
||
172 | int 0x40 |
||
173 | ; } \\ Alver \\ |
||
602 | Rus | 174 | mov eax, 12 |
175 | mov ebx, ebp ; mov ebx, 2 |
||
176 | int 0x40 |
||
177 | |||
178 | ret |
||
179 | |||
180 | endf |
||
181 | |||
182 | x_coord rw 1 |
||
183 | y_coord rw 1 |
||
184 | n_slot rd 1 |
||
185 | lsz ctx_menu_text,\ |
||
633 | diamond | 186 | ru, <"X Закрыть Alt + F4",0>,\ |
187 | en, <"X Close Alt + F4",0>,\ |
||
188 | et, <"X Sulge Alt + F4",0> ; Now correct |
||
189 | ; // Alver 26.08.2007 // { |
||
190 | lsz ctx_menu_text2,\ |
||
191 | ru, <25," Свернуть ",0>,\ |
||
192 | en, <25," Minimize ",0>,\ |
||
193 | ; } \\ Alver \\ |
||
194 | ; \begin{diamond}[20.09.2007] |
||
195 | lsz ctx_menu_text3,\ |
||
196 | ru, <24," Восстановить ",0>,\ |
||
197 | en, <24," Restore ",0> |
||
198 | ; \end{diamond}[20.09.2007] |
||
602 | Rus | 199 | ctx_menu_PID rd 1 |
200 | |||
201 | ctx_menu_title: |
||
202 | db 'KolibriOS' |
||
870 | barsuk | 203 | ctx_menu_title_end:24,">24,">25,">25,">"X>"X>"X> |