Subversion Repositories Kolibri OS

Rev

Rev 870 | 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
 
2195 leency 115
    mcall 12, 1
602 Rus 116
 
117
    xor        eax, eax 	; mov        eax, 0
118
    movzx      ebx, [x_coord]
119
    shl        ebx, 16
120
    add        ebx, 133
121
    movzx      ecx, [y_coord]
633 diamond 122
    sub        ecx, 60         ; 41
602 Rus 123
    shl        ecx, 16
633 diamond 124
    add        ecx, 60         ; 41
602 Rus 125
    mov        edx, [system_colours + 20]    ; sc.work
126
    mov        esi, [system_colours + 4]     ; sc.grab
127
    or	       esi, 0x81000000
128
    mov        edi, [system_colours]	     ; sc.frame
129
    int        0x40
130
 
131
    mov        eax, 8
132
    mov        ebx, 0 * 65536 + 133
2195 leency 133
    mov        ecx, 22 * 65536 + 17
602 Rus 134
    mov        edx, 0x40000001
135
    int        0x40
136
 
2195 leency 137
    ;mov        eax, 8
138
    ;mov        ebx, 0 * 65536 + 133
139
    ;mov        ecx, 40 * 65536 + 17
140
    ;mov        edx, 0x40000002
141
    ;int        0x40
142
	mov        ecx, 40 * 65536 + 17
143
	inc        edx
633 diamond 144
    int        0x40
2195 leency 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
2195 leency 162
 
602 Rus 163
    int        0x40
633 diamond 164
    add        bx, 18
165
    mov        edx, ctx_menu_text2
2195 leency 166
 
633 diamond 167
    test       byte [procinfo_for_detect+70], 2
168
    jz         @f
169
    mov        edx, ctx_menu_text3
170
@@:
2195 leency 171
 
633 diamond 172
    int        0x40
602 Rus 173
 
2195 leency 174
    mcall 12, 2
175
 
602 Rus 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>,\
2195 leency 186
 
633 diamond 187
lsz ctx_menu_text2,\
188
  ru, <25," Свернуть           ",0>,\
189
  en, <25," Minimize           ",0>,\
2195 leency 190
 
633 diamond 191
lsz ctx_menu_text3,\
192
  ru, <24," Восстановить       ",0>,\
193
  en, <24," Restore            ",0>
2195 leency 194
 
602 Rus 195
ctx_menu_PID	rd	1
196
 
197
ctx_menu_title:
198
	db	'KolibriOS'
870 barsuk 199
ctx_menu_title_end: