TextEditor -> add english language

git-svn-id: svn://kolibrios.org@1343 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2009-12-30 19:07:50 +00:00
parent f2a9d1d500
commit d1bdc45e2f
6 changed files with 265 additions and 108 deletions

View File

@ -0,0 +1,16 @@
if not exist bin mkdir bin
if not exist bin\tl_sys_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_sys_16.bmp bin\tl_sys_16.bmp
if not exist bin\tl_nod_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_nod_16.bmp bin\tl_nod_16.bmp
if not exist bin\msgbox.obj @copy msgbox.obj bin\msgbox.obj
if not exist bin\te_icon.bmp @copy te_icon.bmp bin\te_icon.bmp
if not exist bin\info mkdir bin\info
copy info\* bin\info\*
@fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj
@kpack bin\box_lib.obj
@erase lang.inc
@echo lang fix en >lang.inc
@fasm.exe -m 16384 t_edit.asm bin\t_edit.kex
@kpack bin\t_edit.kex
pause

View File

@ -0,0 +1,16 @@
if not exist bin mkdir bin
if not exist bin\tl_sys_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_sys_16.bmp bin\tl_sys_16.bmp
if not exist bin\tl_nod_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_nod_16.bmp bin\tl_nod_16.bmp
if not exist bin\msgbox.obj @copy msgbox.obj bin\msgbox.obj
if not exist bin\te_icon.bmp @copy te_icon.bmp bin\te_icon.bmp
if not exist bin\info mkdir bin\info
copy info\* bin\info\*
@fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj
@kpack bin\box_lib.obj
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm.exe -m 16384 t_edit.asm bin\t_edit.kex
@kpack bin\t_edit.kex
pause

View File

