add save files Ctrl+S and Ctrl+Shift+S

git-svn-id: svn://kolibrios.org@7571 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2019-01-08 16:22:08 +00:00
parent 48512ae4ad
commit 6eefd8e3f5
8 changed files with 108 additions and 79 deletions

View File

@ -243,27 +243,33 @@ proc ted_key, edit:dword, table:dword, control:dword
cmp ah,24 ;Ctrl+O cmp ah,24 ;Ctrl+O
jne @f jne @f
cmp ted_fun_on_key_ctrl_o,0 cmp ted_fun_on_key_ctrl_o,0
je @f je .end_key_fun
call ted_fun_on_key_ctrl_o call ted_fun_on_key_ctrl_o
@@: @@:
cmp ah,31 ;Ctrl+S cmp ah,31 ;Ctrl+S
jne @f jne .end_ctrl_s
cmp ted_fun_on_key_ctrl_s,0 cmp ted_fun_on_key_ctrl_s,0
je @f je .end_key_fun
xor eax,eax
test esi,KM_SHIFT
jz @f
inc eax
@@:
call ted_fun_on_key_ctrl_s call ted_fun_on_key_ctrl_s
@@: jmp .end_key_fun
.end_ctrl_s:
cmp ah,33 ;Ctrl+F cmp ah,33 ;Ctrl+F
jne @f jne @f
cmp ted_panel_id,TED_PANEL_FIND cmp ted_panel_id,TED_PANEL_FIND
je @f je @f
cmp ted_fun_on_key_ctrl_f,0 cmp ted_fun_on_key_ctrl_f,0
je @f je .end_key_fun
call ted_fun_on_key_ctrl_f call ted_fun_on_key_ctrl_f
@@: @@:
cmp ah,49 ;Ctrl+N cmp ah,49 ;Ctrl+N
jne @f jne @f
cmp ted_fun_on_key_ctrl_n,0 cmp ted_fun_on_key_ctrl_n,0
je @f je .end_key_fun
call ted_fun_on_key_ctrl_n call ted_fun_on_key_ctrl_n
@@: @@:
; *** ¢ë§®¢ ¢­ãâ७­¨å ä㭪権 ; *** ¢ë§®¢ ¢­ãâ७­¨å ä㭪権

View File

@ -194,21 +194,24 @@ popad
ret ret
endp endp
;input:
; eax ¥á«¨ à ¢¥­: 0 - á®åà ­¥­¨¥ ¡¥§ ¤¨ «®£ , 1 - á®åà ­¥­¨¥ á ¤¨ «®£®¬
;description: ;description:
; äã­ªæ¨ï á®åà ­¥­¨ï ä ©«  ; äã­ªæ¨ï á®åà ­¥­¨ï ä ©« 
align 4 align 4
proc ted_but_save_file proc ted_but_save_file
;*** ¢ë§®¢ ¤¨ «®£®¢®£® ®ª­  ¤«ï á®åà ­¥­¨ï ä ©«  or eax,eax
.init_dlg: jnz .init_dlg
copy_path open_dialog_name,communication_area_default_path,file_name,0 ; á®å࠭塞 ¡¥§ ¢ë§®¢  ¤¨ «®£®¢®£® ®ª­ 
mov [OpenDialog_data.type],1
stdcall [OpenDialog_Start],OpenDialog_data
cmp [OpenDialog_data.status],1 ;if status==1 then save
jne .end_save
jmp @f
.no_dlg: ; á®å࠭塞 ¡¥§ ¢ë§®¢  ¤¨ «®£®¢®£® ®ª­ 
cmp byte[openfile_path],0 cmp byte[openfile_path],0
je .init_dlg ; ­® ¥á«¨ ¯ãâì ¯ãá⮩ â® ¢á¥-¦¥ ¢ë§ë¢ ¥¬ jne @f
.init_dlg:
; ¢ë§®¢ ¤¨ «®£®¢®£® ®ª­  ¤«ï á®åà ­¥­¨ï ä ©« 
copy_path open_dialog_name,communication_area_default_path,file_name,0
mov [OpenDialog_data.type],1
stdcall [OpenDialog_Start],OpenDialog_data
cmp [OpenDialog_data.status],1 ;if status==1 then save
jne .end_save
@@: @@:
stdcall [ted_save_file],tedit0,run_file_70,openfile_path stdcall [ted_save_file],tedit0,run_file_70,openfile_path
.end_save: .end_save:
@ -220,9 +223,9 @@ endp
align 4 align 4
proc mem_cpy uses ecx esi edi, destination:dword, source:dword, len:dword proc mem_cpy uses ecx esi edi, destination:dword, source:dword, len:dword
cld cld
mov esi, dword[source] mov esi,[source]
mov edi, dword[destination] mov edi,[destination]
mov ecx, dword[len] mov ecx,[len]
rep movsb rep movsb
ret ret
endp endp
@ -233,8 +236,8 @@ align 4
proc mem_spac uses eax ecx edi, mem:dword, len:dword proc mem_spac uses eax ecx edi, mem:dword, len:dword
cld cld
mov al,' ' mov al,' '
mov edi, dword[mem] mov edi,[mem]
mov ecx, dword[len] mov ecx,[len]
repne stosb repne stosb
ret ret
endp endp

