Offline |
KSoC/GSoC Student |
Joined: Thu Mar 03, 2016 6:49 pm Posts: 42
|
The GUI for login screen has been finished (integration with FTPC is remaining). I have attached the code to run it as a standalone program. Any feedback regarding the design/code is welcome  Screenshot:  Code: Code: use32 org 0x0 db 'MENUET01' dd 0x1 dd start dd i_end dd mem dd mem dd 0x0 dd cur_dir_path
include 'macros.inc' include 'box_lib.mac' include 'load_lib.mac' @use_library ;use load lib macros start: ;universal load library/libraries sys_load_library library_name, cur_dir_path, library_path, system_path, \ err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i ;if return code =-1 then exit, else nornary work cmp eax,-1 jz exit mcall 40,0x27 ; set up a mask for expected events
red_win: call draw_window align 4 still: mcall 10 ; wait for event dec eax jz red_win dec eax jz key dec eax jz button
push dword edit_usr call [edit_box_mouse]
push dword edit_pass call [edit_box_mouse]
push dword edit_server call [edit_box_mouse]
push dword edit_port call [edit_box_mouse]
push dword edit_path call [edit_box_mouse]
jmp still
button: mcall 17 ; will be modified to submit the data entered on clicking ; 'connect' button test ah,ah jz still exit: mcall -1 key: mcall 2
push dword edit_usr call [edit_box_key]
push dword edit_pass call [edit_box_key]
push dword edit_server call [edit_box_key]
push dword edit_port call [edit_box_key]
push dword edit_path call [edit_box_key]
jmp still
align 4 draw_window: mcall 12,1 mcall 0,(320*65536+390),(300*65536+180),0x34AABBCC,0x805080DD,hed
push dword edit_usr call [edit_box_draw]
push dword edit_pass call [edit_box_draw]
push dword edit_server call [edit_box_draw]
push dword edit_port call [edit_box_draw]
push dword edit_path call [edit_box_draw]
call draw_button call draw_strings
mcall 12,2 ret
draw_button: mcall 8,<162,65>,<120,25>,2,0x007887a6 ; connect button ret
draw_strings: ; draw strings for boxes and buttons mcall 4,<3,5>,0xb0000000,gui_str_usr mcall 4,<3,25>,0xb0000000,gui_str_pass mcall 4,<3,45>,0xb0000000,gui_str_server mcall 4,<3,65>,0xb0000000,gui_str_port mcall 4,<3,85>,0xb0000000,gui_str_path mcall 4,<167,125>,0xb0ffffff,str_connect_button ret
system_path db '/sys/lib/' library_name db 'box_lib.obj',0
err_message_found_lib db 'cannot load library box_lib.obj',0 str_connect_button db 'Connect',0 gui_str_usr db 'Username:',0 gui_str_pass db 'Password:',0 gui_str_server db 'Server:',0 gui_str_port db 'Port:',0 gui_str_path db 'Path:',0
head_f_i: head_f_l db 'System error',0 err_message_import db 'Error on load import library box_lib.obj',0
myimport:
edit_box_draw dd aEdit_box_draw edit_box_key dd aEdit_box_key edit_box_mouse dd aEdit_box_mouse version_ed dd aVersion_ed
dd 0 dd 0
aEdit_box_draw db 'edit_box',0 aEdit_box_key db 'edit_box_key',0 aEdit_box_mouse db 'edit_box_mouse',0 aVersion_ed db 'version_ed',0
edit_usr edit_box 300,75,5, 0xffffff,0x6f9480,0,0xAABBCC,0,99,usr_buf,mouse_dd,ed_focus edit_pass edit_box 300,75,25,0xffffff,0x6a9480,0,0xAABBCC,0,99,pass_buf,mouse_dd,ed_pass edit_server edit_box 300,75,45,0xffffff,0x6a9480,0,0xAABBCC,0,99,host_buf,mouse_dd,ed_focus edit_port edit_box 50,75,65,0xffffff,0x6a9480,0,0xAABBCC,0,99,port_buf,mouse_dd,ed_focus edit_path edit_box 300,75,85,0xffffff,0x6a9480,0,0xAABBCC,0,99,path_buf,mouse_dd,ed_focus
hed db 'FTP Client',0 hed_end:
rb 256
usr_buf rb 100 pass_buf rb 100 host_buf rb 100 port_buf rb 100 path_buf rb 100
; sc system_colors
mouse_dd rd 1 p_info process_information cur_dir_path rb 4096 library_path rb 4096 i_end: rb 1024 mem:
Last edited by nisargshah95 on Thu Jun 02, 2016 12:49 pm, edited 3 times in total.
|
|