Subversion Repositories Kolibri OS

Rev

Rev 593 | Rev 803 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 593 Rev 684
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 593 $
8
$Revision: 684 $
9
 
9
 
10
 
10
 
Line 74... Line 74...
74
	push  eax
74
	push  eax
75
	push  ebx
75
	push  ebx
76
	push  ecx
76
	push  ecx
77
	push  edx
77
	push  edx
Line 78... Line -...
78
 
-
 
79
	shr   eax,16
78
 
-
 
79
	shr   ebx,16
80
	shr   ebx,16
80
	shr   ecx,16
Line 81... Line 81...
81
	mov   edx,[TASK_BASE]
81
	mov   eax,[TASK_BASE]
82
 
82
 
83
		add   eax,[edx-twdw + WDATA.box.left]
-
 
84
		add   ebx,[edx-twdw + WDATA.box.top]
83
	add   ebx,[eax-twdw + WDATA.box.left]
85
	mov   cx,ax
84
	add   ecx,[eax-twdw + WDATA.box.top]
-
 
85
	mov     eax, ebx
-
 
86
	shl     eax, 16
-
 
87
	mov     ax, bx
86
	mov   dx,bx
88
	add     ax, word [esp+8]
87
	shl   eax,16
-
 
88
	shl   ebx,16
89
	mov     ebx, ecx
89
	mov   ax,cx
-
 
90
	mov   bx,dx
90
	shl     ebx, 16
91
	add   ax,word [esp+12]
91
	mov     bx, cx
92
	mov   esi,ebx
92
	push    ebx
93
	mov   edi,0
93
	xor     edi, edi
94
	mov   ecx,[esp+0]
94
	mov     ecx, esi
Line 95... Line 95...
95
	call  incecx
95
	call    incecx
96
	call  [draw_line]
96
	call    [draw_line]
97
 
97
 
98
	movzx edx,word [esp+8]
98
	movzx edx,word [esp+4+4]
99
	add   ebx,edx
99
	add   ebx,edx
100
	shl   edx,16
100
	shl   edx,16
101
	add   ebx,edx
101
	add   ebx,edx
Line 102... Line 102...
102
	mov   ecx,[esp+0]
102
	mov   ecx,esi
103
	call  dececx
103
	call  dececx
104
	call  [draw_line]
104
	call  [draw_line]
105
 
105
 
106
	mov   ebx,esi
106
	pop     ebx
107
	push  edx
107
	push  edx
108
	mov   edx,eax
108
	mov   edx,eax
109
	shr   edx,16
109
	shr   edx,16
110
	mov   ax,dx
110
	mov   ax,dx
111
	mov   edx,ebx
111
	mov   edx,ebx
112
	shr   edx,16
112
	shr   edx,16
113
	mov   bx,dx
-
 
114
	mov   dx,[esp+8+4]
113
	mov   bx,dx
115
	add   bx,dx
114
	mov   dx,[esp+4+4]
116
	pop   edx
115
	add   bx,dx
Line 117... Line -...
117
	mov   edi,0
-
 
118
	mov   ecx,[esp+0]
116
	pop   edx
119
	call  incecx
117
	mov   ecx,esi
120
	call  [draw_line]
118
	call  incecx
121
 
119
	call  [draw_line]
122
	mov   esi,edx
120
 
123
	mov   dx,[esp+12]
121
	mov   dx,[esp+8]
124
	add   ax,dx
-
 
125
	shl   edx,16
122
	add   ax,dx
126
	add   eax,edx
123
	shl   edx,16
Line 127... Line 124...
127
	add   ebx,1*65536
124
	add   eax,edx
128
	mov   edx,esi
125
	add   ebx,1*65536
Line 171... Line 168...
171
	ret
168
	ret
Line 172... Line 169...
172
 
169
 
Line 173... Line -...
173
 
-
 
174
sys_button:
170
 
175
 
-
 
176
	push	edi
-
 
177
        mov     edi,[current_slot]
-
 
178
	rol	eax,16
171
sys_button:
179
        add     ax,word[edi+APPDATA.wnd_clientbox.left]
172
 
180
	rol	eax,16
173
        mov     eax, [current_slot]
-
 
