Ftpc: icons are taken from @reshare
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 24s
Build system / Build (pull_request) Successful in 4m39s

This commit is contained in:
2025-04-01 15:12:07 +03:00
parent 929a75f751
commit 011e17de7c
5 changed files with 93 additions and 31 deletions

View File

@@ -49,8 +49,6 @@ img_files = {
{"MEDIA/IMGF/INVSOL.OBJ", "common/media/ImgF/invSol.obj"}, {"MEDIA/IMGF/INVSOL.OBJ", "common/media/ImgF/invSol.obj"},
{"MEDIA/PIXIESKN.PNG", SRC_PROGS .. "/cmm/pixie2/pixieskn.png"}, {"MEDIA/PIXIESKN.PNG", SRC_PROGS .. "/cmm/pixie2/pixieskn.png"},
{"NETWORK/FTPC.INI", SRC_PROGS .. "/network/ftpc/ftpc.ini"}, {"NETWORK/FTPC.INI", SRC_PROGS .. "/network/ftpc/ftpc.ini"},
{"NETWORK/FTPC_SYS.PNG", SRC_PROGS .. "/network/ftpc/ftpc_sys.png"},
{"NETWORK/FTPC_NOD.PNG", SRC_PROGS .. "/network/ftpc/ftpc_nod.png"},
{"NETWORK/FTPD.INI", "common/network/ftpd.ini"}, {"NETWORK/FTPD.INI", "common/network/ftpd.ini"},
{"NETWORK/KNMAP", "common/network/knmap"}, {"NETWORK/KNMAP", "common/network/knmap"},
{"NETWORK/USERS.INI", "common/network/users.ini"}, {"NETWORK/USERS.INI", "common/network/users.ini"},

View File

@@ -760,7 +760,7 @@ exit2:
; data ; data
str_title db 'FTP client for KolibriOS',0 str_title db 'FTP client for KolibriOS',0
str_welcome db 'FTP client for KolibriOS v0.16',10 str_welcome db 'FTP client for KolibriOS v0.18',10
db 10,0 db 10,0
str_srv_addr db 'Please enter ftp server address.',10,0 str_srv_addr db 'Please enter ftp server address.',10,0
@@ -971,6 +971,6 @@ param_path rb 1024
param_port rb 6 param_port rb 6
sc system_colors sc system_colors
rb 1024 rb 2048
mem: mem:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

View File

@@ -16,6 +16,8 @@ BT_SZ_X = 40
SYS_COL = 0xe6e6e6 SYS_COL = 0xe6e6e6
BT_COL = 0xcccccc BT_COL = 0xcccccc
STR_COL = 0x595959 ;0x000000 STR_COL = 0x595959 ;0x000000
ICON_TOP_B = 2
ICON_SIZE = 18*(18+ICON_TOP_B)*3
; TODO: automatic resizing of GUI elements on window resizing ; TODO: automatic resizing of GUI elements on window resizing
@@ -74,37 +76,36 @@ gui: ;//////////////////////////////////////////////////////////////////////////
; initialize tree list elements ; initialize tree list elements
stdcall [tl_data_init], tree1 stdcall [tl_data_init], tree1
stdcall [tl_data_init], tree2 stdcall [tl_data_init], tree2
or dword[tree1.style], 8 ;tl_cursor_pos_limited - restrict cursor move to existing nodes
or dword[tree2.style], 8 ;tl_cursor_pos_limited
; read icons
load_image_file 'ftpc_sys.png', icon_tl_sys
mov [filestruct.ptr], eax or dword[tree1.style], 8 ;tl_cursor_pos_limited - restrict cursor move to existing nodes
mov [filestruct.subfn], 0 or dword[tree2.style], 8 ;tl_cursor_pos_limited
mov [filestruct.offset], 54
mov [filestruct.size], ecx ; read icons
mcall SF_FILE, filestruct mcall SF_SYS_MISC, SSF_MEM_OPEN, str_icon_18,, 0
cmp ebx, 0 or eax, eax
jl @f jz @f
mov esi, eax
mov ecx, ICON_SIZE*11
mcall SF_SYS_MISC, SSF_MEM_ALLOC
mov ecx, eax
mov [icon_tl_sys], eax
stdcall copy_icon, eax,esi,31 ;active cursor
add eax, ICON_SIZE*3 ;skip not used icons
stdcall img_to_gray, ecx, eax, ICON_SIZE/3 ;not active cursor
m2m dword[tree1.data_img_sys], dword[icon_tl_sys] m2m dword[tree1.data_img_sys], dword[icon_tl_sys]
m2m dword[tree2.data_img_sys], dword[icon_tl_sys] m2m dword[tree2.data_img_sys], dword[icon_tl_sys]
@@:
; read nodes icon file ; read nodes icon file
load_image_file 'ftpc_nod.png', icon_tl_nod mov ecx, ICON_SIZE*2
mcall SF_SYS_MISC, SSF_MEM_ALLOC
mov [icon_tl_nod], eax
stdcall copy_icon, eax,esi,2
stdcall copy_icon, eax,esi,0
mov [filestruct.ptr], eax
;mov [filestruct.subfn], 0
;mov [filestruct.offset], 54
mov [filestruct.size], ecx
mcall SF_FILE, filestruct
cmp ebx, 0
jl @f
m2m dword[tree1.data_img], dword[icon_tl_nod] m2m dword[tree1.data_img], dword[icon_tl_nod]
m2m dword[tree2.data_img], dword[icon_tl_nod] m2m dword[tree2.data_img], dword[icon_tl_nod]
@@: @@:
call .draw call .draw
; create initial tree list for root_dir ; create initial tree list for root_dir
@@ -901,6 +902,67 @@ search: ;///////////////////////////////////////////////////////////////////////
pop edi esi edx ecx ebx pop edi esi edx ecx ebx
ret ret
align 4
proc copy_icon uses ecx esi edi, buf_d:dword, buf_s:dword, ind:dword
;;------------------------------------------------------------------------------------------------;;
;> buf_d = pointer to destination buffer
;> buf_s = pointer to source buffer (with icons)
;> ind = icon index
;;------------------------------------------------------------------------------------------------;;
;< eax = pointer to destination buffer + icon size
;;------------------------------------------------------------------------------------------------;;
mov edi, [buf_d]
mov ecx, 18*ICON_TOP_B*3
mov al, 0xff
rep stosb ; make top border
; copy icon
mov ecx, 18*18
mov esi, [ind]
imul esi, ecx
shl esi, 2
add esi, [buf_s]
@@:
movsw
movsb
inc esi
loop @b
mov eax, edi
ret
endp
;descrition:
; function for generating gray icons
;input:
; buf_rgb - buffer with input 24-bit color image
; buf_g24 - buffer with output 24-bit gray image
; pixels - number of pixels in the image
align 4
proc img_to_gray, buf_rgb:dword, buf_g24:dword, pixels:dword
pushad
mov esi, [buf_rgb]
mov edi, [buf_g24]
mov ecx, [pixels]
mov ebx, 3
@@:
movzx eax, byte[esi]
movzx edx, byte[esi+1]
add eax, edx
movzx edx, byte[esi+2]
add eax, edx
xor edx, edx
div ebx
mov ah, al
mov word[edi], ax
mov byte[edi+2], al
add esi, 3
add edi, 3
loop @b
popad
ret
endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;hed db 'FTP Client for KolibriOS',0 ;hed db 'FTP Client for KolibriOS',0
@@ -918,15 +980,17 @@ str_search db 'Search',0
str_list db 'LIST',0 str_list db 'LIST',0
str_null db 0 str_null db 0
str_icon_18 db 'ICONS18',0
;---------------------- ;----------------------
; tree list elements ; tree list elements
;---------------------- ;----------------------
tree1 tree_list 64, 500, tl_list_box_mode, 16, 16, \ tree1 tree_list 64, 500, tl_list_box_mode, 18, 18+ICON_TOP_B, \
0xffffff, BT_COL, 0x000000, TLIST1_X, 105, TLIST_SZ-16, 185, 14, 4,\ 0xffffff, BT_COL, 0x10000000, TLIST1_X, 105, TLIST_SZ-16, 185, 14, 4,\
0, el_focus, wScr, fun_on_enter 0, el_focus, wScr, fun_on_enter
tree2 tree_list 64, 500, tl_list_box_mode, 16, 16, \ tree2 tree_list 64, 500, tl_list_box_mode, 18, 18+ICON_TOP_B, \
0xffffff, BT_COL, 0x000000, TLIST2_X, 105, TLIST_SZ-16, 185, 14, 4, \ 0xffffff, BT_COL, 0x10000000, TLIST2_X, 105, TLIST_SZ-16, 185, 14, 4, \
0, el_focus, wScr2, fun_on_enter2 0, el_focus, wScr2, fun_on_enter2
; editbox for mkd ; editbox for mkd