Rev 1341 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1341 | Rev 1362 | ||
---|---|---|---|
Line 4... | Line 4... | ||
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 | ;; ;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 8... | Line 8... | ||
8 | 8 | ||
Line 9... | Line 9... | ||
9 | $Revision: 1341 $ |
9 | $Revision: 1362 $ |
Line 40... | Line 40... | ||
40 | 40 | ||
41 | align 4 |
41 | align 4 |
42 | ;------------------------------------------------------------------------------ |
42 | ;------------------------------------------------------------------------------ |
43 | syscall_button: ;///// system function 8 ////////////////////////////////////// |
43 | syscall_button: ;///// system function 8 ////////////////////////////////////// |
44 | ;------------------------------------------------------------------------------ |
44 | ;------------------------------------------------------------------------------ |
45 | ; Define/undefine GUI button object |
45 | ;? Define/undefine GUI button object |
46 | ;------------------------------------------------------------------------------ |
46 | ;------------------------------------------------------------------------------ |
47 | ; Define button arguments: |
47 | ;; Define button: |
48 | ; ebx = pack[16(x), 16(width)] |
48 | ;> ebx = pack[16(x), 16(width)] |
49 | ; ecx = pack[16(y), 16(height)] |
49 | ;> ecx = pack[16(y), 16(height)] |
50 | ; edx = pack[8(flags), 24(button identifier)] |
50 | ;> edx = pack[8(flags), 24(button identifier)] |
51 | ; flags bits: |
51 | ;> flags bits: |
52 | ; 7 (31) = 0 |
52 | ;> 7 (31) = 0 |
53 | ; 6 (30) = don't draw button |
53 | ;> 6 (30) = don't draw button |
54 | ; 5 (29) = don't draw button frame when pressed |
54 | ;> 5 (29) = don't draw button frame when pressed |
55 | ; esi = button color |
55 | ;> esi = button color |
56 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
56 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
57 | ; Undefine button arguments: |
57 | ;; Undefine button: |
58 | ; edx = pack[8(flags), 24(button identifier)] |
58 | ;> edx = pack[8(flags), 24(button identifier)] |
59 | ; flags bits: |
59 | ;> flags bits: |
60 | ; 7 (31) = 1 |
60 | ;> 7 (31) = 1 |
61 | ;------------------------------------------------------------------------------ |
61 | ;------------------------------------------------------------------------------ |
62 | ; do we actually need to undefine the button? |
62 | ; do we actually need to undefine the button? |
63 | test edx, 0x80000000 |
63 | test edx, 0x80000000 |
Line 262... | Line 262... | ||
262 | 262 | ||
263 | align 4 |
263 | align 4 |
264 | ;------------------------------------------------------------------------------ |
264 | ;------------------------------------------------------------------------------ |
265 | check_buttons: ;/////////////////////////////////////////////////////////////// |
265 | check_buttons: ;/////////////////////////////////////////////////////////////// |
266 | ;------------------------------------------------------------------------------ |
266 | ;------------------------------------------------------------------------------ |
267 | ; |
267 | ;? |
268 | ;------------------------------------------------------------------------------ |
268 | ;------------------------------------------------------------------------------ |
269 | cmp byte[BTN_DOWN], 0 ; mouse buttons pressed |
269 | cmp byte[BTN_DOWN], 0 ; mouse buttons pressed |
270 | jnz @f |
270 | jnz @f |
271 | mov [bPressedMouseXY_B], 0 |
271 | mov [bPressedMouseXY_B], 0 |
Line 458... | Line 458... | ||
458 | ;============================================================================== |
458 | ;============================================================================== |
Line 459... | Line 459... | ||
459 | 459 | ||
460 | ;------------------------------------------------------------------------------ |
460 | ;------------------------------------------------------------------------------ |
461 | button._.dececx: ;///////////////////////////////////////////////////////////// |
461 | button._.dececx: ;///////////////////////////////////////////////////////////// |
462 | ;------------------------------------------------------------------------------ |
462 | ;------------------------------------------------------------------------------ |
463 | ; |
463 | ;? |
464 | ;------------------------------------------------------------------------------ |
464 | ;------------------------------------------------------------------------------ |
465 | sub cl, 0x20 |
465 | sub cl, 0x20 |
466 | jnc @f |
466 | jnc @f |
467 | xor cl, cl |
467 | xor cl, cl |
Line 476... | Line 476... | ||
476 | ret |
476 | ret |
Line 477... | Line 477... | ||
477 | 477 | ||
478 | ;------------------------------------------------------------------------------ |
478 | ;------------------------------------------------------------------------------ |
479 | button._.incecx: ;///////////////////////////////////////////////////////////// |
479 | button._.incecx: ;///////////////////////////////////////////////////////////// |
480 | ;------------------------------------------------------------------------------ |
480 | ;------------------------------------------------------------------------------ |
481 | ; |
481 | ;? |
482 | ;------------------------------------------------------------------------------ |
482 | ;------------------------------------------------------------------------------ |
483 | add cl, 0x20 |
483 | add cl, 0x20 |
484 | jnc @f |
484 | jnc @f |
485 | or cl, -1 |
485 | or cl, -1 |
Line 494... | Line 494... | ||
494 | ret |
494 | ret |
Line 495... | Line 495... | ||
495 | 495 | ||
496 | ;------------------------------------------------------------------------------ |
496 | ;------------------------------------------------------------------------------ |
497 | button._.incecx2: ;//////////////////////////////////////////////////////////// |
497 | button._.incecx2: ;//////////////////////////////////////////////////////////// |
498 | ;------------------------------------------------------------------------------ |
498 | ;------------------------------------------------------------------------------ |
499 | ; |
499 | ;? |
500 | ;------------------------------------------------------------------------------ |
500 | ;------------------------------------------------------------------------------ |
501 | add cl, 0x14 |
501 | add cl, 0x14 |
502 | jnc @f |
502 | jnc @f |
503 | or cl, -1 |
503 | or cl, -1 |
Line 512... | Line 512... | ||
512 | ret |
512 | ret |
Line 513... | Line 513... | ||
513 | 513 | ||
514 | ;------------------------------------------------------------------------------ |
514 | ;------------------------------------------------------------------------------ |
515 | button._.button_dececx: ;////////////////////////////////////////////////////// |
515 | button._.button_dececx: ;////////////////////////////////////////////////////// |
516 | ;------------------------------------------------------------------------------ |
516 | ;------------------------------------------------------------------------------ |
517 | ; |
517 | ;? |
518 | ;------------------------------------------------------------------------------ |
518 | ;------------------------------------------------------------------------------ |
519 | cmp [buttontype], 1 |
519 | cmp [buttontype], 1 |
Line 520... | Line 520... | ||
520 | jne .finish |
520 | jne .finish |
Line 543... | Line 543... | ||
543 | ret |
543 | ret |
Line 544... | Line 544... | ||
544 | 544 | ||
545 | ;------------------------------------------------------------------------------ |
545 | ;------------------------------------------------------------------------------ |
546 | button._.negative_button: ;//////////////////////////////////////////////////// |
546 | button._.negative_button: ;//////////////////////////////////////////////////// |
547 | ;------------------------------------------------------------------------------ |
547 | ;------------------------------------------------------------------------------ |
548 | ; |
548 | ;? |
549 | ;------------------------------------------------------------------------------ |
549 | ;------------------------------------------------------------------------------ |
550 | ; If requested, do not display button border on press. |
550 | ; if requested, do not display button border on press. |
551 | test ebx, 0x20000000 |
- | |
552 | jz .draw_negative_button |
551 | test ebx, 0x20000000 |
Line 553... | Line -... | ||
553 | ret |
- | |
554 | 552 | jnz .exit |
|
Line 555... | Line -... | ||
555 | .draw_negative_button: |
- | |
556 | pushad |
- | |
557 | - | ||
558 | mov ebx, dword[eax + SYS_BUTTON.left] |
- | |
559 | mov ecx, dword[eax + SYS_BUTTON.top] |
- | |
560 | rol ebx, 16 |
- | |
561 | rol ecx, 16 |
- | |
562 | push ebx ecx |
- | |
563 | - | ||
564 | ; calculate window-relative coordinates |
- | |
565 | shr ebx, 16 |
- | |
566 | shr ecx, 16 |
- | |
567 | movzx eax, word[eax + SYS_BUTTON.pslot] |
- | |
568 | shl eax, 5 |
- | |
569 | add eax, window_data |
- | |
570 | add ebx, [eax + WDATA.box.left] |
- | |
571 | add ecx, [eax + WDATA.box.top] |
- | |
572 | - | ||
573 | xor edi, edi |
- | |
574 | inc edi |
- | |
575 | - | ||
576 | ; top border |
- | |
577 | mov eax, ebx |
- | |
578 | shl eax, 16 |
- | |
579 | mov ax, bx |
- | |
580 | add ax, [esp + 4] |
- | |
581 | mov ebx, ecx |
- | |
582 | shl ebx, 16 |
- | |
583 | mov bx, cx |
- | |
584 | push ebx |
- | |
585 | mov ecx, 0x01000000 |
- | |
586 | call [draw_line] |
- | |
587 | - | ||
588 | ; bottom border |
- | |
589 | movzx edx, word[esp + 4 + 0] |
- | |
590 | add ebx, edx |
- | |
591 | shl edx, 16 |
- | |
592 | add ebx, edx |
- | |
593 | call [draw_line] |
- | |
594 | - | ||
595 | ; left border |
553 | |
596 | pop ebx |
- | |
597 | push edx |
- | |
598 | mov edx, eax |
- | |
599 | shr edx, 16 |
- | |
600 | mov ax, dx |
- | |
601 | mov edx, ebx |
- | |
602 | shr edx, 16 |
- | |
603 | mov bx, dx |
- | |
604 | add bx, [esp + 4 + 0] |
- | |
605 | pop edx |
- | |
Line -... | Line 554... | ||
- | 554 | pushad |
|
- | 555 | ||
- | 556 | xchg esi, eax |
|
- | 557 | ||
- | 558 | movzx ecx, [esi + SYS_BUTTON.pslot] |
|
- | 559 | shl ecx, 5 |
|
- | 560 | add ecx, window_data |
|
- | 561 | ||
606 | add ebx, 0x00010000 |
562 | mov eax, dword[esi + SYS_BUTTON.left] |
607 | dec bx |
563 | mov ebx, dword[esi + SYS_BUTTON.top] |
608 | call [draw_line] |
564 | add eax, [ecx + WDATA.box.left] |
609 | 565 | add ebx, [ecx + WDATA.box.top] |
|
610 | ; right border |
566 | push eax ebx |
611 | mov dx, [esp + 4] |
567 | pop edx ecx |
Line 612... | Line 568... | ||
612 | add ax, dx |
568 | rol eax, 16 |
- | 569 | rol ebx, 16 |
|
Line 613... | Line 570... | ||
613 | shl edx, 16 |
570 | add ax, cx |
- | 571 | add bx, dx |
|
- | 572 | ||
614 | add eax, edx |
573 | mov esi, 0x01000000 |