Subversion Repositories Kolibri OS

Rev

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

Rev 380 Rev 381
Line 235... Line 235...
235
 
235
 
Line 236... Line 236...
236
      button_no_draw:
236
      button_no_draw:
Line 237... Line 237...
237
 
237
 
238
        and   ecx,0xffff
238
        and   ecx,0xffff
239
 
239
 
240
        mov   edi,[0xfe88]
240
        mov   edi,[BTN_ADDR]
241
        movzx eax,word [edi]
241
        movzx eax,word [edi]
242
        cmp   eax,max_buttons
242
        cmp   eax,max_buttons
Line 284... Line 284...
284
 
284
 
Line 285... Line 285...
285
    and  ecx,0x7fffffff
285
    and  ecx,0x7fffffff
Line 286... Line 286...
286
 
286
 
287
  rnewba2:
287
  rnewba2:
288
 
288
 
289
    mov   edi,[0xfe88]
289
    mov   edi,[BTN_ADDR]
Line 290... Line 290...
290
    mov   eax,edi
290
    mov   eax,edi
Line 454... Line 454...
454
; first at 0x10
454
; first at 0x10
Line 455... Line 455...
455
 
455
 
Line 456... Line 456...
456
 
456
 
457
checkbuttons:
457
checkbuttons:
458
 
458
 
459
    cmp   [0xfb40],byte 0    ; mouse buttons pressed
459
    cmp   [BTN_DOWN],byte 0    ; mouse buttons pressed
Line 460... Line 460...
460
    jnz   @f
460
    jnz   @f
Line 461... Line 461...
461
    ret
461
    ret
462
  @@:
462
  @@:
463
 
463
 
464
    pushad
464
    pushad
465
 
465
 
466
    xor    esi, esi
466
    xor    esi, esi
467
    mov    edi, [0xfe88]
467
    mov    edi, [BTN_ADDR]
Line 532... Line 532...
532
    shl   ebx,5
532
    shl   ebx,5
533
    add   ebx,window_data
533
    add   ebx,window_data
534
	mov   ecx, [ebx+WDATA.box.left]     ; window x start
534
	mov   ecx, [ebx+WDATA.box.left]     ; window x start
535
    movzx edx,word [eax+4]     ; button x start
535
    movzx edx,word [eax+4]     ; button x start
536
    add   edx,ecx
536
    add   edx,ecx
537
    mov   cx,[0xfb0a]
537
    mov   cx,[MOUSE_X]
538
    cmp   edx,ecx
538
    cmp   edx,ecx
539
    jg    buttonnewcheck
539
    jg    buttonnewcheck
Line 540... Line 540...
540
 
540
 
541
    movzx ebx,word [eax+6]     ; button x size
541
    movzx ebx,word [eax+6]     ; button x size
Line 548... Line 548...
548
    shl   ebx,5
548
    shl   ebx,5
549
    add   ebx,window_data
549
    add   ebx,window_data
550
	mov   ecx, [ebx+WDATA.box.top]     ; window y start
550
	mov   ecx, [ebx+WDATA.box.top]     ; window y start
551
    movzx edx,word [eax+8]     ; button y start
551
    movzx edx,word [eax+8]     ; button y start
552
    add   edx,ecx
552
    add   edx,ecx
553
    mov   cx,[0xfb0c]
553
    mov   cx,[MOUSE_Y]
554
    cmp   edx,ecx
554
    cmp   edx,ecx
555
    jg    buttonnewcheck
555
    jg    buttonnewcheck
Line 556... Line 556...
556
 
556
 
557
    movzx ebx,word [eax+10]    ; button y size
557
    movzx ebx,word [eax+10]    ; button y size
Line 567... Line 567...
567
    mov   bx,[eax+0xc]     ; button id : bits 16-31
567
    mov   bx,[eax+0xc]     ; button id : bits 16-31
568
    shl   ebx,16
568
    shl   ebx,16
569
    mov   bx,[eax+2]       ; button id : bits 00-16
569
    mov   bx,[eax+2]       ; button id : bits 00-16
570
    push  ebx
570
    push  ebx
Line 571... Line 571...
571
 
571
 
572
    mov   [0xfb44],byte 1  ; no mouse down checks
572
    mov   [MOUSE_DOWN],byte 1  ; no mouse down checks
