1) fix draw caption in 'tree_list'

2) 'info3ds' correct scale on axis x and y

git-svn-id: svn://kolibrios.org@5948 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2015-12-03 10:55:32 +00:00
parent 94a081e526
commit bee21cb588
2 changed files with 725 additions and 754 deletions

View File

@ -521,6 +521,24 @@ align 4
fild dword[rad_c]
fdivp ;radius=(size.x+size.y)/rad_c
fstp dword[sph_radius]
;¤¥« ¥¬ ®¤¨­ ª®¢ë© ¬ áèâ ¡ ¯® ®áï¬ x ¨ y, çâ®-¡ë ­¥ ­ àãè «¨áì ¯à®¯®à樨 ¨§®¡à ¦¥­¨ï
fld dword[obj_y_scale]
fdiv dword[ratio] ;¯à¨¢¥¤¥­¨¥ ¬ áèâ ¡  ¯® ®á¨ y ãç¨â뢠ï çâ® ¯® ¢ëá®â¥ íªà ­ ¬¥­ìè¥
fcomp dword[obj_x_scale]
fstsw ax
sahf
jb @f
;ᦠ⨥ ¬ áèâ ¡  ¯® y
fld dword[obj_x_scale]
fmul dword[ratio]
fstp dword[obj_y_scale] ;¬ áèâ ¡ ¯® ®á¨ y = ¬ áèâ ¡ ¯® ®á¨ x
jmp .end
@@:
;ᦠ⨥ ¬ áèâ ¡  ¯® x >...<
fld dword[obj_x_scale]
fdiv dword[ratio]
fstp dword[obj_x_scale]
.end:
ret
endp
@ -1268,6 +1286,7 @@ mouse_x dd 0
mouse_y dd 0
angle_dxm dd 1.7775 ;~ 3d_wnd_w/180 - ¯à¨¡ ¢«¥­¨¥ 㣫®¢ ¯®¢®à®â  áæ¥­ë ¯à¨ ¢à é¥­¨¨ ¬ë襩
angle_dym dd 1.3335 ;~ 3d_wnd_h/180
ratio dd 1.3333 ;~ 3d_wnd_w/3d_wnd_h
;angle_dzm dd ?
draw_mode dd 0 ;०¨¬ à¨á®¢ ­¨ï ®¡ê¥ªâ 
obj_poi_data dd 0 ;㪠§ â¥«ì ­  ª®®à¤¨­ âë ¢¥à設

View File

@ -1,6 +1,6 @@
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
; í«¥¬¥­â TreeList ¤«ï Kolibri OS
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 14.11.2015 IgorA
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 03.12.2015 IgorA
; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï
@ -63,8 +63,7 @@ endp
;®ç¨á⪠ ¯ ¬ïâ¨ í«¥¬¥­â  (¤¥áâàãªâ®à)
align 4
proc tl_data_clear uses edi, tlist:dword
;uses eax ???
proc tl_data_clear uses eax edi, tlist:dword
mov edi,dword[tlist]
cmp tl_data_img,0
je @f
@ -190,7 +189,6 @@ proc tl_mouse, tlist:dword
shl ebx,16
cmp eax,ebx ;«¥¢ ï £à ­¨æ  ®ª­ 
jl .no_in_wnd ;.test_scroll ­¥ ¯à¨¬¥­ï¥¬
shr ebx,16
add ebx,tl_box_width
shl ebx,16
@ -208,9 +206,9 @@ proc tl_mouse, tlist:dword
jl .test_scroll
push eax ebx
mcall 37,7 ;®¡à ¡®âª  ª®«¥á  ¬ëè¨
mov edx,eax
xor ecx,ecx
mcall 37,7 ;®¡à ¡®âª  ª®«¥á  ¬ëè¨
mov edx,eax
xor ecx,ecx
test eax,eax
jz .mouse_next
test ax,0x8000
@ -231,7 +229,7 @@ xor ecx,ecx
dec ecx
jnz @r
jmp .mouse_next
;----------------------------------------
;------------------------------------------------
.decr: ;¢¥à⨪ «ì­ ï ¯à®ªàã⪠ ®âà¨æ â¥«ì­ ï
mov bx,ax ;ax = mouse scroll data vertical
jmp @f
@ -245,7 +243,7 @@ xor ecx,ecx
stdcall tl_cur_perv, edi
dec ecx
jnz @r
;---------------------------------------------------
;------------------------------------------------
.mouse_next:
pop ebx eax
@ -351,7 +349,6 @@ pop ebx eax
mcall 37,2 ;¯à®¢¥à塞 ­ ¦ â®áâì «î¡ëå ª­®¯®ª
cmp eax,0 ;­¨ç¥£® ­¥ ­ ¦ «¨ eax=0
je .no_draw
mov ebx,tl_el_focus
cmp dword[ebx],edi
jne .no_draw ;í«¥¬¥­â ­¥ ¢ 䮪ãá¥
@ -407,7 +404,6 @@ tl_info_set_undo:
mov eax,tl_ch_tim
cmp edx,ecx
jle @f
;if(node[i].tc>ch_tim){ // ¥á«¨ ᮧ¤ ­¨¥ ᨬ¢®«  ¡ë«® ®â¬¥­¥­®
cmp dword[edx+12],eax
jle .no_u1
@ -425,7 +421,6 @@ tl_info_set_undo:
add ebx, tl_data_nodes ;.perv
push dword[edx+4] ;node[node[i].next].perv=node[i].perv;
pop dword[ebx+4]
.no_u1:
;else if(node[i].td>ch_tim) node[i].td=0; // ¥á«¨ 㤠«¥­¨¥ ᨬ¢®«  ¡ë«® ®â¬¥­¥­®
@ -433,19 +428,12 @@ tl_info_set_undo:
jle .no_u2
mov dword[edx+16],0
.no_u2:
call tl_move_next
jmp @b
@@:
mov tl_tim_undo,0
; mov eax,[edi+?] ;co_tim
; cmp tl_ch_tim,eax ;ch_tim
; jge @f
; mov [edi+?],0 ;co_tim
; @@:
pop edx ecx ebx eax
.no_work:
ret
;¢ë¢®¤ ᯨ᪠ ­  íªà ­
@ -522,8 +510,7 @@ proc tl_draw, tlist:dword
jle .end_draw
inc eax
cmp eax,dword[esi+sb_offs_position]
jge .end_c1
jmp @b
jl @b
.end_c1:
xor eax,eax
@ -544,7 +531,6 @@ proc tl_draw, tlist:dword
cmp edi,0 ;¤«ï ⮣® çâ®-¡ë ¥£® ­¥ ¯à¨è«®áì à¨á®¢ âì ¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥
je .end_draw ;¥á«¨ ­¥â áªà®««¨­£  ¢ë室¨¬
stdcall scroll_bar_vertical.draw, edi
.end_draw:
popad
ret
@ -854,7 +840,6 @@ proc tl_draw_null_cursor uses eax ebx ecx edx esi
call tl_get_display_cur_pos ;eax = cursor pos in screen
cmp eax,0
jl .end_f ;ªãàá®à ­ å®¤¨âáï ¢ëè¥ ®ª­ , ¢ ®¡« á⨠¯à®ªàã祭­®© áªà®««¨­£®¬
mov ebx,tl_box_left
shl ebx,16
mov bx,tl_img_cx
@ -875,10 +860,7 @@ proc tl_draw_null_cursor uses eax ebx ecx edx esi
jge @f
mov cx,si ;¥á«¨ ªãàá®à ¢¨¤¥­ ç áâ¨ç­® (¯®¯ « ­  ­¨¦­îî £à ­¨æã)
@@:
mov edx,tl_col_bkg
mcall 13 ;à¨á㥬 ¯à®á⮩ ¯àאַ㣮«ì­¨ª á ä®­®¢ë¬ 梥⮬
mcall 13,,,tl_col_bkg ;à¨á㥬 ¯à®á⮩ ¯àאַ㣮«ì­¨ª á ä®­®¢ë¬ 梥⮬
.end_f:
ret
endp
@ -903,7 +885,7 @@ tl_get_display_cur_pos:
;à¨áã¥â 㧥« á: ª à⨭ª®©, ¯®¤¯¨áìî, ¨ª®­ª®© ®âªàëâ¨ï/§ ªàëâ¨ï ¨ «¨­¨ï¬¨ ª த¨â. 㧫ã
;input:
; eax = node position
; eax = node position (0, ..., max_nodes-scroll_pos) ­¥ ¤® tl_box_height/tl_img_cy
; edx = pointer to some node struct
; edi = pointer to 'TreeList' struct
; esi = coord of bottom border
@ -923,8 +905,9 @@ proc tl_draw_node uses eax ebx ecx edx esi
xor ecx,ecx
mov cx,tl_img_cy
imul ecx,eax
add ecx,tl_box_top
add cx,tl_capt_cy
jc .end_draw ;ª®£¤  ¬­®£® 㧫®¢, â® ¬®¦¥â ¡ëâì ¯¥à¥¯®«­¥­¨¥ ª®®à¤¨­ âë cx
add ecx,tl_box_top
;crop image if on the border
cmp esi,ecx ;¥á«¨ 㧥« ¢­¨§ã ¨ ¥£® ¢®®¡é¥ ­¥ ¢¨¤­®
@ -1007,8 +990,7 @@ proc tl_draw_node_icon_opn_clo uses eax ebx ecx edx esi
ror ebx,16
cmp tl_data_img_sys,0
jne .draw_img_s
mov edx,tl_col_txt
mcall 13 ;draw minus rect, if not system icons
mcall 13,,,tl_col_txt ;draw minus rect, if not system icons
jmp @f
.draw_img_s:
mov ecx,esi ;load ecx
@ -1042,9 +1024,6 @@ tl_draw_node_icon_par_lin:
push eax ebx ecx edx esi
cmp al,0
je @f
; dec al
; call tl_iterat_perv ;get perv visible item
call tl_iterat_next_all ;get next visible item
cmp edx,ecx
jle .line3 ;if end of list
@ -1062,11 +1041,9 @@ tl_draw_node_icon_par_lin:
ror ebx,16
cmp tl_data_img_sys,0
jne .draw_img_s
mov edx,tl_col_txt
mcall 13 ;draw minus rect, if not system icons
mcall 13,,,tl_col_txt ;draw minus rect, if not system icons
jmp @f
.draw_img_s:
; mov ecx,esi ;load ecx
mov edx,ebx
ror ecx,16
mov dx,cx
@ -1076,8 +1053,6 @@ tl_draw_node_icon_par_lin:
imul bx,tl_img_cx
imul bx,tl_img_cy
; shr eax,8
; and eax,0xff
imul ebx,eax ;eax = icon index
add ebx,tl_data_img_sys
mcall 7 ;draw line icon
@ -1089,18 +1064,16 @@ tl_draw_node_icon_par_lin:
;input:
; al = ã஢¥­ì í«¥¬¥­â 
; ebx = (node.left shl 16) + tl_img_cx
; ecx = pointer to 1 node struct
; edx = pointer to some node struct
; edi = pointer to 'TreeList' struct
align 4
tl_draw_node_icon_par_lin_up:
push eax ebx ecx edx
push esi
proc tl_draw_node_icon_par_lin_up uses eax ebx ecx edx esi
cmp tl_data_img_sys,0 ;if not image
je @f
cmp al,0
je @f
xor esi,esi ;¢ si ¡ã¤¥¬ ­ áç¨â뢠âì ª®«-¢® ¨ª®­®ª, ­ã¦­ëå ¤«ï ¯à®à¨á®¢ª¨ «¨­¨¨
;--- 横« ¤«ï ¢ëç¨á«¥­¨ï ª®««¨ç¥á⢠ ¢¥à⨪ «ì­ëå «¨­¨© ---
.cycle0:
@ -1149,9 +1122,8 @@ tl_draw_node_icon_par_lin_up:
sub esi,0x10000 ;㬥­ìè ¥¬ áç¥â稪 ¨ª®­®ª
jmp .cycle1
@@:
pop esi
pop edx ecx ebx eax
ret
endp
;input:
; edi = pointer to TreeInfo struct
@ -1176,14 +1148,11 @@ tl_get_rows_count:
; edx = pointer to some node struct
; edi = pointer to TreeInfo struct
align 4
tl_draw_node_caption:
push ebx ecx edx esi
proc tl_draw_node_caption uses ebx ecx edx esi
xor esi,esi
mov si,tl_info_size
cmp si,tl_info_capt_offs
jle @f ;if caption size <= 0
push eax
call tl_get_node_index ;eax = node index
imul esi,eax
@ -1195,7 +1164,7 @@ tl_draw_node_caption:
shr ebx,16
add bx,tl_img_cx ;ᤢ¨£ ¥¬ ­ ¤¯¨áì ¯® £®à¨§®­â «¨ --->
add bx,3 ;®âáâã¯
;bx = coord. x
;bx = coord.x
call tl_strlen ;eax = strlen
call tl_get_draw_text_len
mov cx,bx
@ -1205,11 +1174,10 @@ tl_draw_node_caption:
sub bx,9 ;®â­¨¬ ¥¬ ¢ëá®âã ⥪áâ 
mov ecx,tl_col_txt
and ecx,0xffffff
; or ecx,0x80000000 ;text is ASCIIZ
mcall 4
@@:
pop esi edx ecx ebx
ret
endp
;input:
; eax = strlen
@ -1217,10 +1185,8 @@ tl_draw_node_caption:
;output:
; esi = text len
align 4
tl_get_draw_text_len:
push eax ecx edx
proc tl_get_draw_text_len uses eax ecx edx
mov esi,eax ;¡¥à¥¬ ¤«¨­­ã áâப¨
mov eax,tl_box_left
add eax,tl_box_width
cmp eax,ebx
@ -1229,7 +1195,6 @@ tl_get_draw_text_len:
xor edx,edx
mov ecx,6 ;è¨à¨­  á¨á⥬­®£® èà¨äâ 
div ecx ;ᬮâਬ ᪮«ìª® ᨬ¢®«®¢ ¬®¦¥â ¯®¬¥áâ¨âìáï ­  íªà ­¥
cmp esi,eax
jl @f
mov esi,eax ;¥á«¨ ¤«¨­­  ⥪áâ  ¬¥­ìè¥, 祬 ¢á¥ ¬¥áâ® ¯®¤ áâபã
@ -1237,8 +1202,8 @@ tl_get_draw_text_len:
.text_null:
xor esi,esi
@@:
pop edx ecx eax
ret
endp
;input:
; esi = pointer to string
@ -1291,10 +1256,9 @@ proc tl_node_add uses eax ebx ecx edx edi, tlist:dword, n_opt:dword, n_info:dwor
mov ecx,dword[n_opt]
ror ecx,16 ;cx = type
mov word[edx],cx
;;;mov cl,byte[ebp+13]
rol ecx,8 ;cl = close|open
mov byte[edx+3],cl ;node[i].clo
mov byte[edx+2], 0 ;node[i].lev=0
mov byte[edx+2],0 ;node[i].lev=0
bt tl_style,2 ;tl_list_box_mode
jc .l_box_m
mov cl,byte[n_opt]
@ -1302,7 +1266,7 @@ proc tl_node_add uses eax ebx ecx edx edi, tlist:dword, n_opt:dword, n_info:dwor
.l_box_m:
push tl_ch_tim ;node[i].tc=ch_tim;
pop dword[edx+12]
mov dword[edx+4], eax ;node[i].perv=po_t;
mov [edx+4],eax ;node[i].perv=po_t;
;*** copy node data ***
push esi
xor ecx,ecx
@ -1340,13 +1304,12 @@ proc tl_node_add uses eax ebx ecx edx edi, tlist:dword, n_opt:dword, n_info:dwor
imul ecx,sizeof.TreeList
add ecx,tl_data_nodes ; *** ecx = node[po_t] ***
add ecx,8 ; *** ecx = node[po_t].next ***
push dword [ecx] ;node[i].next=node[po_t].next;
pop dword [edx+8]
push dword[ecx] ;node[i].next=node[po_t].next;
pop dword[edx+8]
call tl_get_node_index ;*** eax = i ***
cmp eax,tl_info_max_count
jge .u0
mov [ecx],eax ;node[po_t].next=i; // áá뫪¨ ¯¥à¥­ ¯à ¢«ï¥¬
mov ecx,[edx+8] ; *** ecx = node[i].next ***
imul ecx,sizeof.TreeList
@ -1376,13 +1339,12 @@ proc tb_scrol_resize uses eax ecx edx
jg .ye_sb
xor ecx,ecx
.ye_sb:
mov edx,tl_p_scroll
mov dword[edx+sb_offs_cur_area],eax
mov dword[edx+sb_offs_max_area],ecx
stdcall scroll_bar_vertical.draw,edx
@@:
ret
ret
endp
;input:
@ -1421,7 +1383,6 @@ proc tl_node_set_data uses eax ecx edx edi esi, tlist:dword, n_info:dword
dec esi
mov byte[esi],0 ;®¡­ã«ï¥¬ ¯®á«¥¤­¨© ᨬ¢®« ¯®¤¯¨á¨, çâ®-¡ë ­¥ £«î稫® ¥á«¨ ¯®«ì§®¢ â¥«ì § ¤ « ­¥¯à ¢¨«ì­ãî áâàãªâãàã
.no_text_data:
@@:
ret
endp
@ -1608,7 +1569,6 @@ align 4
proc tl_cur_next uses eax ebx edi esi, tlist:dword
mov edi,dword[tlist]
call tl_get_node_count ;eax = node count
;inc eax
cmp tl_cur_pos,eax
jge .no_redraw
mov esi,tl_box_top
@ -1625,7 +1585,6 @@ proc tl_cur_next uses eax ebx edi esi, tlist:dword
jl @f
inc dword[ebx+sb_offs_position]
stdcall scroll_bar_vertical.draw,ebx
stdcall tl_draw,dword[tlist] ;¯®«­ ï ¯¥à¥à¨á®¢ª  ®ª­ 
jmp .no_redraw
@@:
@ -1720,7 +1679,6 @@ proc tl_cur_page_up uses eax edi esi, tlist:dword
cmp tl_p_scroll,0 ;¥á«¨ ¥áâì 㪠§ â¥«ì ­  áªà®««¨­£
je .no_redraw
mov esi,tl_p_scroll
call tl_get_rows_count ;eax = rows count
@ -1758,10 +1716,8 @@ proc tl_cur_page_down uses eax ebx ecx edi esi, tlist:dword
;ebx - ¬ ªá. ¯®§¨æ¨ï ªãàá®à 
;ecx - ¬ ªá. ¯®§¨æ¨ï áªà®««¨­£ 
mov edi,dword[tlist]
cmp tl_p_scroll,0 ;¥á«¨ ¥áâì 㪠§ â¥«ì ­  áªà®««¨­£
je .no_redraw
mov esi,tl_p_scroll
call tl_get_node_count ;eax = node count
mov ebx,eax
@ -1783,13 +1739,11 @@ proc tl_cur_page_down uses eax ebx ecx edi esi, tlist:dword
jl @f
jmp .no_redraw
@@:
add tl_cur_pos,eax ;¯¥à¥¬¥é ¥¬ ªãàá®à
cmp tl_cur_pos,ebx
jl @f
mov tl_cur_pos,ebx
@@:
add dword[esi+sb_offs_position],eax ;¯¥à¥¬¥é ¥¬ áªà®««¨­£
cmp dword[esi+sb_offs_position],ecx
jl @f
@ -1979,7 +1933,6 @@ tl_node_move_po6:
;ecx = ?
align 4
tl_node_move_po8:
; push ecx
mov ecx,edx ;save node pointer
call tl_move_perv
mov dword[edx+8],ebx
@ -1993,7 +1946,6 @@ tl_node_move_po8:
call tl_move_next
mov dword[edx+4],eax
mov edx,ecx ;restore node pointer
; pop ecx
;+4 perv
mov eax,dword[edx+4]
@ -2291,7 +2243,7 @@ align 4
xor edx,edx ;®ç¨áâ¨âì edx
div ecx ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
push edx ;¯®«®¦¨âì ¢ á⥪
call .str;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
call .str ;¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
pop eax
@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
or al,0x30 ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