File diff suppressed because one or more lines are too long

View File

@ -30,8 +30,15 @@ draw_but_toolbar: ;
@@: @@:
or ecx,0x40000000 or ecx,0x40000000
inc cx inc cx
bt word[panel_but+3],0 bt word[panel_but+3],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Save as
@@:
inc cx
bt word[panel_but+4],0
jnc @f jnc @f
add edx,30 shl 16 add edx,30 shl 16
call draw_but_icon ;Select word call draw_but_icon ;Select word
@ -43,14 +50,14 @@ draw_but_toolbar: ;
and ecx,0xffff and ecx,0xffff
@@: @@:
inc cx inc cx
bt word[panel_but+4],0 bt word[panel_but+5],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Cut call draw_but_icon ;Cut
@@: @@:
inc cx inc cx
bt word[panel_but+5],0 bt word[panel_but+6],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Copy call draw_but_icon ;Copy
@ -62,7 +69,7 @@ draw_but_toolbar: ;
and ecx,0xffff and ecx,0xffff
@@: @@:
inc cx inc cx
bt word[panel_but+6],0 bt word[panel_but+7],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Paste call draw_but_icon ;Paste
@ -70,21 +77,21 @@ draw_but_toolbar: ;
or ecx,0x40000000 or ecx,0x40000000
inc cx inc cx
bt word[panel_but+7],0 bt word[panel_but+8],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Found call draw_but_icon ;Found
@@: @@:
inc cx inc cx
bt word[panel_but+8],0 bt word[panel_but+9],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Replace call draw_but_icon ;Replace
@@: @@:
inc cx inc cx
bt word[panel_but+9],0 bt word[panel_but+10],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Key words call draw_but_icon ;Key words
@ -96,21 +103,21 @@ draw_but_toolbar: ;
and ecx,0xffff and ecx,0xffff
@@: @@:
inc cx inc cx
bt word[panel_but+10],0 bt word[panel_but+11],0
jnc @f jnc @f
add edx,30 shl 16 add edx,30 shl 16
call draw_but_icon ;Upper call draw_but_icon ;Upper
@@: @@:
inc cx inc cx
bt word[panel_but+11],0 bt word[panel_but+12],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Lower call draw_but_icon ;Lower
@@: @@:
inc cx inc cx
bt word[panel_but+12],0 bt word[panel_but+13],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Reverse call draw_but_icon ;Reverse
@ -123,7 +130,7 @@ draw_but_toolbar: ;
and ecx,0xffff and ecx,0xffff
@@: @@:
inc cx inc cx
bt word[panel_but+13],0 bt word[panel_but+14],0
jnc @f jnc @f
add edx,30 shl 16 add edx,30 shl 16
call draw_but_icon ;Undo call draw_but_icon ;Undo
@ -135,7 +142,7 @@ draw_but_toolbar: ;
and ecx,0xffff and ecx,0xffff
@@: @@:
inc cx inc cx
bt word[panel_but+14],0 bt word[panel_but+15],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;Redo call draw_but_icon ;Redo
@ -143,19 +150,12 @@ draw_but_toolbar: ;
or ecx,0x40000000 or ecx,0x40000000
inc cx inc cx
bt word[panel_but+15],0 bt word[panel_but+16],0
jnc @f jnc @f
add edx,30 shl 16 add edx,30 shl 16
call draw_but_icon ;Invisible on|off call draw_but_icon ;Invisible on|off
@@: @@:
inc cx
bt word[panel_but+16],0
jnc @f
add edx,25 shl 16
call draw_but_icon
@@:
inc cx inc cx
bt word[panel_but+17],0 bt word[panel_but+17],0
jnc @f jnc @f
@ -165,13 +165,20 @@ draw_but_toolbar: ;
inc cx inc cx
bt word[panel_but+18],0 bt word[panel_but+18],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Ïîäñâåòêà âêë|âûêë
@@:
inc cx
bt word[panel_but+19],0
jnc @f jnc @f
add edx,30 shl 16 add edx,30 shl 16
call draw_but_icon ;cp 1251 -> 866 call draw_but_icon ;cp 1251 -> 866
@@: @@:
inc cx inc cx
bt word[panel_but+19],0 bt word[panel_but+20],0
jnc @f jnc @f
add edx,25 shl 16 add edx,25 shl 16
call draw_but_icon ;cp 866 -> 1251 call draw_but_icon ;cp 866 -> 1251

