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