174
        rol     ebx, 16
-
 
175
        add     bx, word [eax+APPDATA.wnd_clientbox.left]
181
	rol	ebx,16
176
        rol     ebx, 16
182
        add     bx,word[edi+APPDATA.wnd_clientbox.top]
177
        rol     ecx, 16
Line 183... Line 178...
183
	rol	ebx,16
178
        add     cx, word [eax+APPDATA.wnd_clientbox.top]
184
	pop	edi
179
        rol     ecx, 16
Line 185... Line -...
185
.forced:
-
 
186
 
-
 
187
	test  ecx,0x80000000
-
 
188
	jnz   remove_button
-
 
189
 
-
 
190
	push  esi
-
 
191
	push  edi
-
 
192
	push  eax ; 
-
 
193
	push  ebx ; 
-
 
194
	push  ecx ; 
180
.forced:
195
	push  edx
181
 
-
 
182
        test    edx, 0x80000000
-
 
183
        jnz     remove_button
Line 196... Line 184...
196
 
184
 
197
	or    ax,ax
185
        or      bx, bx
Line 198... Line 186...
198
	jle   noaddbutt
186
        jle     noaddbutt
199
	or    bx,bx
-
 
200
	jle   noaddbutt
187
        or      cx, cx
201
 
188
        jle     noaddbutt
-
 
189
 
202
	test  ecx,0x40000000
190
        test    edx, 0x40000000
203
	jnz   button_no_draw
191
        jnz     button_no_draw
204
 
192
 
205
	pushad			     ; button body
-
 
206
	push  ebx
-
 
207
	shr   eax,16
-
 
208
	shr   ebx,16
193
        pushad			     ; button body
209
	mov   edx,[TASK_BASE]
194
        movzx   edi, cx
-
 
195
        shr     ebx, 16
-
 
196
        shr     ecx, 16
-
 
197
        mov     eax, [TASK_BASE]
210
	mov   esi,[edx-twdw + WDATA.box.left]
198
        add     ebx, [eax-twdw + WDATA.box.left]
211
	mov   edi,[edx-twdw + WDATA.box.top]
-
 
212
	add   eax,esi
199
        add     ecx, [eax-twdw + WDATA.box.top]
213
	add   ebx,edi
-
 
214
	mov   cx,ax
-
 
215
	mov   dx,bx
200
        mov     eax, ebx
216
	shl   eax,16
201
        shl     eax, 16
217
	shl   ebx,16
202
        mov     ax, bx
218
	mov   ax,cx
203
        add     ax, word [esp+16]
219
	mov   bx,dx
204
        mov     ebx, ecx
220
	movzx ecx,word [4+32+esp+12]
-
 
221
	add   eax,ecx
-
 
222
	mov   ecx,[4+32+esp+0]
-
 
223
	cmp   [buttontype],dword 0
205
        shl     ebx, 16
Line 224... Line 206...
224
	je    @f
206
        mov     bx, cx
225
	call  incecx2
207
        mov     ecx, esi
226
       @@:
208
        cmp     [buttontype], 0
227
	movzx edi,word [esp]
209
        je      @f
Line 242... Line 224...
242
 
224
 
Line 243... Line 225...
243
	call  drawbuttonframes
225
        call    drawbuttonframes
Line 244... Line 226...
244
 
226
 
245
button_no_draw:
-
 
246
 
227
button_no_draw:
247
	and   ecx,0xffff
228
 
248
 
229
        push    edi
249
	mov   edi,[BTN_ADDR]
230
        mov     edi, [BTN_ADDR]
250
	movzx eax,word [edi]
231
        movzx   eax, word [edi]
251
	cmp   eax,max_buttons
232
        cmp     eax, max_buttons
Line 252... Line 233...
252
	jge   noaddbutt
233
        jge     noaddbutt
253
	inc   eax
234
        inc     eax
Line 254... Line 235...
254
	mov   [edi],ax
235
        mov     [edi], ax
-
 
236
 
-
 
237
        shl     eax, 4
-
 
238
        add     edi, eax
255
 
239
 
-
 
240
        mov     ax, [CURRENT_TASK]
-
 
241
        stosw
-
 
242
        mov     ax, dx
-
 