573
    call find_pressed_button_frames
573
    call find_pressed_button_frames
Line 574... Line 574...
574
    call negativebutton
574
    call negativebutton
575
 
575
 
Line 582... Line 582...
582
 
582
 
583
    pushad
583
    pushad
584
    call  stack_handler
584
    call  stack_handler
Line 585... Line 585...
585
    popad
585
    popad
586
 
586
 
587
    cmp   [0xfb40],byte 0  ; mouse buttons pressed ?
587
    cmp   [BTN_DOWN],byte 0  ; mouse buttons pressed ?
Line 588... Line 588...
588
    jnz   cbwaitmouseup
588
    jnz   cbwaitmouseup
589
    popad
589
    popad
590
 
590
 
591
    call  negativebutton
591
    call  negativebutton
592
    mov   [0xfff4],byte 0  ; no mouse background
592
    mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
593
    mov   [0xfff5],byte 0  ; draw mouse
593
    mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
594
;..................................... start 2/2 : modified by vhanla .............................
594
;..................................... start 2/2 : modified by vhanla .............................
595
    ; check coordinates
595
    ; check coordinates
Line 603... Line 603...
603
   shl   ebx,5
603
   shl   ebx,5
604
   add   ebx,window_data
604
   add   ebx,window_data
605
   mov   ecx, [ebx+WDATA.box.left]    ; window x start
605
   mov   ecx, [ebx+WDATA.box.left]    ; window x start
606
   movzx edx,word [eax+4]    ; button x start
606
   movzx edx,word [eax+4]    ; button x start
607
   add   edx,ecx
607
   add   edx,ecx
608
   mov   cx,[0xfb0a]
608
   mov   cx,[MOUSE_X]
609
   cmp   edx,ecx
609
   cmp   edx,ecx
610
   jg   no_on_button ;if we release the pointer out of the button area
610
   jg   no_on_button ;if we release the pointer out of the button area
Line 611... Line 611...
611
 
611
 
612
   movzx ebx,word [eax+6]    ; button x size
612
   movzx ebx,word [eax+6]    ; button x size
Line 619... Line 619...
619
   shl   ebx,5
619
   shl   ebx,5
620
   add   ebx,window_data
620
   add   ebx,window_data
621
   mov   ecx, [ebx+WDATA.box.top]    ; window y start
621
   mov   ecx, [ebx+WDATA.box.top]    ; window y start
622
   movzx edx,word [eax+8]    ; button y start
622
   movzx edx,word [eax+8]    ; button y start
623
   add   edx,ecx
623
   add   edx,ecx
624
   mov   cx,[0xfb0c]
624
   mov   cx,[MOUSE_Y]
625
   cmp   edx,ecx
625
   cmp   edx,ecx
626
   jg   no_on_button
626
   jg   no_on_button
Line 627... Line 627...
627
 
627
 
628
   movzx ebx,word [eax+10]   ; button y size
628
   movzx ebx,word [eax+10]   ; button y size
629
   add   edx,ebx
629
   add   edx,ebx
630
   cmp   ecx,edx
630
   cmp   ecx,edx
631
   jg   no_on_button
631
   jg   no_on_button
632
   popa
632
   popa
633
   mov   [0xf500],byte 1 ; no of buttons in buffer
633
   mov   [BTN_COUNT],byte 1 ; no of buttons in buffer
634
   pop   ebx
634
   pop   ebx
635
   mov   [0xf501],ebx   ; lets put the button id in buffer
635
   mov   [BTN_BUFF],ebx   ; lets put the button id in buffer
636
   push  ebx
636
   push  ebx
637
   pusha
637
   pusha
638
   jmp yes_on_button
638
   jmp yes_on_button
639
no_on_button:
639
no_on_button:
640
   mov   [0xf500],byte 0 ; no of buttons in buffer
640
   mov   [BTN_COUNT],byte 0 ; no of buttons in buffer
641
yes_on_button:
641
yes_on_button:
642
   mov   [0xfb44],byte 0 ; mouse down -> do not draw
642
   mov   [MOUSE_DOWN],byte 0 ; mouse down -> do not draw
643
   popa
643
   popa
644
   pop ebx
644
   pop ebx
645
   popa
645
   popa