View File

@ -215,40 +215,42 @@ mov ebp,lib0
mov byte[panel_but+1],al mov byte[panel_but+1],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_save,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_save,1
mov byte[panel_but+2],al mov byte[panel_but+2],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_select,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_save_as,1
mov byte[panel_but+3],al mov byte[panel_but+3],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_cut,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_select,1
mov byte[panel_but+4],al mov byte[panel_but+4],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_copy,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_cut,1
mov byte[panel_but+5],al mov byte[panel_but+5],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_paste,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_copy,1
mov byte[panel_but+6],al mov byte[panel_but+6],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_find,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_paste,1
mov byte[panel_but+7],al mov byte[panel_but+7],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_replace,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_find,1
mov byte[panel_but+8],al mov byte[panel_but+8],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_key_words,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_replace,1
mov byte[panel_but+9],al mov byte[panel_but+9],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_upper,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_key_words,1
mov byte[panel_but+10],al mov byte[panel_but+10],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_lower,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_upper,1
mov byte[panel_but+11],al mov byte[panel_but+11],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_reverse,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_lower,1
mov byte[panel_but+12],al mov byte[panel_but+12],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_undo,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_reverse,1
mov byte[panel_but+13],al mov byte[panel_but+13],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_redo,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_undo,1
mov byte[panel_but+14],al mov byte[panel_but+14],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_invisible,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_redo,1
mov byte[panel_but+15],al mov byte[panel_but+15],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_syntax_list,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_invisible,1
mov byte[panel_but+16],al mov byte[panel_but+16],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_syntax_mode,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_syntax_list,1
mov byte[panel_but+17],al mov byte[panel_but+17],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_convert_1251_866,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_syntax_mode,1
mov byte[panel_but+18],al mov byte[panel_but+18],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_convert_866_1251,1 stdcall [ini_get_int],file_name,ini_sec_window,key_but_convert_1251_866,1
mov byte[panel_but+19],al mov byte[panel_but+19],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_convert_866_1251,1
mov byte[panel_but+20],al
;ä ©«®¢ë¥ à áè¨à¥­¨ï ;ä ©«®¢ë¥ à áè¨à¥­¨ï
xor edx,edx xor edx,edx
mov ebx,synt_auto_open mov ebx,synt_auto_open
@ -410,8 +412,8 @@ key:
cmp ah,69 ;[Pause Break] cmp ah,69 ;[Pause Break]
je still je still
stdcall KeyConvertToASCII, dword conv_tabl stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], dword edit2 stdcall [edit_box_key], edit2
jmp still jmp still
@@: @@:
@ -433,90 +435,98 @@ button:
@@: @@:
cmp ah,5 cmp ah,5
jne @f jne @f
call ted_but_save_file xor eax,eax
call ted_but_save_file ;á®åà ­¥­¨¥ ¡¥§ ¤¨ «®£ 
jmp still jmp still
@@: @@:
cmp ah,6 cmp ah,6
jne @f jne @f
stdcall [ted_but_select_word], tedit0 xor eax,eax
inc eax
call ted_but_save_file ;á®åà ­¥­¨¥ á ¤¨ «®£®¬
jmp still jmp still
@@: @@:
cmp ah,7 cmp ah,7
jne @f jne @f
stdcall [ted_but_cut], tedit0 stdcall [ted_but_select_word], tedit0
jmp still jmp still
@@: @@:
cmp ah,8 cmp ah,8
jne @f jne @f
stdcall [ted_but_copy], tedit0 stdcall [ted_but_cut], tedit0
jmp still jmp still
@@: @@:
cmp ah,9 cmp ah,9
jne @f jne @f
stdcall [ted_but_paste], tedit0 stdcall [ted_but_copy], tedit0
jmp still jmp still
@@: @@:
cmp ah,10 cmp ah,10
jne @f jne @f
call ted_but_find stdcall [ted_but_paste], tedit0
jmp still jmp still
@@: @@:
cmp ah,11 cmp ah,11
jne @f jne @f
call but_replace call ted_but_find
jmp still jmp still
@@: @@:
cmp ah,12 cmp ah,12
jne @f jne @f
call but_find_key_w call but_replace
jmp still jmp still
@@: @@:
cmp ah,13 cmp ah,13
jne @f jne @f
stdcall [ted_but_sumb_upper], tedit0 call but_find_key_w
jmp still jmp still
@@: @@:
cmp ah,14 cmp ah,14
jne @f jne @f
stdcall [ted_but_sumb_lover], tedit0 stdcall [ted_but_sumb_upper], tedit0
jmp still jmp still
@@: @@:
cmp ah,15 cmp ah,15
jne @f jne @f
stdcall [ted_but_reverse], tedit0 stdcall [ted_but_sumb_lover], tedit0
jmp still jmp still
@@: @@:
cmp ah,16 cmp ah,16
jne @f jne @f
stdcall [ted_but_undo], tedit0 stdcall [ted_but_reverse], tedit0
jmp still jmp still
@@: @@:
cmp ah,17 cmp ah,17
jne @f jne @f
stdcall [ted_but_redo], tedit0 stdcall [ted_but_undo], tedit0
jmp still jmp still
@@: @@:
cmp ah,18 cmp ah,18
jne @f jne @f
stdcall but_sumb_invis, tedit0 stdcall [ted_but_redo], tedit0
jmp still jmp still
@@: @@:
cmp ah,19 cmp ah,19
jne @f jne @f
stdcall but_k_words_show, tedit0 stdcall but_sumb_invis, tedit0
jmp still jmp still
@@: @@:
cmp ah,20 cmp ah,20
jne @f jne @f
stdcall but_synt_show, tedit0 stdcall but_k_words_show, tedit0
jmp still jmp still
@@: @@:
cmp ah,21 cmp ah,21
jne @f jne @f
stdcall [ted_but_convert_by_table],tedit0,tbl_1251_866 stdcall but_synt_show, tedit0
jmp still jmp still
@@: @@:
cmp ah,22 cmp ah,22
jne @f
stdcall [ted_but_convert_by_table],tedit0,tbl_1251_866
jmp still
@@:
cmp ah,23
jne @f jne @f
stdcall [ted_but_convert_by_table],tedit0,tbl_866_1251 stdcall [ted_but_convert_by_table],tedit0,tbl_866_1251
jmp still jmp still

View File

@ -10,6 +10,7 @@ scroll_type=0
but_new=1 but_new=1
but_open=1 but_open=1
but_save=1 but_save=1
but_save_as=1
but_select=1 but_select=1
but_cut=1 but_cut=1
but_copy=1 but_copy=1

View File

@ -5,6 +5,7 @@ sz_main_menu_File db '
sz_main_menu_File_New db '<27>®¢ë©', 0 sz_main_menu_File_New db '<27>®¢ë©', 0
sz_main_menu_File_Open db '<27>âªàëâì', 0 sz_main_menu_File_Open db '<27>âªàëâì', 0
sz_main_menu_File_Save db '‘®åà ­¨âì', 0 sz_main_menu_File_Save db '‘®åà ­¨âì', 0
sz_main_menu_File_Save_As db '‘®åà ­¨âì ª ª', 0
sz_main_menu_File_Exit db '‚ë室', 0 sz_main_menu_File_Exit db '‚ë室', 0
sz_main_menu_Changes db 'ˆ§¬¥­¥­¨ï', 0 sz_main_menu_Changes db 'ˆ§¬¥­¥­¨ï', 0
@ -35,6 +36,7 @@ sz_main_menu_File db 'File', 0
sz_main_menu_File_New db 'New', 0 sz_main_menu_File_New db 'New', 0
sz_main_menu_File_Open db 'Open', 0 sz_main_menu_File_Open db 'Open', 0
sz_main_menu_File_Save db 'Save', 0 sz_main_menu_File_Save db 'Save', 0
sz_main_menu_File_Save_As db 'Save as', 0
sz_main_menu_File_Exit db 'Exit', 0 sz_main_menu_File_Exit db 'Exit', 0
sz_main_menu_Changes db 'Changes', 0 sz_main_menu_Changes db 'Changes', 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB