box_lib.obj: add scroll type 1

git-svn-id: svn://kolibrios.org@2317 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2011-11-15 13:23:09 +00:00
parent e1ef1272a2
commit 4a1dd808d9
3 changed files with 187 additions and 15 deletions

View File

@ -124,6 +124,117 @@ lib_init:
ret
align 4
proc draw_edge uses eax ebx ecx edx edi esi, box_l:dword, box_t:dword, box_w:dword, box_h:dword,\
col_0:dword, col_1:dword, col_2:dword
mov esi,dword[col_1]
and esi,111111101111111011111110b
mov eax,13
;bottom line
mov edx,dword[col_2]
mov ebx,dword[box_l]
shl ebx,16
add ebx,dword[box_w]
inc ebx ;äëÿ çàëèâêè äèàãîíàëüíûõ ïèêñåëåé
mov ecx,dword[box_t]
add ecx,dword[box_h]
shl ecx,16
inc ecx
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move up and ->...<-
sub ecx,1 shl 16 ;move up
add ebx,1 shl 16 ;->...
sub ebx,2 ;...<-
;draw line
int 0x40
dec edi
jnz @b
;right line
mov edx,dword[col_2]
mov ebx,dword[box_l]
add ebx,dword[box_w]
shl ebx,16
inc ebx
mov ecx,dword[box_t]
shl ecx,16
add ecx,dword[box_h]
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move left and ...
sub ebx,1 shl 16 ;move left
add ecx,1 shl 16
sub ecx,2
;draw line
int 0x40
dec edi
jnz @b
;top line
mov edx,dword[col_0]
mov ebx,dword[box_l]
shl ebx,16
add ebx,dword[box_w]
mov ecx,dword[box_t]
shl ecx,16
inc ecx
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move down and ->...<-
add ecx,1 shl 16 ;move down
add ebx,1 shl 16 ;->...
sub ebx,2 ;...<-
;draw line
int 0x40
dec edi
jnz @b
;left line
mov edx,dword[col_0]
mov ebx,dword[box_l]
shl ebx,16
inc ebx
mov ecx,dword[box_t]
shl ecx,16
add ecx,dword[box_h]
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move left and ...
add ebx,1 shl 16 ;move left
add ecx,1 shl 16
sub ecx,2
;draw line
int 0x40
dec edi
jnz @b
ret
endp
align 16
EXPORTS:

View File

@ -442,6 +442,20 @@ draw_up_arrow_vertical
;*********************************
draw_runner_center_vertical
;*********************************
cmp word sb_type,1
jne @f
push eax ebx ecx edx
movzx eax,word sb_start_x
xor ebx,ebx
add bx,sb_r_start_y
dec ebx
movzx ecx,word sb_size_x
mov edx,sb_run_size
dec edx
;à¨á®¢ ­¨¥ á⨫쭮© à ¬ª¨ ­  ¯®«§ã­ª¥
stdcall draw_edge, eax,ebx,ecx,edx, sb_bckg_col, sb_frnt_col, sb_line_col
pop edx ecx ebx eax
@@:
shr ecx,16
add ecx,sb_run_size
sub ecx,2
@ -501,6 +515,21 @@ draw_down_arrow_vertical
cmp dword sb_all_redraw,0
je @f
int 0x40 ; bottom button - extreme line
cmp word sb_type,1
jne @f
movzx eax,word sb_start_x
movzx ebx,word sb_start_y
movzx ecx,word sb_size_x
;à¨á®¢ ­¨¥ á⨫쭮© à ¬ª¨ ­  ¢¥àå­¥© ª­®¯ª¥
stdcall draw_edge, eax,ebx,ecx,sb_btn_high,\
sb_bckg_col, sb_frnt_col, sb_line_col
add bx,sb_size_y
sub ebx,sb_btn_high
dec ebx
;à¨á®¢ ­¨¥ á⨫쭮© à ¬ª¨ ­  ­¨¦­¥© ª­®¯ª¥
stdcall draw_edge, eax,ebx,ecx,sb_btn_high,\
sb_bckg_col, sb_frnt_col, sb_line_col
@@:
popa
ret
@ -966,6 +995,22 @@ draw_up_arrow_horizontal
;*********************************
draw_runner_center_horizontal
;*********************************
cmp word sb_type,1
jne @f
push eax ebx ecx edx
xor eax,eax
add ax,sb_r_start_x
dec eax
movzx ebx,word sb_start_y
mov ecx,sb_run_size
dec ecx
movzx edx,word sb_size_y
;à¨á®¢ ­¨¥ á⨫쭮© à ¬ª¨ ­  ¯®«§ã­ª¥
stdcall draw_edge, eax,ebx,ecx,edx,\
sb_bckg_col, sb_frnt_col, sb_line_col
pop edx ecx ebx eax
@@:
shr ebx,16
add ebx,sb_run_size
sub ebx,2
@ -1025,6 +1070,22 @@ draw_down_arrow_horizontal
cmp dword sb_all_redraw,0
je @f
int 0x40 ; bottom button - extreme line
cmp word sb_type,1
jne @f
;à¨á®¢ ­¨¥ á⨫쭮© à ¬ª¨ ­  «¥¢®© ª­®¯ª¥
movzx eax,word sb_start_x
movzx ebx,word sb_start_y
movzx edx,word sb_size_y
stdcall draw_edge, eax,ebx,sb_btn_high,edx,\
sb_bckg_col, sb_frnt_col, sb_line_col
movzx eax,word sb_start_x
add ax,sb_size_x
sub eax,sb_btn_high
dec eax
;à¨á®¢ ­¨¥ á⨫쭮© à ¬ª¨ ­  ¯à ¢®© ª­®¯ª¥
stdcall draw_edge, eax,ebx,sb_btn_high,edx,\
sb_bckg_col, sb_frnt_col, sb_line_col
@@:
popa
ret

View File

@ -46,11 +46,11 @@ tl_data_init: ;
mov eax,tl_p_scrol
;*** öâåòîâûå íàñòðîéêè ***
mov ecx,tl_col_bkg
mov dword[eax+28],ecx ;+28 .bckg_col
mov dword[eax+sb_offs_bckg_col],ecx
mov ecx,tl_col_zag
mov dword[eax+32],ecx ;+32 .frnt_col
mov dword[eax+sb_offs_frnt_col],ecx
mov ecx,tl_col_txt
mov dword[eax+36],ecx ;+32 .line_col
mov dword[eax+sb_offs_line_col],ecx
;*** íàñòðîéêè ðàçìåðîâ ***
mov ecx,tl_box_left
add ecx,tl_box_width
@ -107,7 +107,7 @@ tl_info_clear: ;
cmp tl_p_scrol,0 ;îáðàáîòêà ñêðîëëèíãà
je @f
mov eax,tl_p_scrol
mov dword[eax+24],0 ;+24 .position
mov dword[eax+sb_offs_position],0
call tb_scrol_resize
@@:
pop edi ecx eax
@ -324,19 +324,19 @@ tl_mouse: ;
cmp eax,ebx ;ïðàâàÿ ãðàíèöà îêíà
jg .no_in_wnd
mov eax,dword[edx+16] ;+16 .max_area
cmp eax,dword[edx+20] ;+20 .cur_area
mov eax,dword[edx+sb_offs_max_area]
cmp eax,dword[edx+sb_offs_cur_area]
jbe .no_in_wnd ;âñå óçëû ïîïàäàþò â îêíî ñêðîëëèíãà
push dword edx
call scroll_bar_vertical.mouse ;scrollbar_ver_mouse
cmp dword[edx+40],0 ;+40 .redraw
cmp dword[edx+sb_offs_redraw],0
je @f
mov dword[edx+40],0 ;+40 .redraw
mov dword[edx+sb_offs_redraw],0
push dword edi
call tl_draw ;ïðîèçîøëè èçìåíåíèÿ ñêðîëëèíãà
@@:
cmp dword[edx+46],0 ;+46 .delta2
cmp dword[edx+sb_offs_delta2],0
jne .no_draw ;ïîïàëè íà ñêðîëëèíã - íå ñíèìàåì ôîêóñ ñ TreeList
;-------------------------------------------------------------------------------
.no_in_wnd: ;íå ïîïàëè â îêíî - ïîòåðÿ ôîêóñà (ïðè óñëîâèè ÷òî ôîêóñ áûë íà äàííîì ýåëåìåíòå)
@ -1396,8 +1396,8 @@ tb_scrol_resize:
.ye_sb:
mov edx,tl_p_scrol
mov dword[edx+20],eax ;+20 .cur_area
mov dword[edx+16],ecx ;+16 .max_area
mov dword[edx+sb_offs_cur_area],eax
mov dword[edx+sb_offs_max_area],ecx
push dword edx ;pointer to scroll struct
call scroll_bar_vertical.draw
@@:
@ -1658,10 +1658,10 @@ tl_cur_next: ;
je @f
call tl_get_rows_count ;eax = rows count
mov ebx,tl_p_scrol
add eax,dword[ebx+24] ;.position +24
add eax,dword[ebx+sb_offs_position]
cmp tl_cur_pos,eax
jl @f
inc dword[ebx+24] ;.position +24
inc dword[ebx+sb_offs_position]
push dword ebx
call scroll_bar_vertical.draw
@ -2169,7 +2169,7 @@ tl_save_mem:
;copy scroll position
mov edx,tl_p_scrol
mov eax,dword[edx+24] ;+24 .position
mov eax,dword[edx+sb_offs_position]
mov dword[esi+22],eax
add esi,tl_save_load_heder_size ;add header size
@ -2300,7 +2300,7 @@ add esi,ebx
mov ebx,tl_p_scrol
cmp ebx,0
je .end_f
mov dword[ebx+24],eax ;+24 .position
mov dword[ebx+sb_offs_position],eax
push dword ebx ;pointer to scroll struct
call scroll_bar_vertical.draw