Rev 387 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 387 | Rev 415 | ||
---|---|---|---|
Line 456... | Line 456... | ||
456 | 456 | ||
Line 457... | Line 457... | ||
457 | checkbuttons: |
457 | checkbuttons: |
458 | 458 | ||
- | 459 | cmp [BTN_DOWN],byte 0 ; mouse buttons pressed |
|
- | 460 | jnz @f |
|
- | 461 | ;..................................... start 1/5 : modified by vhanla ............................. |
|
459 | cmp [BTN_DOWN],byte 0 ; mouse buttons pressed |
462 | mov [bPressedMouseXY_B],0 |
460 | jnz @f |
463 | ;..................................... end 1/5 : modified by vhanla ............................. |
461 | ret |
- | |
462 | @@: |
464 | ret |
Line 463... | Line 465... | ||
463 | 465 | @@: |
|
464 | pushad |
466 | pushad |
465 | 467 | ||
Line 470... | Line 472... | ||
470 | jne @f |
472 | jne @f |
471 | popad |
473 | popad |
472 | ret |
474 | ret |
Line 473... | Line 475... | ||
473 | 475 | ||
- | 476 | @@: |
|
- | 477 | ;..................................... start 2/5 : modified by vhanla ............................. |
|
- | 478 | ;here i catch the coordinates when the mouse's button is clicked |
|
- | 479 | push ax |
|
- | 480 | cmp [bPressedMouseXY_B],0;FALSE |
|
- | 481 | jnz @f |
|
- | 482 | mov [bPressedMouseXY_B],1;TRUE - it was already clicked |
|
- | 483 | mov ax,[MOUSE_X] |
|
- | 484 | mov [mx],ax |
|
- | 485 | mov ax,[MOUSE_Y] |
|
- | 486 | mov [my],ax |
|
- | 487 | @@: |
|
- | 488 | pop ax |
|
- | 489 | ;and it is only refreshed after the mouse's button release |
|
Line 474... | Line 490... | ||
474 | @@: |
490 | ;..................................... end 2/5 : modified by vhanla ............................. |
475 | 491 | ||
476 | push esi |
492 | push esi |
Line 494... | Line 510... | ||
494 | push edx |
510 | push edx |
495 | mov eax,esi |
511 | mov eax,esi |
496 | shl eax,4 |
512 | shl eax,4 |
497 | add eax,edi |
513 | add eax,edi |
Line 498... | Line -... | ||
498 | - | ||
499 | ;......................start 1/2 : modified by vhanla ............................. |
- | |
500 | mov [buttonid],eax |
- | |
501 | ;......................end 1/2 : modified by vhanla ............................. |
- | |
502 | 514 | ||
Line 503... | Line 515... | ||
503 | ; check that button is at top of windowing stack |
515 | ; check that button is at top of windowing stack |
504 | 516 | ||
505 | movzx ebx,word [eax] |
517 | movzx ebx,word [eax] |
Line 532... | Line 544... | ||
532 | shl ebx,5 |
544 | shl ebx,5 |
533 | add ebx,window_data |
545 | add ebx,window_data |
534 | mov ecx, [ebx+WDATA.box.left] ; window x start |
546 | mov ecx, [ebx+WDATA.box.left] ; window x start |
535 | movzx edx,word [eax+4] ; button x start |
547 | movzx edx,word [eax+4] ; button x start |
536 | add edx,ecx |
548 | add edx,ecx |
- | 549 | ;..................................... start 3/5 : modified by vhanla ............................. |
|
537 | mov cx,[MOUSE_X] |
550 | mov cx,[mx] ;mov cx,[MOUSE_X] |
- | 551 | ;..................................... end 3/5 : modified by vhanla ............................. |
|
538 | cmp edx,ecx |
552 | cmp edx,ecx |
539 | jg buttonnewcheck |
553 | jg buttonnewcheck |
Line 540... | Line 554... | ||
540 | 554 | ||
541 | movzx ebx,word [eax+6] ; button x size |
555 | movzx ebx,word [eax+6] ; button x size |
Line 548... | Line 562... | ||
548 | shl ebx,5 |
562 | shl ebx,5 |
549 | add ebx,window_data |
563 | add ebx,window_data |
550 | mov ecx, [ebx+WDATA.box.top] ; window y start |
564 | mov ecx, [ebx+WDATA.box.top] ; window y start |
551 | movzx edx,word [eax+8] ; button y start |
565 | movzx edx,word [eax+8] ; button y start |
552 | add edx,ecx |
566 | add edx,ecx |
- | 567 | ;..................................... start 4/5 : modified by vhanla ............................. |
|
553 | mov cx,[MOUSE_Y] |
568 | mov cx,[my] ;mov cx,[MOUSE_Y] |
- | 569 | ;..................................... start 4/5 : modified by vhanla ............................. |
|
554 | cmp edx,ecx |
570 | cmp edx,ecx |
555 | jg buttonnewcheck |
571 | jg buttonnewcheck |
Line 556... | Line 572... | ||
556 | 572 | ||
557 | movzx ebx,word [eax+10] ; button y size |
573 | movzx ebx,word [eax+10] ; button y size |
Line 589... | Line 605... | ||
589 | popad |
605 | popad |
Line 590... | Line 606... | ||
590 | 606 | ||
591 | call negativebutton |
607 | call negativebutton |
592 | mov [MOUSE_BACKGROUND],byte 0 ; no mouse background |
608 | mov [MOUSE_BACKGROUND],byte 0 ; no mouse background |
593 | mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse |
609 | mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse |
594 | ;..................................... start 2/2 : modified by vhanla ............................. |
610 | ;..................................... start 5/5 : modified by vhanla ............................. |
595 | ; check coordinates |
611 | ; check coordinates |
- | 612 | jmp @f |
|
596 | jmp afterbuttonid |
613 | mx dw 0x0 ; keeps the x mouse's position when it was clicked |
597 | buttonid dd 0x0 ;here a will backup the eax value |
614 | my dw 0x0 ; keeps the y mouse's position when it was clicked |
- | 615 | bPressedMouseXY_B db 0x0 |
|
Line 598... | Line 616... | ||
598 | afterbuttonid: |
616 | @@: |
599 | 617 | ||
600 | pusha |
618 | pusha |
601 | ; mouse x >= button x ? |
619 | ; mouse x >= button x ? |
Line 643... | Line 661... | ||
643 | popa |
661 | popa |
644 | pop ebx |
662 | pop ebx |
645 | popa |
663 | popa |
646 | ret |
664 | ret |
Line 647... | Line 665... | ||
647 | 665 |