forked from KolibriOS/kolibrios
't_edit': fix exit with program
git-svn-id: svn://kolibrios.org@4991 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
664313ede7
commit
32feac7b9b
@ -40,10 +40,7 @@ ted_but_new_file:
|
|||||||
cmp al,1
|
cmp al,1
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
|
stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
|
||||||
;mov eax,5
|
stdcall [mb_setfunctions],msgbox_2N_funct
|
||||||
;mov ebx,50
|
|
||||||
;int 0x40
|
|
||||||
stdcall [mb_setfunctions],msgbox_2_funct
|
|
||||||
jmp .ret_f
|
jmp .ret_f
|
||||||
@@:
|
@@:
|
||||||
call On_NewFile
|
call On_NewFile
|
||||||
@ -71,6 +68,37 @@ On_SaveAndNewFile:
|
|||||||
pop edi
|
pop edi
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
|
On_SaveAndOpenFile:
|
||||||
|
push edi
|
||||||
|
mov edi, tedit0
|
||||||
|
|
||||||
|
call ted_but_save_file
|
||||||
|
cmp ted_err_save,0
|
||||||
|
jne @f
|
||||||
|
call ted_but_open_file.no_msg
|
||||||
|
@@:
|
||||||
|
pop edi
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
|
On_SaveAndExit:
|
||||||
|
push edi
|
||||||
|
mov edi, tedit0
|
||||||
|
|
||||||
|
call ted_but_save_file
|
||||||
|
cmp ted_err_save,0
|
||||||
|
jne @f
|
||||||
|
mov dword[exit_code],1
|
||||||
|
@@:
|
||||||
|
pop edi
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
|
On_Exit:
|
||||||
|
mov dword[exit_code],1
|
||||||
|
ret
|
||||||
|
|
||||||
;description:
|
;description:
|
||||||
; äãªæ¨ï ®âªàëâ¨ï ä ©« ¡¥§ ®ª á®®¡é¥¨ï
|
; äãªæ¨ï ®âªàëâ¨ï ä ©« ¡¥§ ®ª á®®¡é¥¨ï
|
||||||
align 4
|
align 4
|
||||||
@ -90,8 +118,8 @@ ted_but_open_file:
|
|||||||
stdcall [ted_can_save], tedit0
|
stdcall [ted_can_save], tedit0
|
||||||
cmp al,1
|
cmp al,1
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [mb_create],msgbox_5,thread ;message: save changes in file?
|
stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
|
||||||
stdcall [mb_setfunctions],msgbox_5_funct
|
stdcall [mb_setfunctions],msgbox_2O_funct
|
||||||
jmp .ret_f
|
jmp .ret_f
|
||||||
.no_msg: ;¬¥âª ¤«ï ¢ë§®¢ äãªæ¨¨ ç¥à¥§ ª®¯ªã ¢ á®®¡é¥¨¨ msgbox_5
|
.no_msg: ;¬¥âª ¤«ï ¢ë§®¢ äãªæ¨¨ ç¥à¥§ ª®¯ªã ¢ á®®¡é¥¨¨ msgbox_5
|
||||||
pushad
|
pushad
|
||||||
|
@ -2,6 +2,8 @@ fn_col_option dd def_col_file
|
|||||||
fn_syntax_dir db 'info/',0
|
fn_syntax_dir db 'info/',0
|
||||||
def_col_file db 'default.syn',0
|
def_col_file db 'default.syn',0
|
||||||
|
|
||||||
|
exit_code dd 0 ;¯¥à¥¬¥ ï ¨á¯®«ì§ã¥¬ ï ¤«ï ¢ë室 ¨§ ¯à®£à ¬¬ë
|
||||||
|
|
||||||
;§ ç¥¨ï § ¤ ¢ ¥¬ë¥ ¯® 㬮«ç ¨î, ¡¥§ ini ä ©«
|
;§ ç¥¨ï § ¤ ¢ ¥¬ë¥ ¯® 㬮«ç ¨î, ¡¥§ ini ä ©«
|
||||||
ini_def_window_t equ 10
|
ini_def_window_t equ 10
|
||||||
ini_def_window_l equ 10
|
ini_def_window_l equ 10
|
||||||
@ -68,10 +70,6 @@ import_box_lib:
|
|||||||
scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||||
;version_scrollbar dd aVersion_scrollbar
|
;version_scrollbar dd aVersion_scrollbar
|
||||||
|
|
||||||
;dinamic_button_draw dd aDbutton_draw
|
|
||||||
;dinamic_button_mouse dd aDbutton_mouse
|
|
||||||
;version_dbutton dd aVersion_dbutton
|
|
||||||
|
|
||||||
menu_bar_draw dd aMenu_bar_draw
|
menu_bar_draw dd aMenu_bar_draw
|
||||||
menu_bar_mouse dd aMenu_bar_mouse
|
menu_bar_mouse dd aMenu_bar_mouse
|
||||||
;version_menu_bar dd aVersion_menu_bar
|
;version_menu_bar dd aVersion_menu_bar
|
||||||
@ -140,10 +138,6 @@ dd 0,0
|
|||||||
aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||||
;aVersion_scrollbar db 'version_scrollbar',0
|
;aVersion_scrollbar db 'version_scrollbar',0
|
||||||
|
|
||||||
;aDbutton_draw db 'dbutton_draw',0
|
|
||||||
;aDbutton_mouse db 'dbutton_mouse',0
|
|
||||||
;aVersion_dbutton db 'version_dbutton',0
|
|
||||||
|
|
||||||
aMenu_bar_draw db 'menu_bar_draw',0
|
aMenu_bar_draw db 'menu_bar_draw',0
|
||||||
aMenu_bar_mouse db 'menu_bar_mouse',0
|
aMenu_bar_mouse db 'menu_bar_mouse',0
|
||||||
;aVersion_menu_bar db 'version_menu_bar',0
|
;aVersion_menu_bar db 'version_menu_bar',0
|
||||||
@ -494,7 +488,7 @@ tree_file_struct:
|
|||||||
|
|
||||||
if lang eq ru
|
if lang eq ru
|
||||||
|
|
||||||
hed db '’¥ªáâ®¢ë© à¥¤ ªâ®à 28.11.13',0 ;¯®¤¯¨áì ®ª
|
hed db '’¥ªáâ®¢ë© à¥¤ ªâ®à 02.07.14',0 ;¯®¤¯¨áì ®ª
|
||||||
|
|
||||||
menu_text_area:
|
menu_text_area:
|
||||||
db '” ©«',0
|
db '” ©«',0
|
||||||
@ -522,7 +516,6 @@ msgbox_2:
|
|||||||
db '<27>¥ á®åà ïâì',0
|
db '<27>¥ á®åà ïâì',0
|
||||||
db 'Žâ¬¥ ',0
|
db 'Žâ¬¥ ',0
|
||||||
db 0
|
db 0
|
||||||
|
|
||||||
msgbox_3:
|
msgbox_3:
|
||||||
db 1,0
|
db 1,0
|
||||||
db '‚¨¬ ¨¥',0
|
db '‚¨¬ ¨¥',0
|
||||||
@ -533,7 +526,6 @@ msgbox_3:
|
|||||||
db ')',0
|
db ')',0
|
||||||
db '‡ ªàëâì',0
|
db '‡ ªàëâì',0
|
||||||
db 0
|
db 0
|
||||||
|
|
||||||
msgbox_4:
|
msgbox_4:
|
||||||
db 1,0
|
db 1,0
|
||||||
db '‚¨¬ ¨¥',0
|
db '‚¨¬ ¨¥',0
|
||||||
@ -544,15 +536,6 @@ msgbox_4:
|
|||||||
db ')',0
|
db ')',0
|
||||||
db '‡ ªàëâì',0
|
db '‡ ªàëâì',0
|
||||||
db 0
|
db 0
|
||||||
|
|
||||||
msgbox_5:
|
|
||||||
db 3,0
|
|
||||||
db '‚¨¬ ¨¥',0
|
|
||||||
db '‘®åà ¨âì ¨§¬¥¥¨ï ¢ ä ©«¥?',0
|
|
||||||
db '<27>¥ á®åà ïâì',0
|
|
||||||
db 'Žâ¬¥ ',0
|
|
||||||
db 0
|
|
||||||
|
|
||||||
msgbox_6:
|
msgbox_6:
|
||||||
db 1,0
|
db 1,0
|
||||||
db '‚¨¬ ¨¥',0
|
db '‚¨¬ ¨¥',0
|
||||||
@ -571,14 +554,6 @@ msgbox_7:
|
|||||||
'¨«¨ ¨§¬¥¨âì § ¯à®á ¨ ¯®¢â®à¨âì ¯®¨áª.',0
|
'¨«¨ ¨§¬¥¨âì § ¯à®á ¨ ¯®¢â®à¨âì ¯®¨áª.',0
|
||||||
db '‡ ªàëâì',0
|
db '‡ ªàëâì',0
|
||||||
db 0
|
db 0
|
||||||
msgbox_8:
|
|
||||||
db 3,0
|
|
||||||
db '‚¨¬ ¨¥',0
|
|
||||||
db '„«ï ¢ë室 § ¢¥àè¨â¥ à ¡®âã á ä ©«®¬.',13,\
|
|
||||||
'<27>®¯à®¡ã©â¥ á®åà ¨âì ¨§¬¥¥¨ï ¢ ä ©«¥',13,\
|
|
||||||
'¨«¨ ç âì ®¢ë© ¯ãá⮩.',0
|
|
||||||
db 'Žâ¬¥ ',0
|
|
||||||
db 0
|
|
||||||
msgbox_9:
|
msgbox_9:
|
||||||
db 3,0
|
db 3,0
|
||||||
db '‚¨¬ ¨¥',0
|
db '‚¨¬ ¨¥',0
|
||||||
@ -597,7 +572,7 @@ txtFormatApply db '
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
hed db 'Text editor 28.11.13',0
|
hed db 'Text editor 02.07.14',0
|
||||||
|
|
||||||
menu_text_area:
|
menu_text_area:
|
||||||
db 'File',0
|
db 'File',0
|
||||||
@ -625,7 +600,6 @@ msgbox_2:
|
|||||||
db 'Discard',0
|
db 'Discard',0
|
||||||
db 'Cancel',0
|
db 'Cancel',0
|
||||||
db 0
|
db 0
|
||||||
|
|
||||||
msgbox_3:
|
msgbox_3:
|
||||||
db 1,0
|
db 1,0
|
||||||
db 'Warning',0
|
db 'Warning',0
|
||||||
@ -636,7 +610,6 @@ msgbox_3:
|
|||||||
db ')',0
|
db ')',0
|
||||||
db 'Close',0
|
db 'Close',0
|
||||||
db 0
|
db 0
|
||||||
|
|
||||||
msgbox_4:
|
msgbox_4:
|
||||||
db 1,0
|
db 1,0
|
||||||
db 'Warning',0
|
db 'Warning',0
|
||||||
@ -647,15 +620,6 @@ msgbox_4:
|
|||||||
db ')',0
|
db ')',0
|
||||||
db 'Close',0
|
db 'Close',0
|
||||||
db 0
|
db 0
|
||||||
|
|
||||||
msgbox_5:
|
|
||||||
db 3,0
|
|
||||||
db 'Warning',0
|
|
||||||
db 'Save changes to the file?',0
|
|
||||||
db 'Discard',0
|
|
||||||
db 'Cancel',0
|
|
||||||
db 0
|
|
||||||
|
|
||||||
msgbox_6:
|
msgbox_6:
|
||||||
db 1,0
|
db 1,0
|
||||||
db 'Warning',0
|
db 'Warning',0
|
||||||
@ -674,14 +638,6 @@ msgbox_7:
|
|||||||
'or change the query and search again.',0
|
'or change the query and search again.',0
|
||||||
db 'Close',0
|
db 'Close',0
|
||||||
db 0
|
db 0
|
||||||
msgbox_8:
|
|
||||||
db 3,0
|
|
||||||
db 'Warning',0
|
|
||||||
db 'To quit, quit the file.',13,\
|
|
||||||
'Try to keep changes to a file',13,\
|
|
||||||
'or start a new blank file.',0
|
|
||||||
db 'Cancel',0
|
|
||||||
db 0
|
|
||||||
msgbox_9:
|
msgbox_9:
|
||||||
db 3,0
|
db 3,0
|
||||||
db 'Warning',0
|
db 'Warning',0
|
||||||
@ -701,13 +657,18 @@ txtFormatApply db 'Apply',0
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
;äãªæ¨¨ ¤«ï ª®¯®ª ¢ á®®¡é¥¨ïå
|
;äãªæ¨¨ ¤«ï ª®¯®ª ¢ á®®¡é¥¨ïå
|
||||||
msgbox_2_funct:
|
msgbox_2N_funct:
|
||||||
dd On_SaveAndNewFile
|
dd On_SaveAndNewFile
|
||||||
dd On_NewFile
|
dd On_NewFile
|
||||||
dd 0
|
dd 0
|
||||||
msgbox_5_funct:
|
msgbox_2O_funct:
|
||||||
|
dd On_SaveAndOpenFile
|
||||||
dd ted_but_open_file.no_msg
|
dd ted_but_open_file.no_msg
|
||||||
dd 0
|
dd 0
|
||||||
|
msgbox_2E_funct:
|
||||||
|
dd On_SaveAndExit
|
||||||
|
dd On_Exit
|
||||||
|
dd 0
|
||||||
|
|
||||||
KM_SHIFT equ 0x00010000
|
KM_SHIFT equ 0x00010000
|
||||||
KM_CTRL equ 0x00020000
|
KM_CTRL equ 0x00020000
|
||||||
|
@ -229,6 +229,8 @@ red_win:
|
|||||||
align 4
|
align 4
|
||||||
still:
|
still:
|
||||||
mcall 10
|
mcall 10
|
||||||
|
cmp dword[exit_code],1
|
||||||
|
je button.exit
|
||||||
|
|
||||||
cmp al,1 ;¨§¬¥¨«®áì ¯®«®¦¥¨¥ ®ª
|
cmp al,1 ;¨§¬¥¨«®áì ¯®«®¦¥¨¥ ®ª
|
||||||
jz red_win
|
jz red_win
|
||||||
@ -482,10 +484,13 @@ button:
|
|||||||
cmp ah,1
|
cmp ah,1
|
||||||
jne still
|
jne still
|
||||||
.exit:
|
.exit:
|
||||||
|
cmp dword[exit_code],1
|
||||||
|
je @f
|
||||||
stdcall [ted_can_save], tedit0
|
stdcall [ted_can_save], tedit0
|
||||||
cmp al,1
|
cmp al,1
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [mb_create],msgbox_8,thread ;message: save changes in file?
|
stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
|
||||||
|
stdcall [mb_setfunctions],msgbox_2E_funct
|
||||||
jmp still
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
stdcall mem.Free,[bmp_icon]
|
stdcall mem.Free,[bmp_icon]
|
||||||
|
Loading…
Reference in New Issue
Block a user