/programs/other/t_edit/strlen.inc |
---|
1,68 → 1,35 |
; strlen function |
; |
; Copyright (c) 2003 Thomas Mathys |
; killer@vantage.ch |
; Строковые функции |
; |
; This program is free software; you can redistribute it and/or modify |
; it under the terms of the GNU General Public License as published by |
; the Free Software Foundation; either version 2 of the License, or |
; (at your option) any later version. |
; |
; This program is distributed in the hope that it will be useful, |
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
; GNU General Public License for more details. |
; |
; You should have received a copy of the GNU General Public License |
; along with this program; if not, write to the Free Software |
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
; |
;%ifndef _STRLEN_INC |
;%define _STRLEN_INC |
;******************************************************************** |
; returns the length of an asciiz string |
; input : esi = pointer to string |
; output : eax = string length |
; destroys : nothing |
;******************************************************************** |
strlen: |
push ecx edi |
pushfd |
cld ; ! |
mov ecx,-1 |
mov edi,esi ; find terminating zero |
xor al,al |
repne scasb |
mov eax,edi ; calculate string length |
sub eax,esi |
dec eax |
popfd |
pop edi ecx |
;output: |
; eax = strlen |
align 4 |
proc str_len, str1:dword |
mov eax,[str1] |
@@: |
cmp byte[eax],0 |
je @f |
inc eax |
jmp @b |
@@: |
sub eax,[str1] |
ret |
endp |
; linlen function |
; |
; Copyright (c) 2009 Igor Afanasiev |
linlen: |
push ecx edi |
pushfd |
cld |
align 4 |
proc str_cat uses eax ecx edi esi, str1:dword, str2:dword |
mov esi,[str2] |
stdcall str_len,esi |
mov ecx,eax |
inc ecx |
mov edi,esi ; find terminating zero |
mov al,13 |
repne scasb |
mov eax,edi ; calculate string length |
sub eax,esi |
dec eax |
popfd |
pop edi ecx |
mov edi,[str1] |
stdcall str_len,edi |
add edi,eax |
cld |
repne movsb |
ret |
endp |
;description: |
; проверяет содержится ли строка str1 в строке str0 |
79,10 → 46,9 |
mov esi,[str1] |
cld |
@@: |
mov al,[esi] |
cmp al,0 |
je .e1 |
inc esi |
lodsb |
or al,al |
jz .e1 |
scasb ;сравниваем символы |
jz @b ;если совпали, то переходим к сравнению следующих |
;сюда попадаем если строки не совпали |
91,3 → 57,36 |
ret |
endp |
;input: |
; eax - число |
; edi - буфер для строки |
; len - длинна буфера |
;output: |
align 4 |
proc convert_int_to_str uses eax ecx edx edi esi, len:dword |
mov esi,[len] |
add esi,edi |
dec esi |
call .str |
ret |
endp |
align 4 |
.str: |
mov ecx,10 |
cmp eax,ecx |
jb @f |
xor edx,edx |
div ecx |
push edx |
;dec edi ;смещение необходимое для записи с конца строки |
call .str |
pop eax |
@@: |
cmp edi,esi |
jge @f |
or al,0x30 |
stosb |
mov byte[edi],0 ;в конец строки ставим 0, что-бы не вылазил мусор |
@@: |
ret |
/programs/other/t_edit/t_button.inc |
---|
156,13 → 156,13 |
stdcall ted_but_open_syntax, tedit0 |
jmp still |
@@: |
cmp ah,201 ;§ ¬¥¨âì |
cmp ah,201 ; ©â¨ ¤ «¥¥ |
jne .no_find |
call get_find_options |
stdcall [ted_but_find], tedit0, eax |
jmp still |
.no_find: |
cmp ah,202 ;§ ¬¥¨âì ¢á¥ |
cmp ah,202 ;§ ¬¥¨âì |
jne .no_change |
call get_find_options |
stdcall [ted_but_replace], tedit0, buf_replace, eax, 1 |
171,7 → 171,7 |
stdcall [ted_draw], tedit0 |
jmp still |
.no_change: |
cmp ah,203 |
cmp ah,203 ;§ ¬¥¨âì ¢á¥ |
jne .no_change_a |
call but_replace_all |
jmp still |
246,8 → 246,15 |
inc edx |
loop .cycle0 |
@@: |
or edx,edx |
jz @f |
stdcall [ted_draw], tedit0 |
@@: |
mov eax,edx |
mov edi,msgbox_1.z |
stdcall convert_int_to_str, 8 |
stdcall str_cat, edi,txt_Info |
notify_window_run msgbox_1 |
ret |
endp |
337,7 → 344,7 |
call ted_messages_after_open_file |
mov esi,openfile_path |
call strlen |
stdcall str_len,esi |
add esi,eax |
@@: ;横« ¤«ï ¯®¨áª ç « ¨¬¥¨ ä ©« |
dec esi |
349,7 → 356,7 |
jg @b |
@@: |
inc esi |
call strlen |
stdcall str_len,esi |
cmp eax,255 |
jle @f |
mov eax,255 |
381,8 → 388,7 |
cmp [OpenDialog_data.status],2 |
jne @f |
stdcall mem_spac, msgbox_9.fdp,100 |
mov esi,file_name |
call strlen |
stdcall str_len,file_name |
cmp eax,100 |
jle .no_crop |
mov eax,100 |
403,8 → 409,7 |
proc auto_open_syntax, of_path:dword |
pushad |
;¨é¥¬ ¥áâì «¨ ä ©« ¯®¤á¢¥âª¨ ¤«ï ®âªàë¢ ¥¬®£® ⥪á⮢®£® ä ©« |
mov esi,[of_path] |
call strlen |
stdcall str_len,[of_path] |
mov edx,[of_path] |
add edx,eax |
.f_beg: |
488,8 → 493,8 |
align 4 |
ted_messages_after_open_file: |
push ecx edi |
cmp eax,0 |
je @f |
or eax,eax |
jz @f |
cmp ax,10 |
jl .zifra_0_9 |
mov al,'?' |
499,18 → 504,7 |
mov byte[msgbox_4.err],al |
stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file! |
jmp .ret_f |
@@: |
cmp ebx,-1 |
je .ret_f |
;if open file |
mov edi,tedit0 |
mov ecx,ted_max_chars |
sub ecx,2 ;ecx = ¬ ªá¨¬ «ì®¥ ç¨á«® ¡ ©â, ¤«ï ª®â®àëå ¡ë« ¢ë¤¥«¥ ¯ ¬ïâì |
cmp ebx,ecx |
jl .ret_f |
stdcall [mb_create],msgbox_1,thread |
.ret_f: |
pop edi ecx |
ret |
524,10 → 518,10 |
; äãªæ¨ï ¦ â¨ï ª®¯ªã [ਬ¥¨âì] ¢ ¯ ¥«¨ á¨â ªá¨á |
align 4 |
proc ted_but_open_syntax uses eax ebx ecx edi, edit:dword |
mov edi,dword[edit] |
mov edi,[edit] |
cmp ted_panel_id,TED_PANEL_SYNTAX |
jne @f |
stdcall dword[tl_node_get_data], tree1 |
stdcall [tl_node_get_data], tree1 |
mov [fn_col_option],eax |
stdcall open_unpac_synt_file,eax |
cmp ebx,-1 |
548,6 → 542,8 |
align 4 |
proc open_unpac_synt_file uses eax edi esi, f_name:dword |
mov ebx,[f_name] |
cmp byte[ebx],0 |
je @f |
mov edi,last_open_synt_file |
stdcall strcmp,ebx,edi ;áà ¢¨¢ ¥¬ ¨¬ï ¯®¤ª«î祮£® ä ©« á ¯®¤ª«îç¥ë¬ à ¥¥ ä ©«®¬ |
test eax,eax |
685,7 → 681,7 |
align 4 |
ted_on_find_err: |
stdcall [mb_create],msgbox_7,thread ;message: Can not find text |
notify_window_run msgbox_7 ;message: Can not find text |
ret |
;description: |
/programs/other/t_edit/t_data.inc |
---|
@@ -211,7 +210,6 @@ |
@@ -348,6 +346,8 @@ |
@@ -419,7 +419,7 @@ |
@@ -440,7 +440,7 @@ |
@@ -455,13 +455,8 @@ |
@@ -501,11 +496,8 @@ |
@@ -535,13 +527,8 @@ |
@@ -581,11 +568,8 @@ |
/programs/other/t_edit/t_draw.inc |
---|
340,12 → 340,12 |
mov cx,20 |
mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work] ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà |
stdcall dword[tl_draw], tree1 |
stdcall [tl_draw], tree1 |
mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà |
stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox |
stdcall [scrollbar_ver_draw], ws_dir_lbox |
ror ecx,16 |
add ecx,dword[tree1.box_height] |
add ecx,[tree1.box_height] |
add ecx,20 |
and ecx,0xffff |
ror ecx,16 |
353,13 → 353,13 |
mov esi,ted_scr_h |
add cx,word[esi+sb_offs_size_y] |
sub cx,20 |
sub ecx,dword[tree1.box_height] |
sub ecx,[tree1.box_height] |
inc cx |
int 0x40 ;ðèñîâàíèå íèæíåãî ôîíîâîãî ïðÿìîóãîëüíèêà |
mov ecx,ted_wnd_t |
add ecx,25 |
add ecx,dword[tree1.box_height] |
add ecx,[tree1.box_height] |
shl ecx,16 |
mov cx,20 |
mcall SF_DEFINE_BUTTON,(5 shl 16)+65,,200,[sc.work_button] ;200 - button id |
371,8 → 371,10 |
mcall SF_DRAW_TEXT,,,txtFormatCapt |
mov ebx,(10 shl 16)+31 |
add ebx,dword[tree1.box_height] |
add ebx,[tree1.box_height] |
add ebx,ted_wnd_t |
mov ecx,[sc.work_button_text] |
or ecx,0x80000000 |
mcall ,,,txtFormatApply |
popad |
379,8 → 381,7 |
jmp .end_f |
@@: |
push eax edx |
mov edx,200 |
or edx,0x80000000 |
mov edx,0x80000000+200 |
mcall SF_DEFINE_BUTTON ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó |
pop edx eax |
.end_f: |
/programs/other/t_edit/t_edit.asm |
---|
47,7 → 47,7 |
mcall SF_SET_EVENTS_MASK,0xC0000027 |
mov esi,file_name |
call strlen |
stdcall str_len,esi |
mov ecx,eax |
mov edi,openfile_path |
cld |
95,10 → 95,9 |
copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ á¨â ªá¨á |
mcall SF_FILE,tree_file_struct |
cmp ebx,-1 |
je .end_dir_init |
mov eax,dir_mem |
add eax,32+4+1+3+4*6+8 |
cmp ebx,0 |
jle .end_dir_init |
mov eax,dir_mem+32+40 |
mov ecx,ebx |
@@: |
cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥ ¬¨ '.' ¨ '..' |
348,34 → 347,34 |
if lang eq ru |
head_f_i: |
head_f_l db '¨á⥬ ï ®è¨¡ª ',0 |
err_message_found_lib0 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'box_lib.obj',39,0 |
err_message_import0 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib.obj',39,0 |
err_message_found_lib1 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'msgbox.obj',39,0 |
err_message_import1 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox.obj',39,0 |
err_message_found_lib2 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'proc_lib.obj',39,0 |
err_message_import2 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0 |
err_message_found_lib_3 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'libimg.obj',39,0 |
err_message_import_3 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0 |
err_message_found_lib_4 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'libini.obj',39,0 |
err_message_import_4 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini.obj',39,0 |
err_message_found_lib_5 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'libkmenu.obj',39,0 |
err_message_import_5 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libkmenu.obj',39,0 |
head_f_l db '"¨á⥬ ï ®è¨¡ª ',0 |
err_message_found_lib0 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'box_lib.obj',39,'" -tE',0 |
err_message_import0 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib.obj',39,'" -tW',0 |
err_message_found_lib1 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'msgbox.obj',39,'" -tE',0 |
err_message_import1 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox.obj',39,'" -tW',0 |
err_message_found_lib2 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'proc_lib.obj',39,'" -tE',0 |
err_message_import2 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,'" -tW',0 |
err_message_found_lib_3 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'libimg.obj',39,'" -tE',0 |
err_message_import_3 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,'" -tW',0 |
err_message_found_lib_4 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'libini.obj',39,'" -tE',0 |
err_message_import_4 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini.obj',39,'" -tW',0 |
err_message_found_lib_5 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'libkmenu.obj',39,'" -tE',0 |
err_message_import_5 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libkmenu.obj',39,'" -tW',0 |
else |
head_f_i: |
head_f_l db 'System error',0 |
err_message_found_lib0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,0 |
err_message_import0 db 'Error on load import library ',39,'box_lib.obj',39,0 |
err_message_found_lib1 db 'Sorry I cannot found library ',39,'msgbox.obj',39,0 |
err_message_import1 db 'Error on load import library ',39,'msgbox.obj',39,0 |
err_message_found_lib2 db 'Sorry I cannot found library ',39,'proc_lib.obj',39,0 |
err_message_import2 db 'Error on load import library ',39,'proc_lib.obj',39,0 |
err_message_found_lib_3 db 'Sorry I cannot found library ',39,'libimg.obj',39,0 |
err_message_import_3 db 'Error on load import library ',39,'libimg.obj',39,0 |
err_message_found_lib_4 db 'Sorry I cannot found library ',39,'libini.obj',39,0 |
err_message_import_4 db 'Error on load import library ',39,'libini.obj',39,0 |
err_message_found_lib_5 db 'Sorry I cannot found library ',39,'libkmenu.obj',39,0 |
err_message_import_5 db 'Error on load import library ',39,'libkmenu.obj',39,0 |
head_f_l db '"System error',0 |
err_message_found_lib0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,'" -tE',0 |
err_message_import0 db 'Error on load import library ',39,'box_lib.obj',39,'" -tW',0 |
err_message_found_lib1 db 'Sorry I cannot found library ',39,'msgbox.obj',39,'" -tE',0 |
err_message_import1 db 'Error on load import library ',39,'msgbox.obj',39,'" -tW',0 |
err_message_found_lib2 db 'Sorry I cannot found library ',39,'proc_lib.obj',39,'" -tE',0 |
err_message_import2 db 'Error on load import library ',39,'proc_lib.obj',39,'" -tW',0 |
err_message_found_lib_3 db 'Sorry I cannot found library ',39,'libimg.obj',39,'" -tE',0 |
err_message_import_3 db 'Error on load import library ',39,'libimg.obj',39,'" -tW',0 |
err_message_found_lib_4 db 'Sorry I cannot found library ',39,'libini.obj',39,'" -tE',0 |
err_message_import_4 db 'Error on load import library ',39,'libini.obj',39,'" -tW',0 |
err_message_found_lib_5 db 'Sorry I cannot found library ',39,'libkmenu.obj',39,'" -tE',0 |
err_message_import_5 db 'Error on load import library ',39,'libkmenu.obj',39,'" -tW',0 |
end if |
;library structures |
/programs/other/t_edit/t_edit.ini |
---|
16,7 → 16,7 |
but_copy=1 |
but_paste=1 |
but_find=1 |
but_replace=0 |
but_replace=1 |
but_key_words=1 |
but_upper=1 |
but_lower=1 |
/programs/other/t_edit_synt/te_data.inc |
---|
66,7 → 66,7 |
ted_but_undo dd sz_ted_but_undo |
ted_but_redo dd sz_ted_but_redo |
ted_but_reverse dd sz_ted_but_reverse |
ted_but_find_next dd sz_ted_but_find_next |
ted_but_find dd sz_ted_but_find |
ted_text_colored dd sz_ted_text_colored |
PathShow_prepare dd sz_PathShow_prepare |
128,7 → 128,7 |
sz_ted_but_undo db 'ted_but_undo',0 |
sz_ted_but_redo db 'ted_but_redo',0 |
sz_ted_but_reverse db 'ted_but_reverse',0 |
sz_ted_but_find_next db 'ted_but_find_next',0 |
sz_ted_but_find db 'ted_but_find',0 |
sz_ted_text_colored db 'ted_text_colored',0 |
sz_PathShow_prepare db 'PathShow_prepare',0 |
146,28 → 146,9 |
aimg_decode db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ëå |
aimg_destroy db 'img_destroy',0 |
;--------------------------------------------------------------------- |
;¤®ç¥à¨© áªà®««¨£ ¤«ï í«¥¬¥â ListBox |
align 4 |
ws_dir_lbox: ;¤®ç¥à¨© áªà®««¨£ ¤«ï í«¥¬¥â ListBox |
.x: |
.size_x dw 16 ;+0 |
.start_x dw 0 ;+2 |
.y: |
.size_y dw 30 ;+4 |
.start_y dw 70 ;+6 |
.btn_high dd 15 ;+8 |
.type dd 1 ;+12 |
.max_area dd 100 ;+16 |
rb 4+4 |
.bckg_col dd 0xeeeeee ;+28 |
.frnt_col dd 0xbbddff ;+32 |
.line_col dd 0 ;+36 |
.redraw dd 0 ;+40 |
.delta dw 0 ;+44 |
.delta2 dw 0 ;+46 |
.run_x: |
rb 2*4+4*6 |
.all_redraw dd 0 ;+80 |
.ar_offset dd 1 ;+84 |
ws_dir_lbox scrollbar 16,0, 30,70, 15, 100,30,0, 0,0,0, 1 |
;--------------------------------------------------------------------- |
count_of_dir_list_files equ 15 |
/programs/other/t_edit_synt/te_syntax.asm |
---|
56,10 → 56,9 |
copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ á¨â ªá¨á |
mcall SF_FILE,tree_file_struct |
cmp ebx,-1 |
je .end_dir_init |
mov eax,dir_mem |
add eax,32+4+1+3+4*6+8 |
cmp ebx,0 |
jle .end_dir_init |
mov eax,dir_mem+32+40 |
mov ecx,ebx |
@@: |
cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥ ¬¨ '.' ¨ '..' |
73,6 → 72,12 |
or dword[tree1.style], tl_cursor_pos_limited ;®£à ¨ç¨¢ ¥¬ ¤¢¨¦¥¨¥ ªãàá®à ¢ ¯à¥¤¥« å ᯨ᪠|
.end_dir_init: |
xor eax,eax |
inc eax |
mov [scrol_w1.type],eax |
mov [scrol_h1.type],eax |
mov [ws_dir_lbox.type],eax |
;--- load color option file --- |
stdcall [ted_init], tedit0 |
mov byte[file_name],0 |
136,15 → 141,14 |
mov edx,txt_out_file |
int 0x40 |
push dword PathShow_data_1 |
call [PathShow_draw] |
stdcall [PathShow_draw], PathShow_data_1 |
stdcall [edit_box_draw],dword edit1 |
stdcall [tl_draw],dword tree1 |
stdcall [edit_box_draw], edit1 |
stdcall [tl_draw], tree1 |
;scroll 1 |
mov [ws_dir_lbox.all_redraw],1 |
stdcall [scrollbar_ver_draw],dword ws_dir_lbox |
stdcall [scrollbar_ver_draw],ws_dir_lbox |
stdcall [ted_draw], tedit0 |
mcall SF_REDRAW,SSF_END_DRAW |
328,7 → 332,7 |
;@@: |
ret |
hed db 'TextEditor syntax file converter 15.01.19',0 ;¯®¤¯¨áì ®ª |
hed db 'TextEditor syntax file converter 23.01.19',0 ;¯®¤¯¨áì ®ª |
conv_tabl rb 128 ; â ¡«¨æ ¤«ï ª®¢¥àâ¨à®¢ ¨ï scan-ª®¤ ¢ ascii-ª®¤ |
txt_load_f db ' £à. ä ©«',0 |
337,11 → 341,11 |
txt_out_file db 'ëå. ä ©«:',0 |
head_f_i: |
head_f_l db 'System error',0 |
err_message_found_lib_0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,0 |
err_message_import_0 db 'Error on load import library ',39,'box_lib.obj',39,0 |
err_message_found_lib_1 db 'Sorry I cannot found library ',39,'libimg.obj',39,0 |
err_message_import_1 db 'Error on load import library ',39,'libimg.obj',39,0 |
head_f_l db '"System error',0 |
err_message_found_lib_0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,'" -tE',0 |
err_message_import_0 db 'Error on load import library ',39,'box_lib.obj',39,'" -tW',0 |
err_message_found_lib_1 db 'Sorry I cannot found library ',39,'libimg.obj',39,'" -tE',0 |
err_message_import_1 db 'Error on load import library ',39,'libimg.obj',39,'" -tW',0 |
;library structures |
l_libs_start: |