Opendial and File Browser control

1) Now shows the full value for the year
2) For ".." dir is not shown unnecessary data
3) Finding the end of section [icons16] for r7241

git-svn-id: svn://kolibrios.org@9728 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov 2022-02-23 14:36:48 +00:00
parent d9a89d8528
commit 267e818f50
2 changed files with 46 additions and 62 deletions

View File

@ -286,7 +286,7 @@ fb_draw_folder_data:
xor edx,edx xor edx,edx
div ebx div ebx
pop edx ebx pop edx ebx
sub eax,23+2+2 sub eax,23+2+2+2
mov esi,fb_file_name_length mov esi,fb_file_name_length
mov fb_temp_counter,0 mov fb_temp_counter,0
mov fb_display_name_max_length,eax mov fb_display_name_max_length,eax
@ -512,9 +512,9 @@ fb_draw_type_size_date:
align 4 align 4
.call_decimal_string: .call_decimal_string:
mov ebx,fb_type_table mov ebx,fb_type_table
add ebx,6 add ebx,9
call fb_decimal_string_4 call fb_decimal_string
mov [ebx],dl mov [ebx+1],dl
jmp .size_convert_end jmp .size_convert_end
;----------------------------------------- ;-----------------------------------------
.qword_div: .qword_div:
@ -592,32 +592,18 @@ align 4
@@: @@:
mov eax,ebx mov eax,ebx
mov ebx,fb_type_table mov ebx,fb_type_table
add ebx,6 add ebx,10
call fb_decimal_string_4 call fb_decimal_string
.size_convert_end: .size_convert_end:
mov eax,fb_type_table
add eax,6
push edi
cmp [eax],byte '0'
jne @f
mov [eax],byte ' '
@@:
add eax,3
@@:
cmp [eax+1],byte ' '
jne @f
mov esi,eax
mov edi,esi
inc edi
mov ecx,5
std
rep movsb
jmp @r
@@:
pop edi
pop edx ebx pop edx ebx
;----------------------------------------- ;-----------------------------------------
.date: .date:
cmp [edx],word '..'
jne @f
cmp [edx+2],byte 0
je .not_show_date
@@:
xor eax,eax xor eax,eax
mov al,[edx-40+28] mov al,[edx-40+28]
push ebx push ebx
@ -630,16 +616,14 @@ align 4
call fb_decimal_string_2 ; month call fb_decimal_string_2 ; month
mov ax,[edx-40+30] mov ax,[edx-40+30]
mov ebx,fb_type_table mov ebx,fb_type_table
add ebx,12+15 add ebx,12+9
call fb_decimal_string_4 ; year mov [ebx-3], dword '0000'
mov ebx,fb_type_table call fb_decimal_string ; year
mov ax,[ebx+12+15+2]
mov [ebx+12+6],ax
pop ebx pop ebx
;----------------------------------------- ;-----------------------------------------
ror ebx,16 ror ebx,16
add bx,fb_size_x add bx,fb_size_x
sub ebx,122+12+15 sub ebx,161 ; 122+12+15
rol ebx,16 rol ebx,16
mov ecx,fb_text_color mov ecx,fb_text_color
cmp fb_marked_file,0 cmp fb_marked_file,0
@ -647,7 +631,7 @@ align 4
mov ecx,fb_reduct_text_color mov ecx,fb_reduct_text_color
@@: @@:
mov edx,fb_type_table mov edx,fb_type_table
mov esi,20 mov esi,22
mov ax,fb_line_size_y mov ax,fb_line_size_y
sub ax,fb_font_size_y sub ax,fb_font_size_y
push ebx push ebx
@ -667,6 +651,7 @@ align 4
@@: @@:
mov edi,eax mov edi,eax
mcall SF_DRAW_TEXT mcall SF_DRAW_TEXT
.not_show_date:
popa popa
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
@ -754,32 +739,20 @@ fb_decimal_string_2:
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
fb_decimal_string_4: fb_decimal_string:
push eax ecx edx push eax ebx ecx edx
xor ecx,ecx mov ecx,10
mov [ebx],byte '0' ;--------------------------------------
inc ebx
.p3: .p3:
xor edx,edx xor edx,edx
push ebx div ecx
mov ebx,10
div ebx
pop ebx
add edx,48 add edx,48
push edx
inc ecx
cmp eax,0
jne .p3
cmp ecx,3
jbe .p4
mov ecx,4
dec ebx
.p4:
pop edx
mov [ebx],dl mov [ebx],dl
inc ebx dec ebx
loop .p4 test eax,eax
pop edx ecx eax jnz .p3
pop edx ecx ebx eax
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
@ -826,8 +799,8 @@ fb_get_icon_number:
add esi,ebp add esi,ebp
lodsb lodsb
cmp al,byte '=' cmp al,byte '='
jne .end
mov eax,ecx mov eax,ecx
jne .search_association
cmp eax,fb_ini_file_start cmp eax,fb_ini_file_start
je @f je @f
dec eax dec eax

View File

@ -1966,8 +1966,22 @@ convert_icons:
calc_ini: calc_ini:
mov eax,[image_file] mov eax,[image_file]
mov [file_browser_data_1.ini_file_start],eax mov [file_browser_data_1.ini_file_start],eax
add eax,[img_size]
mov [file_browser_data_1.ini_file_end],eax mov edi,eax
add edi,[img_size]
dec edi
mov esi,eax
add esi,9 ; after [icons16]
cld
@@:
lodsb
cmp esi,edi
je @f
cmp al,byte '['
jne @r
@@:
mov [file_browser_data_1.ini_file_end],esi
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
load_ini: load_ini:
@ -3174,10 +3188,7 @@ features_table:
db '1023b ' db '1023b '
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
.date_table: .date_table:
db '00.00.00 00:00 ' db '00.00.0000 00:00 '
;---------------------------------------------------------------------
.year_table:
db ' '
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
example_name_temp: example_name_temp:
db 'temp1.asm',0 db 'temp1.asm',0