458,11 → 458,9 |
|
cmp [BTN_DOWN],byte 0 ; mouse buttons pressed |
jnz @f |
;..................................... start 1/5 : modified by vhanla ............................. |
mov [bPressedMouseXY_B],0 |
;..................................... end 1/5 : modified by vhanla ............................. |
ret |
@@: |
|
pushad |
|
xor esi, esi |
474,20 → 472,6 |
ret |
|
@@: |
;..................................... start 2/5 : modified by vhanla ............................. |
;here i catch the coordinates when the mouse's button is clicked |
push ax |
cmp [bPressedMouseXY_B],0;FALSE |
jnz @f |
mov [bPressedMouseXY_B],1;TRUE - it was already clicked |
mov ax,[MOUSE_X] |
mov [mx],ax |
mov ax,[MOUSE_Y] |
mov [my],ax |
@@: |
pop ax |
;and it is only refreshed after the mouse's button release |
;..................................... end 2/5 : modified by vhanla ............................. |
|
push esi |
inc edx |
512,6 → 496,10 |
shl eax,4 |
add eax,edi |
|
;......................start 1/2 : modified by vhanla ............................. |
mov [buttonid],eax |
;......................end 1/2 : modified by vhanla ............................. |
|
; check that button is at top of windowing stack |
|
movzx ebx,word [eax] |
546,9 → 534,7 |
mov ecx, [ebx+WDATA.box.left] ; window x start |
movzx edx,word [eax+4] ; button x start |
add edx,ecx |
;..................................... start 3/5 : modified by vhanla ............................. |
mov cx,[mx] ;mov cx,[MOUSE_X] |
;..................................... end 3/5 : modified by vhanla ............................. |
mov cx,[MOUSE_X] |
cmp edx,ecx |
jg buttonnewcheck |
|
564,9 → 550,7 |
mov ecx, [ebx+WDATA.box.top] ; window y start |
movzx edx,word [eax+8] ; button y start |
add edx,ecx |
;..................................... start 4/5 : modified by vhanla ............................. |
mov cx,[my] ;mov cx,[MOUSE_Y] |
;..................................... start 4/5 : modified by vhanla ............................. |
mov cx,[MOUSE_Y] |
cmp edx,ecx |
jg buttonnewcheck |
|
607,13 → 591,11 |
call negativebutton |
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background |
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse |
;..................................... start 5/5 : modified by vhanla ............................. |
;..................................... start 2/2 : modified by vhanla ............................. |
; check coordinates |
jmp @f |
mx dw 0x0 ; keeps the x mouse's position when it was clicked |
my dw 0x0 ; keeps the y mouse's position when it was clicked |
bPressedMouseXY_B db 0x0 |
@@: |
jmp afterbuttonid |
buttonid dd 0x0 ;here a will backup the eax value |
afterbuttonid: |
|
pusha |
; mouse x >= button x ? |
663,4 → 645,4 |
popa |
ret |
|
;..................................... end 5/5 : modified by vhanla ................................ |
;..................................... end 2/2 : modified by vhanla ................................ |