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