243
        stosw               ; button id number: bits 0-15
-
 
244
        mov     eax, ebx
-
 
245
        rol     eax, 16
-
 
246
        stosd               ; x start | x size
-
 
247
        mov     eax, ecx
Line 256... Line -...
256
	shl   eax,4
-
 
257
	add   eax,edi
-
 
258
 
-
 
259
	mov   bx,[CURRENT_TASK]
-
 
260
	mov   [eax],bx
-
 
261
 
-
 
262
	add   eax,2	    ; save button id number
-
 
263
	mov   ebx,[esp+4]
-
 
264
	mov   [eax],bx	    ; bits 0-15
248
        rol     eax, 16
265
	shr   ebx,16
-
 
266
	mov   [eax-2+0xc],bx; bits 16-31
-
 
267
	add   eax,2	    ; x start
-
 
268
	mov   bx,[esp+12+2]
-
 
269
	mov   [eax],bx
-
 
270
	add   eax,2	    ; x size
-
 
271
	mov   bx,[esp+12+0]
-
 
272
	mov   [eax],bx
-
 
Line 273... Line 249...
273
	add   eax,2	    ; y start
249
        stosd               ; y start | y size
Line 274... Line -...
274
	mov   bx,[esp+8+2]
-
 
275
	mov   [eax],bx
-
 
276
	add   eax,2	    ; y size
-
 
277
	mov   bx,[esp+8+0]
-
 
278
	mov   [eax],bx
-
 
279
 
-
 
280
noaddbutt:
-
 
281
 
250
        mov     eax, edx
Line 282... Line 251...
282
	pop   edx
251
        shr     eax, 16
Line 283... Line 252...
283
	pop   ecx
252
        stosw               ; button id number: bits 16-31
Line 284... Line 253...
284
	pop   ebx
253
 
Line 285... Line 254...
285
	pop   eax
254
        pop     edi
286
	pop   edi
255
 
287
	pop   esi
256
noaddbutt:
288
 
257
 
Line 289... Line 258...
289
	ret
258
        ret
Line 290... Line 259...
290
 
259
 
291
 
260
 
Line 292... Line 261...
292
remove_button:
261
remove_button:
Line 293... Line 262...
293
 
262
 
294
    and  ecx,0x7fffffff
263
        and     edx, 0x7fffffff
295
 
264
 
296
rnewba2:
-
 
297
 
265
rnewba2:
298
    mov   edi,[BTN_ADDR]
266
 
Line 299... Line -...
299
    mov   eax,edi
-
 
300
    movzx ebx,word [edi]
267
        mov     edi, [BTN_ADDR]
301
    inc   bx
-
 
302
 
268
        mov     eax, edi
303
rnewba:
269
        movzx   ebx, word [edi]
304
 
270
        inc     ebx
305
    dec   bx
271
 
306
    jz	  rnmba
272
rnewba:
307
 
-
 
308
    add   eax,0x10
-
 
309
 
273
 
Line 310... Line 274...
310
    mov   dx,[CURRENT_TASK]
274
        dec     ebx
Line 311... Line 275...
311
    cmp   dx,[eax]
275
        jz      rnmba
Line 616... Line 580...
616
    call  negativebutton
580
    call  negativebutton
617
    mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
581
    mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
618
    mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
582
    mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
619
;..................................... start 5/5 : modified by vhanla .............................
583
;..................................... start 5/5 : modified by vhanla .............................
620
    ; check coordinates
584
    ; check coordinates
621
    jmp @f
585
iglobal
622
    mx dw 0x0 ; keeps the x mouse's position when it was clicked
586
    mx dw 0x0 ; keeps the x mouse's position when it was clicked
623
    my dw 0x0 ; keeps the y mouse's position when it was clicked
587
    my dw 0x0 ; keeps the y mouse's position when it was clicked
624
    bPressedMouseXY_B db 0x0
588
    bPressedMouseXY_B db 0x0
625
    @@:
589
endg
Line 626... Line 590...
626
 
590
 
627
   pusha
591
   pusha
628
  ; mouse x >= button x ?
592
  ; mouse x >= button x ?
629
   movzx ebx,word [eax+0]
593
   movzx ebx,word [eax+0]