From df6f93e4eb4768abc0e9434ef869831bd4436c83 Mon Sep 17 00:00:00 2001 From: Rus Date: Sun, 29 Jul 2007 02:06:58 +0000 Subject: [PATCH] 4.0.5 (Rus) bug-fixes: - correct call save-dialog for saving new files or files from folder of tinypad new features: - added prompt to save file before closing - added close tab button git-svn-id: svn://kolibrios.org@595 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/tinypad/trunk/tinypad.asm | 6 +++++ programs/develop/tinypad/trunk/tp-dialog.asm | 19 +++++++++++++++- programs/develop/tinypad/trunk/tp-draw.asm | 23 ++++++++++++++++++++ programs/develop/tinypad/trunk/tp-key.asm | 22 ++++++++++++++++--- programs/develop/tinypad/trunk/tp-locale.inc | 9 ++++++++ programs/develop/tinypad/trunk/tp-tabctl.asm | 4 ++-- 6 files changed, 77 insertions(+), 6 deletions(-) diff --git a/programs/develop/tinypad/trunk/tinypad.asm b/programs/develop/tinypad/trunk/tinypad.asm index 17ee3bad58..fac3ea2463 100644 --- a/programs/develop/tinypad/trunk/tinypad.asm +++ b/programs/develop/tinypad/trunk/tinypad.asm @@ -22,6 +22,10 @@ ; 4.0.5 (mike.dld and Rus) ; bug-fixes: ; - a new tab is created when opening a file from folder of tinypad +; - correct call save-dialog for saving new files or files from folder of tinypad +; new features: +; - added prompt to save file before closing +; - added close tab button ; 4.0.4 (mike.dld) ; bug-fixes: ; - statusbar contained hint after dialog operation cancelled @@ -613,6 +617,7 @@ accel_table2 dd \ 'HSG',btn.hscroll_down ,\ 'TBL',btn.tabctl_right ,\ 'TBG',btn.tabctl_left ,\ + 177 , key.ctrl_f4 ,\ ; close current tab button 0 accel_table2_botdlg dd \ @@ -621,6 +626,7 @@ accel_table2_botdlg dd \ 20002,btn.bot.opensave ,\ 20003,btn.bot.find ,\ 20004,btn.bot.appearance,\ + 20007, btn.bot.no ,\ 21001,btn.bot.tabpos ,\ 0 diff --git a/programs/develop/tinypad/trunk/tp-dialog.asm b/programs/develop/tinypad/trunk/tp-dialog.asm index 4e76e859a3..463777a91a 100644 --- a/programs/develop/tinypad/trunk/tp-dialog.asm +++ b/programs/develop/tinypad/trunk/tp-dialog.asm @@ -160,7 +160,15 @@ osdlg_handler: push 20001 s_2cancel s_2cancel.size call define_3d_button - mov ebp,tb_opensave + cmp [bot_dlg_mode2], 2 ; exit-save dialog + jne @f + + sub ebx,(6*(s_2save_no.size+2)+3)*65536 + mov bx,6*(s_2save_no.size+2) + push 20007 s_2save_no s_2save_no.size + call define_3d_button + + @@: mov ebp,tb_opensave mov eax,[p_info.client_box.width] sub eax,6*(s_2filename.size+1)+1 add eax,6*(s_2filename.size+1)*65536 @@ -604,6 +612,15 @@ botdlg.button: call drawwindow ret + btn.bot.no: + call key.ctrl_f4.close + xor eax,eax + mov [bot_mode],al + mov [bot_dlg_height],eax + mov [s_status],eax + call drawwindow + ret + btn.bot.find: movzx ecx,[tb_find.length] mov [s_search.size],ecx diff --git a/programs/develop/tinypad/trunk/tp-draw.asm b/programs/develop/tinypad/trunk/tp-draw.asm index 981d0045fa..959de35ec6 100644 --- a/programs/develop/tinypad/trunk/tp-draw.asm +++ b/programs/develop/tinypad/trunk/tp-draw.asm @@ -197,7 +197,30 @@ func draw_main_menu ;///////////////////////////////////////////////////////// jmp @b .exit: + mov eax, 8 + mov bx, word [mainwnd_pos.w] + sub bx, 25 + shl ebx, 16 + add ebx, 12 + + mov ecx, 3 * 65536 + 12 + mov edx, 177 + mov esi, 0x00bcbec6 + int 0x40 + + ;mov eax, 4 + shr eax, 1 + sub ebx, -4 * 65536 + mov bx, 6 + mov ecx, 0 + mov edx, cross + mov esi, 1 + int 0x40 + ret + +cross: + db 'X' endf ;----------------------------------------------------------------------------- diff --git a/programs/develop/tinypad/trunk/tp-key.asm b/programs/develop/tinypad/trunk/tp-key.asm index 8fa3c56c34..1aeb87eacc 100644 --- a/programs/develop/tinypad/trunk/tp-key.asm +++ b/programs/develop/tinypad/trunk/tp-key.asm @@ -130,8 +130,14 @@ func key.ctrl_o ;///// ENTER OPEN FILENAME /////////////////////////////////// mov [bot_dlg_mode2],0 .direct: + cmp [bot_dlg_mode2], 2 + je .ask mov [s_status],s_enter_filename + jmp .ask1 + .ask: + mov [s_status],s_ask_save + .ask1: mov [bot_mode],1 mov [bot_dlg_height],16*2+4*2-1 mov [bot_dlg_handler],osdlg_handler @@ -148,8 +154,8 @@ endf ;----------------------------------------------------------------------------- func key.ctrl_s ;///// ENTER SAVE FILENAME /////////////////////////////////// ;----------------------------------------------------------------------------- - cmp [cur_editor.FilePath],'/' - jne key.shift_ctrl_s + cmp [cur_editor.FilePath], 0 + je key.shift_ctrl_s cmp [cur_editor.Modified],0 je .exit call save_file @@ -1486,11 +1492,17 @@ endf ;----------------------------------------------------------------------------- func key.ctrl_f4 ;///// CLOSE CURRENT TAB //////////////////////////////////// ;----------------------------------------------------------------------------- + cmp [cur_editor.Modified], 0 + je .close + mov [bot_dlg_mode2], 2 + jmp key.ctrl_o.direct + .close: mov [do_not_draw],1 push [tab_bar.Current.Ptr] cmp [tab_bar.Items.Count],1 jne @f - call create_tab + ;call create_tab + jmp key.alt_x.close ; close program @@: pop ebp call delete_tab dec [do_not_draw] @@ -1564,7 +1576,11 @@ func key.alt_x ;///// EXIT PROGRAM /////////////////////////////////////////// mov [f_info70+21],f_info.path mcall 70,f_info70 + .bgn_rp: + call key.ctrl_f4 .close: + cmp [tab_bar.Items.Count],1 + jne .bgn_rp mov [main_closed],1 mcall -1 endf diff --git a/programs/develop/tinypad/trunk/tp-locale.inc b/programs/develop/tinypad/trunk/tp-locale.inc index 7b976c5673..c22ccede0c 100644 --- a/programs/develop/tinypad/trunk/tp-locale.inc +++ b/programs/develop/tinypad/trunk/tp-locale.inc @@ -174,6 +174,10 @@ lsz s_2save,\ ru,'Сохранить',\ en,'Save',\ et,'Salvesta' +lsz s_2save_no,\ + ru,'Нет',\ + en,'No',\ + et,'No' lsz s_2find,\ ru,'Найти',\ en,'Find',\ @@ -202,6 +206,11 @@ lsz s_enter_filename,\ en,<'Enter filename',0>,\ et,<'Sisesta failinimi',0> +lsz s_ask_save,\ + ru,<'Желаете сохранить?',0>,\ + en,<'Would you like to save?',0>,\ + et,<'Gradite conservare?',0> ; May be incorrect + lsz s_enter_text_to_find,\ ru,<'Введите текст для поиска',0>,\ en,<'Enter text to find',0>,\ diff --git a/programs/develop/tinypad/trunk/tp-tabctl.asm b/programs/develop/tinypad/trunk/tp-tabctl.asm index da1e24a40e..ec5bdcce1e 100644 --- a/programs/develop/tinypad/trunk/tp-tabctl.asm +++ b/programs/develop/tinypad/trunk/tp-tabctl.asm @@ -108,10 +108,10 @@ func create_tab ;///// ADD TAB TO THE END //////////////////////////////////// rep stosb mov esi,s_defname - mov edi,cur_editor.FilePath + mov edi,cur_editor.FilePath + 1 mov ecx,s_defname.size rep movsb - mov [cur_editor.FileName],0 + mov [cur_editor.FileName],1 mov [cur_editor.Modified],0 mov [cur_editor.AsmMode],0