From afd40cc982673e50595c19dd6b20e842b15f5022 Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Sun, 4 Dec 2005 14:42:26 +0000 Subject: [PATCH] Click on the application button - works only if during release of a up-button mouse the cursor is on the button application. Realization Victor Alberto Gil Hanla (vhanla). git-svn-id: svn://kolibrios.org@28 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/gui/button.inc | 65 +++++++++++++++++++++++++++++++++---- kernel/trunk/kernel.asm | 4 +-- 2 files changed, 61 insertions(+), 8 deletions(-) diff --git a/kernel/trunk/gui/button.inc b/kernel/trunk/gui/button.inc index 06f3fa60a8..3027d12dd7 100644 --- a/kernel/trunk/gui/button.inc +++ b/kernel/trunk/gui/button.inc @@ -454,6 +454,10 @@ checkbuttons: 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] @@ -542,10 +546,59 @@ checkbuttons: call negativebutton mov [0xfff4],byte 0 ; no mouse background mov [0xfff5],byte 0 ; draw mouse - mov [0xf500],byte 1 - pop ebx - mov [0xf501],ebx - mov [0xfb44],byte 0 ; mouse down checks - popad - ret +;..................................... start 2/2 : modified by vhanla ............................. + ; check coordinates + jmp afterbuttonid + buttonid dd 0x0 ;here a will backup the eax value + afterbuttonid: + + pusha + mov eax,[buttonid] + ; mouse x >= button x ? + movzx ebx,word [eax+0] + shl ebx,5 + add ebx,window_data + movzx ecx,word [ebx+0] ; window x start + movzx edx,word [eax+4] ; button x start + add edx,ecx + mov cx,[0xfb0a] + cmp edx,ecx + jg no_on_button ;if we release the pointer out of the button area + + movzx ebx,word [eax+6] ; button x size + add edx,ebx + cmp ecx,edx + jg no_on_button + + ; mouse y >= button y ? + movzx ebx,word [eax+0] + shl ebx,5 + add ebx,window_data + movzx ecx,word [ebx+4] ; window y start + movzx edx,word [eax+8] ; button y start + add edx,ecx + mov cx,[0xfb0c] + cmp edx,ecx + jg no_on_button + + movzx ebx,word [eax+10] ; button y size + add edx,ebx + cmp ecx,edx + jg no_on_button + popa + mov [0xf500],byte 1 ; no of buttons in buffer + pop ebx + mov [0xf501],ebx ; lets put the button id in buffer + push ebx + pusha + jmp yes_on_button +no_on_button: + mov [0xf500],byte 0 ; no of buttons in buffer +yes_on_button: + mov [0xfb44],byte 0 ; mouse down -> do not draw + popa + pop ebx + popa + ret +;..................................... end 2/2 : modified by vhanla ................................ diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 897c84b7d9..a74fc3b353 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -86,7 +86,7 @@ drawbar dd __sys_drawbar putpixel dd __sys_putpixel ; } mike.dld -version db 'Kolibri OS version 0.5.1.5 ',13,10,13,10,0 +version db 'Kolibri OS version 0.5.2.1 ',13,10,13,10,0 ;dd endofcode-0x10000 ;db 'Boot02' @@ -2253,7 +2253,7 @@ keyboard_mode_sys db 0 iglobal version_inf: - db 0,5,1,5 ; version 0.5.1.5 + db 0,5,2,1 ; version 0.5.2.1 db UID_KOLIBRI db 'Kolibri',0 version_end: