1) fix in rev 5911

2) add mouse scroll in 'tree_list'

git-svn-id: svn://kolibrios.org@5914 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2015-11-14 21:31:00 +00:00
parent 8bc2caddf7
commit e7401d7710

View File

@ -1,6 +1,6 @@
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj ; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
; í«¥¬¥­â TreeList ¤«ï Kolibri OS ; í«¥¬¥­â TreeList ¤«ï Kolibri OS
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 10.11.2015 IgorA ; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 14.11.2015 IgorA
; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï ; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï
@ -207,6 +207,48 @@ proc tl_mouse, tlist:dword
cmp ax,bx ;¢¥àå­ïï £à ­¨æ  ®ª­  + ¢ëá®â  ¯®¤¯¨á¨ cmp ax,bx ;¢¥àå­ïï £à ­¨æ  ®ª­  + ¢ëá®â  ¯®¤¯¨á¨
jl .test_scroll jl .test_scroll
push eax ebx
mcall 37,7 ;®¡à ¡®âª  ª®«¥á  ¬ëè¨
mov edx,eax
xor ecx,ecx
test eax,eax
jz .mouse_next
test ax,0x8000
jnz .decr
shr eax,16
test ax,0x8000
jnz .decr_1
mov cx,dx ;dx = mouse scroll data vertical
test ecx,ecx
jnz @f
shr edx,16
mov cx,dx ;dx = mouse scroll data horizontal
test ecx,ecx
jz .mouse_next
@@:
stdcall tl_cur_next, edi
dec ecx
jnz @r
jmp .mouse_next
;----------------------------------------
.decr: ;¢¥à⨪ «ì­ ï ¯à®ªàã⪠ ®âà¨æ â¥«ì­ ï
mov bx,ax ;ax = mouse scroll data vertical
jmp @f
.decr_1: ;£®à¨§®­â «ì­ ï ¯à®ªàã⪠ ®âà¨æ â¥«ì­ ï
mov bx,ax ;ax = mouse scroll data horizontal
@@:
mov ecx,0xffff
sub ecx,ebx
inc ecx
@@:
stdcall tl_cur_perv, edi
dec ecx
jnz @r
;---------------------------------------------------
.mouse_next:
pop ebx eax
push eax ebx push eax ebx
mcall 37,2 mcall 37,2
@ -1412,25 +1454,26 @@ endp
;output: ;output:
; eax - pointer to node info ; eax - pointer to node info
align 4 align 4
proc tl_node_poi_get_info uses ebx ecx edi, tlist:dword, node_ind:dword proc tl_node_poi_get_info uses ebx ecx edx edi, tlist:dword, node_ind:dword
mov edi,dword[tlist] mov edi,dword[tlist]
mov ebx,dword[node_ind] mov ebx,dword[node_ind]
;cycle to nodes ;cycle to nodes
mov eax,tl_data_nodes mov edx,tl_data_nodes
mov ecx,eax mov ecx,edx
add ecx,sizeof.TreeList add ecx,sizeof.TreeList
@@: @@:
call tl_iterat_next_all call tl_iterat_next_all
cmp eax,ecx cmp edx,ecx
jle @f jle @f
dec ebx dec ebx
cmp ebx,0 cmp ebx,0
jg @b jg @b
jmp .find jmp .find
@@: @@:
xor eax,eax xor edx,edx
.find: .find:
mov eax,edx
ret ret
endp endp
@ -1832,7 +1875,8 @@ endp
;¯¥à¥¬¥é ¥¬ 㧥« ¢¢¥àå ;¯¥à¥¬¥é ¥¬ 㧥« ¢¢¥àå
align 4 align 4
proc tl_node_move_up uses eax ebx ecx edx edi esi, tlist:dword proc tl_node_move_up tlist:dword
pushad
mov edi,dword[tlist] mov edi,dword[tlist]
call tl_get_cur_node_index ;eax=po_t call tl_get_cur_node_index ;eax=po_t
cmp eax,2 cmp eax,2
@ -1861,12 +1905,14 @@ proc tl_node_move_up uses eax ebx ecx edx edi esi, tlist:dword
push dword edi push dword edi
call tl_draw call tl_draw
@@: @@:
popad
ret ret
endp endp
;¯¥à¥¬¥é ¥¬ 㧥« ¢­¨§ ;¯¥à¥¬¥é ¥¬ 㧥« ¢­¨§
align 4 align 4
proc tl_node_move_down uses eax ebx ecx edx edi esi, tlist:dword proc tl_node_move_down tlist:dword
pushad
mov edi,dword[tlist] mov edi,dword[tlist]
call tl_get_cur_node_index ;eax=po_t call tl_get_cur_node_index ;eax=po_t
cmp eax,2 cmp eax,2
@ -1896,29 +1942,30 @@ proc tl_node_move_down uses eax ebx ecx edx edi esi, tlist:dword
stdcall tl_draw, edi stdcall tl_draw, edi
@@: @@:
ret ret
popad
endp endp
align 4 align 4
tl_node_move_po6: tl_node_move_po6:
mov ecx,edx ;save node pointer mov ecx,edx ;save node pointer
call tl_move_perv call tl_move_perv
mov dword[edx+8],ebx mov dword[edx+8],ebx
mov edx,esi mov edx,esi
call tl_move_next call tl_move_next
mov dword[edx+4],eax mov dword[edx+4],eax
mov edx,ecx ;restore node pointer mov edx,ecx ;restore node pointer
;+4 perv ;+4 perv
mov ecx,dword[edx+4] mov ecx,dword[edx+4]
mov dword[esi+4],ecx mov dword[esi+4],ecx
;+8 next ;+8 next
mov ecx,dword[esi+8] mov ecx,dword[esi+8]
mov dword[edx+8],ecx mov dword[edx+8],ecx
mov dword[edx+4],ebx mov dword[edx+4],ebx
mov dword[esi+8],eax mov dword[esi+8],eax
ret ret
;input ;input
;eax = index 1 node struct ;eax = index 1 node struct
@ -1933,34 +1980,34 @@ tl_node_move_po6:
align 4 align 4
tl_node_move_po8: tl_node_move_po8:
; push ecx ; push ecx
mov ecx,edx ;save node pointer mov ecx,edx ;save node pointer
call tl_move_perv call tl_move_perv
mov dword[edx+8],ebx mov dword[edx+8],ebx
mov edx,ecx mov edx,ecx
call tl_move_next call tl_move_next
mov dword[edx+4],ebx mov dword[edx+4],ebx
mov edx,esi mov edx,esi
call tl_move_perv call tl_move_perv
mov dword[edx+8],eax mov dword[edx+8],eax
mov edx,esi mov edx,esi
call tl_move_next call tl_move_next
mov dword[edx+4],eax mov dword[edx+4],eax
mov edx,ecx ;restore node pointer mov edx,ecx ;restore node pointer
; pop ecx ; pop ecx
;+4 perv ;+4 perv
mov eax,dword[edx+4] mov eax,dword[edx+4]
mov ebx,dword[esi+4] mov ebx,dword[esi+4]
xchg eax,ebx xchg eax,ebx
mov dword[edx+4],eax mov dword[edx+4],eax
mov dword[esi+4],ebx mov dword[esi+4],ebx
;+8 next ;+8 next
mov eax,dword[edx+8] mov eax,dword[edx+8]
mov ebx,dword[esi+8] mov ebx,dword[esi+8]
xchg eax,ebx xchg eax,ebx
mov dword[edx+8],eax mov dword[edx+8],eax
mov dword[esi+8],ebx mov dword[esi+8],ebx
ret ret
;input: ;input:
; edi = pointer to 'TreeList' struct ; edi = pointer to 'TreeList' struct