Now take into account also the upper-left corner of the workspace.

git-svn-id: svn://kolibrios.org@4146 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
GerdtR 2013-11-01 21:07:43 +00:00
parent 0dbb12299d
commit 8068f9225d
4 changed files with 2013 additions and 1905 deletions

View File

@ -35,8 +35,6 @@ BegData equ fiStdIco.point
dd 0 ; boot parameters dd 0 ; boot parameters
dd 0 ; path dd 0 ; path
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
include 'lang.inc'
include 'lang.inc' include 'lang.inc'
include '../../macros.inc' include '../../macros.inc'
include '../../proc32.inc' include '../../proc32.inc'
@ -360,49 +358,66 @@ MovingIcon:
mov bx,ax mov bx,ax
shr eax,16 shr eax,16
add ebx,7 sub eax,1+ICON_SIZE/2
dec eax jnc @f
sub eax,ICON_SIZE/2
jns @f
xor eax,eax xor eax,eax
@@: @@:
sub ebx,ICON_SIZE/2
jns @f sub ebx,ICON_SIZE/2-7
jnc @f
xor ebx,ebx xor ebx,ebx
@@: @@:
movzx edx,[ScreenX] cmp ax,[wsX]
jae @f
mov ax,[wsX]
@@:
cmp bx,[wsY]
jae @f
mov bx,[wsY]
@@: ;eax,ebx - ॠ«ì­ ï ª®®à¤¨­ â . ‚ᥠª®®à¤¨­ âë ¢ ¯à®£¥ ®â­®á¨â¥«ì­® «¥¢®£® ¢¥àå­¥£® 㣫  à ¡®ç¥© ®¡« áâ¨
xor edx,edx
mov dx,[wsXe]
sub edx,ICON_SIZE sub edx,ICON_SIZE
cmp eax,edx cmp eax,edx
jbe @f jbe @f
mov eax,edx mov eax,edx
@@: @@:
movzx edx,[ScreenY] mov dx,[wsYe]
sub edx,ICON_SIZE sub edx,ICON_SIZE
cmp ebx,edx cmp ebx,edx
jbe @f jbe @f
mov ebx,edx mov ebx,edx
@@: @@:
xor edx,edx xor edx,edx ;¯à¥®¡à §®¢ë¢ ¥¬ ¢ ®â­®á¨â¥«ì­ë¥
mov dx,[ScreenX] mov dx,[wsW]
shr edx,1 shr edx,1
add dx,[wsX]
cmp eax,edx cmp eax,edx
jbe @f jbe @f
sub ax,[ScreenX] sub ax,[wsXe]
inc ax inc ax
jmp .mov1
@@: @@:
sub ax,[wsX]
.mov1:
xor edx,edx xor edx,edx
mov dx,[ScreenY] mov dx,[wsH]
shr edx,1 shr edx,1
add dx,[wsY]
cmp ebx,edx cmp ebx,edx
jbe @f jbe @f
sub bx,[ScreenY] sub bx,[wsYe]
inc bx inc bx
jmp .mov2
@@: @@:
sub bx,[wsY]
.mov2:
stdcall SetPosition,[SelIcon],eax,ebx stdcall SetPosition,[SelIcon],eax,ebx
@ -441,12 +456,10 @@ RButtonPress:
;ret eax = 1/0 = 膉删<E88689>/株芋<E6A0AA> ;ret eax = 1/0 = 膉删<E88689>/株芋<E6A0AA>
proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n
local IconData:DWORD local IconData:DWORD
; int3
push ebx edi esi push ebx edi esi
mov ecx,ICON_SIZE*ICON_SIZE mov ecx,ICON_SIZE*ICON_SIZE
xor eax,eax xor eax,eax
;mov eax,0FFFFFFFh
mov edi,IconArea mov edi,IconArea
rep stosd rep stosd
@ -483,20 +496,20 @@ local IconData:DWORD
add ebx,-1*10000h+0 add ebx,-1*10000h+0
mcall 4 mcall 4
add ebx,2*10000h+0 add ebx,2*10000h+0
mcall 4 mcall ;4
add ebx,-1*10000h-1 add ebx,-1*10000h-1
mcall 4 mcall ;4
add ebx,0*10000h+2 add ebx,0*10000h+2
mcall 4 mcall ;4
add ebx,1*10000h+0 add ebx,1*10000h+0
mcall 4 mcall ;4
add ebx,0*10000h+1 inc ebx;add ebx,0*10000h+1
mcall 4 mcall ;4
add ebx,-1*10000h+0 add ebx,-1*10000h+0
mcall 4 mcall ;4
add ebx,0*10000h-2 add ebx,0*10000h-2
mov ecx,88FFFFFFh mov ecx,88FFFFFFh
mcall 4 mcall ;4
;鄖摦布 <20>飶身芥 ;鄖摦布 <20>飶身芥
mov edi,esi mov edi,esi
@ -540,9 +553,9 @@ local IconData:DWORD
add eax,IMG_SIZE*IMG_SIZE*4 add eax,IMG_SIZE*IMG_SIZE*4
loop @b loop @b
DI1: DI1:
add eax,[raw_pointer]
add eax,0+4*11
mov esi,eax mov esi,eax
add esi,[raw_pointer]
add esi,0+4*11
CopyToMem: CopyToMem:
mov edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4 mov edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4
@ -617,14 +630,23 @@ local IconData:DWORD
test edx,00008000h test edx,00008000h
jz @f jz @f
add dx,[ScreenY] add dx,[wsYe]
jmp .DI11
@@: @@:
add dx,[wsY]
.DI11:
test edx,80000000h test edx,80000000h
jz @f jz @f
rol edx,16 mov ax,[wsXe]
add dx,[ScreenX] shl eax,16
rol edx,16 add edx,eax
jmp .DI12
@@: @@:
mov ax,[wsX]
shl eax,16
add edx,eax
.DI12:
mov ebx,IconArea mov ebx,IconArea
mov ecx,ICON_SIZE*10000h+ICON_SIZE mov ecx,ICON_SIZE*10000h+ICON_SIZE
@ -658,14 +680,20 @@ proc RestoreBackgrnd,NumIcon:DWORD
mov ax,[edi+2] mov ax,[edi+2]
test ax,8000h test ax,8000h
jz @f jz @f
add ax,[ScreenX] add ax,[wsXe]
jmp .rbg1
@@: @@:
add ax,[wsX]
.rbg1:
mov bx,[edi] mov bx,[edi]
test bx,8000h test bx,8000h
jz @f jz @f
add bx,[ScreenY] add bx,[wsYe]
jmp .rbg2
@@: @@:
add bx,[wsY]
.rbg2:
mov cx,ax mov cx,ax
shl ecx,16 shl ecx,16
@ -692,28 +720,30 @@ proc AddIcon stdcall,x,y,lpIcon,lpName,lpExeFile,lpParams
xor edx,edx xor edx,edx
test eax,8000h test eax,8000h
jnz @f jnz @f
mov dx,[ScreenX] ;¥á«¨ ­ ¤®, â® ¯à¥®¡à §®¢ë¢ ¥¬ ¢ mov dx,[wsW] ;¥á«¨ ­ ¤®, â® ¯à¥®¡à §®¢ë¢ ¥¬ ¢
shr edx,1 ;栽鄖<E6A0BD>漭恢卿<E681A2> 狙桌尹<E6A18C> shr edx,1 ;栽鄖<E6A0BD>漭恢卿<E681A2> 狙桌尹<E6A18C>
add dx,[wsX]
cmp eax,edx cmp eax,edx
jbe @f jbe @f
sub ax,[ScreenX] sub ax,[wsW]
inc eax inc eax
@@: @@:
test ebx,8000h test ebx,8000h
jnz @f jnz @f
mov dx,[ScreenY] mov dx,[wsY]
shr edx,1 shr edx,1
add dx,[wsH]
cmp ebx,edx cmp ebx,edx
jbe @f jbe @f
sub bx,[ScreenY] sub bx,[wsH]
inc ebx inc ebx
@@: @@:
;祚能𨯂<E883BD> <20> 嶉蜭匲 <EFBD83> <20> 芹匲 磲<><E7A3B2> ;祚能𨯂<E883BD> <20> 嶉蜭匲 <EFBD83> <20> 芹匲 磲<><E7A3B2>
test eax,8000h test eax,8000h
jnz @f jnz @f
mov dx,[ScreenX] mov dx,[wsXe]
sub edx,ICON_SIZE sub edx,ICON_SIZE
cmp eax,edx cmp eax,edx
jbe @f jbe @f
@ -722,7 +752,7 @@ proc AddIcon stdcall,x,y,lpIcon,lpName,lpExeFile,lpParams
test ebx,8000h test ebx,8000h
jnz @f jnz @f
mov dx,[ScreenY] mov dx,[wsYe]
sub edx,ICON_SIZE sub edx,ICON_SIZE
cmp ebx,edx cmp ebx,edx
jbe @f jbe @f
@ -876,15 +906,22 @@ local posX:WORD,\
mov ax,[edi+2] mov ax,[edi+2]
test ax,8000h test ax,8000h
jz @f jz @f
add ax,[ScreenX] add ax,[wsXe]
jmp .gni1
@@: @@:
add ax,[wsX]
.gni1:
mov [posX],ax mov [posX],ax
mov ax,[edi] mov ax,[edi]
test ax,8000h test ax,8000h
jz @f jz @f
add ax,[ScreenY] add ax,[wsYe]
jmp .gni2
@@: @@:
add ax,[wsY]
.gni2:
mov [posY],ax mov [posY],ax
mov eax,[x] mov eax,[x]
@ -908,9 +945,9 @@ local posX:WORD,\
dec ebx dec ebx
pop ecx pop ecx
loop .TestIcon ;loop .TestIcon
;dec ecx dec ecx
;jnz .TestIcon jnz .TestIcon
jmp .NoIcon jmp .NoIcon
.OkIcon: .OkIcon:
mov eax,ebx mov eax,ebx
@ -1369,8 +1406,16 @@ sc.workL rd 1
sc.workH rd 1 sc.workH rd 1
align 4 align 4
ScreenX rw 1
ScreenY rw 1 ScreenW rw 1
ScreenH rw 1
wsX rw 1
wsY rw 1
wsXe rw 1
wsYe rw 1
wsW rw 1
wsH rw 1
MouseX rd 1 MouseX rd 1
MouseY rd 1 MouseY rd 1

View File

@ -12,8 +12,64 @@ DlgProp:
cmp eax,-1 cmp eax,-1
jne SetProp jne SetProp
m2m dword[AddX],dword[MouseX] ;-----------
m2m dword[AddY],dword[MouseY] mov eax,[MouseX]
mov ebx,[MouseY]
cmp ax,[wsX]
jae @f
mov ax,[wsX]
@@:
cmp bx,[wsY]
jae @f
mov bx,[wsY]
@@: ;eax,ebx - ॠ«ì­ ï ª®®à¤¨­ â . ‚ᥠª®®à¤¨­ âë ¢ ¯à®£¥ ®â­®á¨â¥«ì­® «¥¢®£® ¢¥àå­¥£® 㣫  à ¡®ç¥© ®¡« áâ¨
xor edx,edx
mov dx,[wsXe]
sub edx,ICON_SIZE
cmp eax,edx
jbe @f
mov eax,edx
@@:
mov dx,[wsYe]
sub edx,ICON_SIZE
cmp ebx,edx
jbe @f
mov ebx,edx
@@:
xor edx,edx ;¯à¥®¡à §®¢ë¢ ¥¬ ¢ ®â­®á¨â¥«ì­ë¥
mov dx,[wsW]
shr edx,1
add dx,[wsX]
cmp eax,edx
jbe @f
sub ax,[wsXe]
inc ax
jmp .dlg1
@@:
sub ax,[wsX]
.dlg1:
xor edx,edx
mov dx,[wsH]
shr edx,1
add dx,[wsY]
cmp ebx,edx
jbe @f
sub bx,[wsYe]
inc bx
jmp .dlg2
@@:
sub bx,[wsY]
.dlg2:
mov [AddX],eax
mov [AddY],ebx
;-----------
mov ecx,NAME_LENGTH mov ecx,NAME_LENGTH
mov edi,DAreaName mov edi,DAreaName

View File

@ -1,11 +1,4 @@
;idbRRedrawFon equ 100
;idbRAlign equ 101
;idbRFixIcons equ 102
;idbRAdd equ 103
;idbRDel equ 104
;idbRProp equ 105
DELTA_COLOR equ 70 DELTA_COLOR equ 70
COLOR_SEL_BUT equ 00F7092Dh COLOR_SEL_BUT equ 00F7092Dh
MAX_USER_BUTTONS equ 30 MAX_USER_BUTTONS equ 30
@ -628,11 +621,12 @@ local posX:WORD,\
jmp .AI6 jmp .AI6
@@: @@:
mov dx,[ScreenX] mov dx,[wsW]
shr dx,1 shr dx,1
add dx,[wsX]
cmp ax,dx cmp ax,dx
jbe .AI6 jbe .AI6
sub ax,[ScreenX] sub ax,[wsW]
.AI6: .AI6:
mov word[edi+2],ax mov word[edi+2],ax
@ -645,11 +639,12 @@ local posX:WORD,\
jmp .AI7 jmp .AI7
@@: @@:
mov dx,[ScreenY] mov dx,[wsH]
shr dx,1 shr dx,1
add dx,[wsY]
cmp ax,dx cmp ax,dx
jbe .AI7 jbe .AI7
sub ax,[ScreenY] sub ax,[wsH]
.AI7: .AI7:
mov word[edi],ax mov word[edi],ax

View File

@ -4,14 +4,26 @@ BGRedrawThread:
BGRTRedrawIcons: BGRTRedrawIcons:
mcall 48,5 mcall 48,5
mov [wsXe],ax
mov [wsYe],bx
mov dx,ax mov dx,ax
shr eax,16 shr eax,16
mov [wsX],ax
sub dx,ax sub dx,ax
mov [ScreenX],dx mov [wsW],dx
mov ax,bx mov ax,bx
shr ebx,16 shr ebx,16
mov [wsY],bx
sub ax,bx sub ax,bx
mov [ScreenY],ax mov [wsH],ax
mcall 14
mov [ScreenH],ax
shr eax,16
mov [ScreenW],ax
mov ecx,[MaxNumIcon] mov ecx,[MaxNumIcon]
test ecx,ecx test ecx,ecx