Subversion Repositories Kolibri OS

Rev

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

Rev 129 Rev 384
Line 66... Line 66...
66
        push  ecx
66
        push  ecx
67
        push  edx
67
        push  edx
Line 68... Line 68...
68
 
68
 
69
        shr   eax,16
69
        shr   eax,16
70
        shr   ebx,16
70
        shr   ebx,16
Line 71... Line 71...
71
        mov   edx,[0x3010]
71
        mov   edx,[TASK_BASE]
72
 
72
 
73
		add   eax,[edx-twdw + WDATA.box.left]
73
		add   eax,[edx-twdw + WDATA.box.left]
74
		add   ebx,[edx-twdw + WDATA.box.top]
74
		add   ebx,[edx-twdw + WDATA.box.top]
Line 162... Line 162...
162
 
162
 
Line 163... Line 163...
163
 
163
 
164
sys_button:
164
sys_button:
165
 
165
 
166
        push    edi
166
        push    edi
167
        mov     edi,[0x3000]
167
        mov     edi,[CURRENT_TASK]
168
        shl     edi,8
168
        shl     edi,8
169
        rol     eax,16
169
        rol     eax,16
170
        add     ax,word[edi+0x80000+APPDATA.wnd_clientbox.left]
170
        add     ax,word[edi+SLOT_BASE+APPDATA.wnd_clientbox.left]
171
        rol     eax,16
171
        rol     eax,16
172
        rol     ebx,16
172
        rol     ebx,16
173
        add     bx,word[edi+0x80000+APPDATA.wnd_clientbox.top]
173
        add     bx,word[edi+SLOT_BASE+APPDATA.wnd_clientbox.top]
Line 174... Line 174...
174
        rol     ebx,16
174
        rol     ebx,16
Line 195... Line 195...
195
 
195
 
196
        pushad                       ; button body
196
        pushad                       ; button body
197
        push  ebx
197
        push  ebx
198
        sar   eax,16
198
        sar   eax,16
199
        sar   ebx,16
199
        sar   ebx,16
200
        mov   edx,[0x3010]
200
        mov   edx,[TASK_BASE]
201
		mov   esi,[edx-twdw + WDATA.box.left]
201
        mov   esi,[edx-twdw + WDATA.box.left]
202
		mov   edi,[edx-twdw + WDATA.box.top]
202
        mov   edi,[edx-twdw + WDATA.box.top]
203
        add   eax,esi
203
        add   eax,esi
204
        add   ebx,edi
204
        add   ebx,edi
Line 236... Line 236...
236
 
236
 
Line 237... Line 237...
237
      button_no_draw:
237
      button_no_draw:
Line 238... Line 238...
238
 
238
 
239
        and   ecx,0xffff
239
        and   ecx,0xffff
240
 
240
 
241
        mov   edi,[0xfe88]
241
        mov   edi,[BTN_ADDR]
242
        movzx eax,word [edi]
242
        movzx eax,word [edi]
243
        cmp   eax,max_buttons
243
        cmp   eax,max_buttons
Line 244... Line 244...
244
        jge   noaddbutt
244
        jge   noaddbutt
245
        inc   eax
245
        inc   eax
Line 246... Line 246...
246
        mov   [edi],ax
246
        mov   [edi],ax
247
 
247
 
Line 248... Line 248...
248
        shl   eax,4
248
        shl   eax,4
249
        add   eax,edi
249
        add   eax,edi
250
 
250
 
Line 285... Line 285...
285
 
285
 
Line 286... Line 286...
286
    and  ecx,0x7fffffff
286
    and  ecx,0x7fffffff
Line 287... Line 287...
287
 
287
 
288
  rnewba2:
288
  rnewba2:
289
 
289
 
290
    mov   edi,[0xfe88]
290
    mov   edi,[BTN_ADDR]
Line 291... Line 291...
291
    mov   eax,edi
291
    mov   eax,edi
Line 297... Line 297...
297
    dec   bx
297
    dec   bx
298
    jz    rnmba
298
    jz    rnmba
Line 299... Line 299...
299
 
299
 
Line 300... Line 300...
300
    add   eax,0x10
300
    add   eax,0x10
301
 
301
 
302
    mov   dx,[0x3000]
302
    mov   dx,[CURRENT_TASK]
Line 303... Line 303...
303
    cmp   dx,[eax]
303
    cmp   dx,[eax]
304
    jnz   rnewba
304
    jnz   rnewba
Line 455... Line 455...
455
; first at 0x10
455
; first at 0x10
Line 456... Line 456...
456
 
456
 
Line 457... Line 457...
457
 
457
 
458
checkbuttons:
458
checkbuttons:
459
 
459
 
460
    cmp   [0xfb40],byte 0    ; mouse buttons pressed
460
    cmp   [BTN_DOWN],byte 0    ; mouse buttons pressed
Line 461... Line 461...
461
    jnz   @f
461
    jnz   @f
Line 462... Line 462...
462
    ret
462
    ret
463
  @@:
463
  @@:
464
 
464
 
465
    pushad
465
    pushad
466
 
466
 
467
    xor    esi, esi
467
    xor    esi, esi
468
    mov    edi, [0xfe88]
468
    mov    edi, [BTN_ADDR]
Line 502... Line 502...
502
;......................end   1/2 : modified by vhanla .............................
502
;......................end   1/2 : modified by vhanla .............................
Line 503... Line 503...
503
 
503
 
Line 504... Line 504...
504
    ; check that button is at top of windowing stack
504
    ; check that button is at top of windowing stack
505
 
505
 
506
    movzx ebx,word [eax]
506
    movzx ebx,word [eax]
507
    movzx ecx,word [0xC000 + ebx * 2]
507
    movzx ecx,word [WIN_STACK + ebx * 2]
Line 508... Line 508...
508
    cmp   ecx,[0x3004]
508
    cmp   ecx,[TASK_COUNT]
Line 509... Line 509...
509
    jne   buttonnewcheck
509
    jne   buttonnewcheck
Line 568... Line 568...
568
    mov   bx,[eax+0xc]     ; button id : bits 16-31
568
    mov   bx,[eax+0xc]     ; button id : bits 16-31
569
    shl   ebx,16
569
    shl   ebx,16
570
    mov   bx,[eax+2]       ; button id : bits 00-16
570
    mov   bx,[eax+2]       ; button id : bits 00-16
571
    push  ebx
571
    push  ebx
Line 572... Line 572...
572
 
572
 
573
    mov   [0xfb44],byte 1  ; no mouse down checks
573
    mov   [MOUSE_DOWN],byte 1  ; no mouse down checks
574
    call find_pressed_button_frames
574
    call find_pressed_button_frames
Line 575... Line 575...
575
    call negativebutton
575
    call negativebutton
576
 
576
 
Line 583... Line 583...
583
 
583
 
584
    pushad
584
    pushad
585
    call  stack_handler
585
    call  stack_handler
Line 586... Line 586...
586
    popad
586
    popad
587
 
587
 
588
    cmp   [0xfb40],byte 0  ; mouse buttons pressed ?
588
    cmp   [BTN_DOWN],byte 0  ; mouse buttons pressed ?
Line 589... Line 589...
589
    jnz   cbwaitmouseup
589
    jnz   cbwaitmouseup
590
    popad
590
    popad
591
 
591
 
592
    call  negativebutton
592
    call  negativebutton
593
    mov   [0xfff4],byte 0  ; no mouse background
593
    mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
594
    mov   [0xfff5],byte 0  ; draw mouse
594
    mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
595
;..................................... start 2/2 : modified by vhanla .............................
595
;..................................... start 2/2 : modified by vhanla .............................
596
    ; check coordinates
596
    ; check coordinates
Line 629... Line 629...
629
   movzx ebx,word [eax+10]   ; button y size
629
   movzx ebx,word [eax+10]   ; button y size
630
   add   edx,ebx
630
   add   edx,ebx
631
   cmp   ecx,edx
631
   cmp   ecx,edx
632
   jg   no_on_button
632
   jg   no_on_button
633
   popa
633
   popa
634
   mov   [0xf500],byte 1 ; no of buttons in buffer
634
   mov   [BTN_COUNT],byte 1 ; no of buttons in buffer
635
   pop   ebx
635
   pop   ebx
636
   mov   [0xf501],ebx   ; lets put the button id in buffer
636
   mov   [BTN_BUFF],ebx   ; lets put the button id in buffer
637
   push  ebx
637
   push  ebx
638
   pusha
638
   pusha
639
   jmp yes_on_button
639
   jmp yes_on_button
640
no_on_button:
640
no_on_button:
641
   mov   [0xf500],byte 0 ; no of buttons in buffer
641
   mov   [BTN_COUNT],byte 0 ; no of buttons in buffer
642
yes_on_button:
642
yes_on_button:
643
   mov   [0xfb44],byte 0 ; mouse down -> do not draw
643
   mov   [MOUSE_DOWN],byte 0 ; mouse down -> do not draw
644
   popa
644
   popa
645
   pop ebx
645
   pop ebx
646
   popa
646
   popa
647
   ret
647
   ret