@ -30,29 +30,29 @@ myimport:
edit_box_draw dd aEdit_box_draw edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse edit_box_mouse dd aEdit_box_mouse
version_ed dd aVersion_ed ;version_ed dd aVersion_ed
check_box_draw dd aCheck_box_draw ;check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse ;check_box_mouse dd aCheck_box_mouse
version_ch dd aVersion_ch ;version_ch dd aVersion_ch
option_box_draw dd aOption_box_draw ;option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse ;option_box_mouse dd aOption_box_mouse
version_op dd aVersion_op ;version_op dd aVersion_op
scrollbar_ver_draw dd aScrollbar_ver_draw scrollbar_ver_draw dd aScrollbar_ver_draw
scrollbar_ver_mouse dd aScrollbar_ver_mouse scrollbar_ver_mouse dd aScrollbar_ver_mouse
scrollbar_hor_draw dd aScrollbar_hor_draw scrollbar_hor_draw dd aScrollbar_hor_draw
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_draw dd aDbutton_draw
dinamic_button_mouse dd aDbutton_mouse ;dinamic_button_mouse dd aDbutton_mouse
version_dbutton dd aVersion_dbutton ;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
tl_data_init dd sz_tl_data_init tl_data_init dd sz_tl_data_init
tl_data_clear dd sz_tl_data_clear tl_data_clear dd sz_tl_data_clear
@ -77,29 +77,29 @@ dd 0,0
aEdit_box_draw db 'edit_box',0 aEdit_box_draw db 'edit_box',0
aEdit_box_key db 'edit_box_key',0 aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0 aEdit_box_mouse db 'edit_box_mouse',0
aVersion_ed db 'version_ed',0 ;aVersion_ed db 'version_ed',0
aCheck_box_draw db 'check_box_draw',0 ;aCheck_box_draw db 'check_box_draw',0
aCheck_box_mouse db 'check_box_mouse',0 ;aCheck_box_mouse db 'check_box_mouse',0
aVersion_ch db 'version_ch',0 ;aVersion_ch db 'version_ch',0
aOption_box_draw db 'option_box_draw',0 ;aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0 ;aOption_box_mouse db 'option_box_mouse',0
aVersion_op db 'version_op',0 ;aVersion_op db 'version_op',0
aScrollbar_ver_draw db 'scrollbar_v_draw',0 aScrollbar_ver_draw db 'scrollbar_v_draw',0
aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
aScrollbar_hor_draw db 'scrollbar_h_draw',0 aScrollbar_hor_draw db 'scrollbar_h_draw',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_draw db 'dbutton_draw',0
aDbutton_mouse db 'dbutton_mouse',0 ;aDbutton_mouse db 'dbutton_mouse',0
aVersion_dbutton db 'version_dbutton',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
sz_tl_data_init db 'tl_data_init',0 sz_tl_data_init db 'tl_data_init',0
sz_tl_data_clear db 'tl_data_clear',0 sz_tl_data_clear db 'tl_data_clear',0
@ -136,9 +136,9 @@ wScr:
.size_x dw 16 ;+0 .size_x dw 16 ;+0
.start_x dw 50 ;+2 .start_x dw 50 ;+2
.y: .y:
.size_y dw 300 ;+4 .size_y dw 300 ; +4
.start_y dw 50 ;+6 .start_y dw 50 ; +6
.btn_high dd 15 ;+8 .btn_high dd 15 ; +8
.type dd 1 ;+12 .type dd 1 ;+12
.max_area dd 100 ;+16 .max_area dd 100 ;+16
.cur_area dd 30 ;+20 .cur_area dd 30 ;+20
@ -230,7 +230,8 @@ ws_dir_lbox: ;
.position2 dd 0 ;+72 .position2 dd 0 ;+72
.work_size dd 0 ;+76 .work_size dd 0 ;+76
.all_redraw dd 0 ;+80 .all_redraw dd 0 ;+80
.ar_offset dd 1 ;+84;--------------------------------------------------------------------- .ar_offset dd 1 ;+84
;---------------------------------------------------------------------
align 4 align 4
menu_data_1: menu_data_1:
@ -241,9 +242,9 @@ menu_data_1:
.y: .y:
.size_y dw 15 ;+8 .size_y dw 15 ;+8
.start_y dw 5 ;+10 .start_y dw 5 ;+10
.text_pointer: dd menu_text_area ;0 ;+12 .text_pointer: dd menu_text_area ;+12
.pos_pointer: dd menu_text_area.1 ;0 ;+16 .pos_pointer: dd menu_text_area.1 ;+16
.text_end dd menu_text_area.end ;0 ;+20 .text_end dd menu_text_area.end ;+20
.mouse_pos dd 0 ;+24 .mouse_pos dd 0 ;+24
.mouse_keys dd 0 ;+28 .mouse_keys dd 0 ;+28
.x1: .x1:
@ -266,7 +267,7 @@ menu_data_1:
.cursor_max dd 0 ;+84 .cursor_max dd 0 ;+84
.extended_key dd 0 ;+88 .extended_key dd 0 ;+88
.menu_sel_col dd 0x00cc00 ;+92 .menu_sel_col dd 0x00cc00 ;+92
.bckg_text_col dd 0 ; +96 .bckg_text_col dd 0 ;+96
.frnt_text_col dd 0xffffff ;+100 .frnt_text_col dd 0xffffff ;+100
.mouse_keys_old dd 0 ;+104 .mouse_keys_old dd 0 ;+104
.font_height dd 8 ;+108 .font_height dd 8 ;+108
@ -298,6 +299,8 @@ tree_file_struct:
dir_mem rb 32+304*count_of_dir_list_files dir_mem rb 32+304*count_of_dir_list_files
if lang eq ru
menu_text_area: menu_text_area:
db '” ©«',0 db '” ©«',0
.1: .1:
@ -335,7 +338,7 @@ msgbox_3:
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db 'Žè¨¡ª  ¯à¨ ®âªàë⨨ ä ©«  á 梥⮢묨 ­ áâனª ¬¨!',13,\ db 'Žè¨¡ª  ¯à¨ ®âªàë⨨ ä ©«  á 梥⮢묨 ­ áâனª ¬¨!',13,\
'<27>®â®¬ã ¢ë¤¥«¥­¨¥ á«®¢ 梥⮬ ­¥ ¢®§¬®¦­®.',13,\ '<27>®â®¬ã ¢ë¤¥«¥­¨¥ á«®¢ 梥⮬ ­¥ ¢®§¬®¦­®.',13,\
' (ª®¤ ®è¨¡ª¨=' ' (ª®¤ ®è¨¡ª¨ ='
.err: db '?' .err: db '?'
db ')',0 db ')',0
db '‡ ªàëâì',0 db '‡ ªàëâì',0
@ -346,7 +349,7 @@ msgbox_4:
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db 'Žè¨¡ª  ¯à¨ ®âªàë⨨ ä ©« !',13,\ db 'Žè¨¡ª  ¯à¨ ®âªàë⨨ ä ©« !',13,\
'‚®§¬®¦­® ¨¬ï ä ©«  ¢¢¥¤¥­® ­¥ ¯à ¢¨«ì­®.',13,\ '‚®§¬®¦­® ¨¬ï ä ©«  ¢¢¥¤¥­® ­¥ ¯à ¢¨«ì­®.',13,\
' (ª®¤ ®è¨¡ª¨=' ' (ª®¤ ®è¨¡ª¨ ='
.err: db '?' .err: db '?'
db ')',0 db ')',0
db '‡ ªàëâì',0 db '‡ ªàëâì',0
@ -369,7 +372,7 @@ msgbox_6:
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db 'Žè¨¡ª  ¯à¨ á®åà ­¥­¨¨ ä ©« !',13,\ db 'Žè¨¡ª  ¯à¨ á®åà ­¥­¨¨ ä ©« !',13,\
'‚®§¬®¦­® ¨¬ï ä ©«  ¢¢¥¤¥­® ­¥ ¯à ¢¨«ì­®.',13,\ '‚®§¬®¦­® ¨¬ï ä ©«  ¢¢¥¤¥­® ­¥ ¯à ¢¨«ì­®.',13,\
' (ª®¤ ®è¨¡ª¨=' ' (ª®¤ ®è¨¡ª¨ ='
.err: db '?' .err: db '?'
db ')',0 db ')',0
db '‡ ªàëâì',0 db '‡ ªàëâì',0
@ -395,6 +398,118 @@ txtFindCapt db '
txtFindNext db '<27> ©â¨ ¤ «¥¥',0 txtFindNext db '<27> ©â¨ ¤ «¥¥',0
txtFormatCapt db '”®à¬ â',0 txtFormatCapt db '”®à¬ â',0
txtFormatApply db '<27>ਬ¥­¨âì',0 txtFormatApply db '<27>ਬ¥­¨âì',0
txtRow db '‘âப ',0
txtCol db '‡­ ª',0
txtOtm db 'Žâ¬¥­ë',0
txtBuf db '<27>ãä¥à: '
buf db BUF_SIZE dup(0) ;buf âñåãäà ïîñëå txtBuf
else
menu_text_area:
db 'File',0
.1:
db 'New',0
db 'Open',0
db 'Save',0
db 'Exit',0
.end:
db 0
;--------
msgbox_1:
dw 0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'File is large, because not all open.',13
db ' 1. If you save it will lose "not opened" characters.',13
db ' 2. The document can not add text, because the memory is busy.',0
db 'Ok',0 ;button1
db 0
msgbox_2:
db 3,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Save changes to the file?',0
db 'Save',0
db 'Discard',0
db 'Cancel',0
db 0
msgbox_2_funct:
dd On_SaveAndNewFile
dd On_NewFile
dd 0
msgbox_3:
db 1,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Error opening the file with the color settings!',13,\
'Because color selection of words is not possible.',13,\
' (error code ='
.err: db '?'
db ')',0
db 'Close',0
db 0
msgbox_4:
db 1,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Error opening file!',13,\
'Maybe the file name is not entered correctly.',13,\
' (error code ='
.err: db '?'
db ')',0
db 'Close',0
db 0
msgbox_5:
db 3,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Save changes to the file?',0
db 'Discard',0
db 'Cancel',0
db 0
msgbox_5_funct:
; dd but_SaveFile
dd On_OpenFile
dd 0
msgbox_6:
db 1,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Error saving file!',13,\
'Maybe the file name is not entered correctly.',13,\
' (error code ='
.err: db '?'
db ')',0
db 'Close',0
db 0
msgbox_7:
db 1,0
db 'Text not found.',0 ;+2 = +MB_TEXT_OFFSET
db 'Reached end of the document.',13,\
'Try to go to the beginning of the document',13,\
'or change the query and search again.',0
db 'Close',0
db 0
msgbox_8:
db 3,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
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
txtFindCapt db 'Search',0
txtFindNext db 'Find next',0
txtFormatCapt db 'Format',0
txtFormatApply db 'Apply',0
txtRow db 'Rows',0
txtCol db 'Cols',0
txtOtm db 'Undo',0
txtBuf db 'Buffer: '
buf db BUF_SIZE dup(0) ;buf always after txtBuf
end if
;------ ;------
align 4 align 4
EvChar db 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0 EvChar db 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0

View File

@ -870,10 +870,6 @@ OptDrawLineRight:
call GetSymbColor call GetSymbColor
ret ret
txtRow db '戔喈獱',0
txtCol db '嚟牚',0
txtOtm db '庘<><E5BA98>',0
draw_main_cursor: draw_main_cursor:
push eax ebx ecx edx edi esi push eax ebx ecx edx edi esi
@ -1008,11 +1004,19 @@ draw_bufer:
mov edx,txtBuf mov edx,txtBuf
mov esi,buf mov esi,buf
call strlen call strlen
if lang eq ru
cmp eax,15 cmp eax,15
jle .crop_buf jle .crop_buf
mov eax,15 mov eax,15
.crop_buf: .crop_buf:
mov esi,7 mov esi,7 ;7=len(txtBuf)
else
cmp eax,14
jle .crop_buf
mov eax,14
.crop_buf:
mov esi,8 ;8=len(txtBuf)
end if
add esi,eax add esi,eax
mov eax,4 mov eax,4

View File

@ -26,6 +26,7 @@ include 'load_lib.mac' ;include old file
include '../../develop/libraries/box_lib/trunk/tree_list.mac' include '../../develop/libraries/box_lib/trunk/tree_list.mac'
include '../../develop/libraries/box_lib/trunk/editbox.mac' include '../../develop/libraries/box_lib/trunk/editbox.mac'
include 'lang.inc'
include 't_data.inc' include 't_data.inc'
include 'strlen.inc' include 'strlen.inc'
include 't_work.inc' ;text work functions include 't_work.inc' ;text work functions
@ -135,13 +136,13 @@ load_libraries l_libs_start,load_lib_end
call mem_Alloc call mem_Alloc
mov dword[tree1.data_img_sys],eax mov dword[tree1.data_img_sys],eax
mov [run_file_70.func_n], 0 ;mov [run_file_70.func_n], 0
mov [run_file_70.param1], 54 ;mov [run_file_70.param1], 54
mov [run_file_70.param2], 0 ;mov [run_file_70.param2], 0
mov [run_file_70.param3], 3*256*13 mov [run_file_70.param3], 3*256*13
mov [run_file_70.param4], eax mov [run_file_70.param4], eax
mov [run_file_70.rezerv], 0 ;mov [run_file_70.rezerv], 0
mov [run_file_70.name], file_name ;mov [run_file_70.name], file_name
mov eax,70 ;load icon file mov eax,70 ;load icon file
mov ebx,run_file_70 mov ebx,run_file_70
@ -220,9 +221,7 @@ mov ecx,ebx
red_win: red_win:
mov eax,12 mcall 12,1
mov ebx,1
mcall
xor eax,eax xor eax,eax
mov ebx,10*65536+485 mov ebx,10*65536+485
@ -284,9 +283,7 @@ red_win:
mcall mcall
@@: @@:
mov eax,12 mcall 12,2
mov ebx,2
mcall
still: still:
mov eax,10 mov eax,10
@ -842,14 +839,23 @@ edit2 edit_box TE_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080
buf_cmd_lin db 302 dup(0) buf_cmd_lin db 302 dup(0)
buf_find db 302 dup(0) buf_find db 302 dup(0)
err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0 if lang eq ru
head_f_i0: err_message_found_lib0 db 'ˆ§¢¨­¨â¥ ­¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã box_lib.obj',0
head_f_l0 db 'System error',0 head_f_i0:
err_message_import0 db 'Error on load import library box_lib.obj',0 head_f_l0 db '‘¨á⥬­ ï ®è¨¡ª ',0
err_message_found_lib1 db 'Sorry I cannot found library msgbox.obj',0 err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0
;head_f_i1: err_message_found_lib1 db 'ˆ§¢¨­¨â¥ ­¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã msgbox.obj',0
;head_f_l1 db 'System error',0 err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ msgbox.obj',0
err_message_import1 db 'Error on load import library msgbox.obj',0 else
err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0
head_f_i0:
head_f_l0 db 'System error',0
err_message_import0 db 'Error on load import library box_lib.obj',0
err_message_found_lib1 db 'Sorry I cannot found library msgbox.obj',0
;head_f_i1:
;head_f_l1 db 'System error',0
err_message_import1 db 'Error on load import library msgbox.obj',0
end if
;library structures ;library structures
l_libs_start: l_libs_start:

View File

@ -63,14 +63,12 @@ tim_Undo dd ? ;
gpOpt db 0 gpOpt db 0
mode_colored db 1 ; ðåæèì âûäåëåíèÿ ñëîâ öâåòîì (0-âûêë. 1-âêë.) mode_colored db 1 ; ðåæèì âûäåëåíèÿ ñëîâ öâåòîì (0-âûêë. 1-âêë.)
txtBuf db '<27>ãä¥à: '
buf db BUF_SIZE dup(0)
key_new db 0 ; ñèìâîë, êîòîðûé áóäåò äîáàâëÿòñÿ ñ êëàâèàòóðû key_new db 0 ; ñèìâîë, êîòîðûé áóäåò äîáàâëÿòñÿ ñ êëàâèàòóðû
tex dd 0 tex dd 0 ;text memory pointer
tex_1 dd 0 tex_1 dd 0 ;text first symbol pointer
tex_end dd 0 tex_end dd 0 ;text end memory pointer
hed db 'TextEditor 29.12.09',0 ;ïîäïèñü îêíà hed db 'TextEditor 30.12.09',0 ;ïîäïèñü îêíà
sc system_colors sc system_colors
wndMain BOX 0,50,440,150 wndMain BOX 0,50,440,150
@ -186,6 +184,7 @@ SelStart:
pop ecx pop ecx
ret ret
align 4
SelMove: SelMove:
push ecx push ecx
mov ecx,[cur_x] mov ecx,[cur_x]
@ -196,6 +195,7 @@ SelMove:
add ecx,[wScr.position] add ecx,[wScr.position]
mov [sel.y1],ecx mov [sel.y1],ecx
pop ecx pop ecx
call draw_but_toolbar ;redraw toolbar (need to button Copy)
ret ret
;input: ;input: