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