t_edit: add function ted_but_replace, fix code

git-svn-id: svn://kolibrios.org@7577 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2019-01-23 22:08:19 +00:00
parent 16292e542a
commit cb0f3625e7
14 changed files with 271 additions and 273 deletions

View File

@ -116,7 +116,8 @@ import lib_boxlib, \
ted_but_undo, 'ted_but_undo' , \
ted_but_redo, 'ted_but_redo' , \
ted_but_reverse, 'ted_but_reverse' , \
ted_but_find_next, 'ted_but_find_next' , \
ted_but_find, 'ted_but_find' , \
ted_but_replace, 'ted_but_replace' , \
ted_text_colored, 'ted_text_colored' , \
frame_draw, 'frame_draw' , \
progressbar_draw,'progressbar_draw' , \
@ -182,7 +183,8 @@ public ted_but_paste as '_ted_but_paste'
public ted_but_undo as '_ted_but_undo'
public ted_but_redo as '_ted_but_redo'
public ted_but_reverse as '_ted_but_reverse'
public ted_but_find_next as '_ted_but_find_next'
public ted_but_find as '_ted_but_find'
public ted_but_replace as '_ted_but_replace'
public ted_text_colored as 'ted_text_colored_asm'
public tl_data_init as '_tl_data_init'

View File

@ -156,7 +156,8 @@ extern void (*ted_but_select_word)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_copy)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_paste)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_find_next)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_find)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_replace)(editor *) __attribute__((__stdcall__));
///move cursor to <ed_buffer_find>, calls ted_fun_find_err() if exist

View File

@ -480,17 +480,17 @@ pushad
mcall 68,11
mcall 68,12,4096
push eax
pop dword [arrea_xx]
pop dword[arrea_xx]
mov edi,eax
mov esi,dword head
mov esi,head
cld
align 4
lp0:
movsb
cmp byte[esi],0
jne lp0
mov word[edi],'. '
mov word[edi],0xa0d
add edi,2
mov esi,dword err_message
align 4
@ -508,7 +508,7 @@ macro notify_window_run message
{
push eax ebx
mov eax,message ;¯ à ¬¥âàë ¤«ï ª®¬ ­¤­®© áâப¨
mov [run_notify_struct.Flags], eax
mov [run_notify_struct.Flags],eax
mov eax,70 ;run @notify
mov ebx,run_notify_struct
int 0x40

View File

@ -319,7 +319,6 @@ dd sz_ted_but_undo, ted_but_undo
dd sz_ted_but_redo, ted_but_redo
dd sz_ted_but_reverse, ted_but_reverse
dd sz_ted_but_find, ted_but_find
dd sz_ted_but_find_next, ted_but_find_next
dd sz_ted_but_replace, ted_but_replace
dd sz_ted_text_colored, ted_text_colored
dd sz_ted_version, 0x00000005
@ -433,7 +432,6 @@ 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 db 'ted_but_find',0
sz_ted_but_find_next db 'ted_but_find_next',0
sz_ted_but_replace db 'ted_but_replace',0
sz_ted_text_colored db 'ted_text_colored',0
sz_ted_version db 'version_text_edit',0

View File

@ -234,7 +234,7 @@ proc ted_key, edit:dword, table:dword, control:dword
@@:
cmp ah,KEY_F3 ;[F3]
jne @f
stdcall ted_but_find_next,edi
stdcall ted_but_find,edi,0
jmp .end_key_fun
@@:
@ -1851,12 +1851,9 @@ ted_get_pos_by_cursor:
; edx = tex[1] if error
; ted_gp_opt = 0 if text no found
align 16
ted_get_pos_by_coords:
push eax ;Row
push ebx ;Col
xor eax,eax
xor ebx,ebx
proc ted_get_pos_by_coords uses eax ebx
xor eax,eax ;Row
xor ebx,ebx ;Col
mov ted_gp_opt,0
mov edx,ted_tex
@@:
@ -1888,9 +1885,8 @@ ted_get_pos_by_coords:
mov edx,ted_tex_1
;call ted_get_text_perv_pos
@@:
pop ebx eax
ret
endp
;input:
; eax = Row
@ -2062,7 +2058,7 @@ ted_go_to_pos:
push eax ebx
mov eax,ted_scr_h
sub ecx,[eax+sb_offs_position]
cmp ecx,0 ;ted_cur_y < 0
cmp ecx,0 ;ted_cur_x < 0
jge @f
add [eax+sb_offs_position],ecx ;¯à®ªàã⪠ áªà®««¨­£  ¢«¥¢®
xor ecx,ecx
@ -2839,33 +2835,51 @@ endp
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
;input:
; f_opt = ¯ à ¬¥âàë ¯®¨áª :
; (0 - ¨áª âì ¢ëè¥ ªãàá®à , 1 - ¨áª âì ­¨¦¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
; (0 - ¨áª âì ­¨¦¥ ªãàá®à , 1 - ¨áª âì ¢ëè¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
; ¥á«¨ ãáâ ­®¢«¥­ 31-© ¡¨â, â® ­¥ ®¡­®¢«ï¥âáï ®ª­®
;output:
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
align 16
proc ted_but_find, edit:dword, f_opt:dword
proc ted_but_find uses ebx ecx edx edi esi, edit:dword, f_opt:dword
push [edit]
cmp dword[f_opt],2
cmp word[f_opt],2
jne @f
call ted_but_find_first
jmp .end_f
call _but_find_first
jmp .end0
@@:
cmp dword[f_opt],0
cmp word[f_opt],0
jne @f
call ted_but_find_next
jmp .end_f
call _but_find_next
jmp .end0
@@:
cmp dword[f_opt],1
jne .end_f
call ted_but_find_perv
.end_f:
cmp word[f_opt],1
jne .end0
call _but_find_perv
.end0:
bt dword[f_opt],31
jc .end1
or eax,eax
jz @f
;⥪áâ ­ ©¤¥­, ®¡­®¢«ï¥¬ ®ª­®
stdcall ted_draw,edi
jmp .end1
@@:
;⥪áâ ­¥ ­ ©¤¥­, ¯à®¡ã¥¬ ¢ë§¢ âì á®®¡é¥­¨¥
cmp ted_fun_find_err,0
je .end1
call ted_fun_find_err ;¯®«ì§®¢ â¥«ì᪠ï äã­ªæ¨ï
.end1:
ret
endp
;description:
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
; ¨é¥â ®â ­ ç «  ä ©« , ¨«¨ ®â ª®­æ  ⥪ã饣® ¢ë¤¥«¥­¨ï
; äã­ªæ¨ï ­ å®¤¨â ⥪á⠮⠭ ç «  ä ©« , ¨«¨ ®â ª®­æ  ⥪ã饣® ¢ë¤¥«¥­¨ï
;output:
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
; ebx, ecx, edx, edi, edi - ¯®àâïâáï
align 16
proc ted_but_find_first, edit:dword
pushad
proc _but_find_first, edit:dword
mov edi,[edit]
call ted_is_select
@ -2892,17 +2906,17 @@ proc ted_but_find_first, edit:dword
jle @f
jmp @b
@@:
call but_find
popad
call _but_find_select
ret
endp
;description:
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
; ¨é¥â ¢ëè¥ ªãàá®à 
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ¢ëè¥ ªãàá®à 
;output:
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
; ebx, ecx, edx, edi, edi - ¯®àâïâáï
align 16
proc ted_but_find_perv, edit:dword
pushad
proc _but_find_perv, edit:dword
mov edi,[edit]
call ted_is_select
or al,al
@ -2928,17 +2942,17 @@ proc ted_but_find_perv, edit:dword
jle @f
jmp @b
@@:
call but_find
popad
call _but_find_select
ret
endp
;description:
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
; ¨é¥â ­¨¦¥ ªãàá®à 
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­¨¦¥ ªãàá®à 
;output:
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
; ebx, edx, edi, esi - ¯®àâïâáï
align 16
proc ted_but_find_next, edit:dword
pushad
proc _but_find_next, edit:dword
mov edi,[edit]
call ted_get_pos_by_cursor
@ -2953,16 +2967,17 @@ proc ted_but_find_next, edit:dword
jle @f
jmp @b
@@:
call but_find
popad
call _but_find_select
ret
endp
;description:
; ¢á¯®¬®£ â¥«ì­ ï äã­ªæ¨ï, ¢ë¤¥«ï¥â ­ ©¤¥­­ë© ⥪áâ
;input:
; bh = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
; esi = first symbol pointer
align 16
but_find:
_but_find_select:
or bh,bh
jz @f
call ted_get_text_coords
@ -2976,47 +2991,90 @@ but_find:
call ted_get_text_coords
mov ted_sel_x0,ebx
mov ted_sel_y0,eax
stdcall ted_draw,edi
jmp .end_find
xor eax,eax
inc eax
jmp .end0
@@:
;¯®¯ ¤ ¥¬ á ¥á«¨ ⥪áâ ­¥ ­ ©¤¥­
cmp ted_fun_find_err,0
je .end_find
call ted_fun_find_err ;¯®«ì§®¢ â¥«ì᪠ï äã­ªæ¨ï
.end_find:
xor eax,eax ;⥪áâ ­¥ ­ ©¤¥­
.end0:
ret
;input:
; rpl_text = ⥪áâ ¤«ï § ¬¥­ë
; r_opt = ¯ à ¬¥âàë ¯®¨áª :
; (0 - ¨áª âì ¢ëè¥ ªãàá®à , 1 - ¨áª âì ­¨¦¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
; (0 - ¨áª âì ­¨¦¥ ªãàá®à , 1 - ¨áª âì ¢ëè¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
; n_tim = 䨪á¨à®¢ âì § ¬¥­ã ¢ ¨§¬¥­¥­¨ïå (0 - ­¥â, 1 - ¤ )
;output:
; eax = 0 - ­¥ 㤠筮, 1 - 㤠筮
align 16
proc ted_but_replace uses edx edi esi, edit:dword, rpl_text:dword, r_opt:dword, n_tim:dword
mov edi,[edit]
stdcall ted_but_find, edi,[r_opt]
mov eax,[r_opt]
bts eax,31
stdcall ted_but_find, edi,eax
or eax,eax
jz .end0
xor edx,edx
cmp dword[n_tim],0
je @f
call ted_set_undo
mov edx,ted_opt_ed_change_time
@@:
stdcall ted_sel_text_del, edx
or eax,0xff
jz @f
jz .end0
mov esi,[rpl_text]
stdcall tl_strlen
or eax,eax
jz @f
jz .end0
stdcall ted_text_add, edi,esi,eax,ted_opt_ed_move_cursor
xor eax,eax
inc eax
@@:
.end0:
ret
endp
;input:
; eax - text need find
; bl - first symbol to find
; edx - first symbol pointer
; edi - pointer to tedit struct
;output:
; bh - rezult
; edx - last text position (if find sucess)
; esi - first symbol pointer
;description:
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
align 16
ted_get_find_rezult:
push eax
mov bh,1
mov esi,edx ;copy edx
@@:
cmp byte[edx],bl
jne .no_text
inc eax ;*** get next symbol (in find text) ***
mov bl,byte[eax]
or bl,bl
jz @f ;end of find text
call ted_iterat_next ;*** get next symbol (in editor text) ***
cmp edx,ted_tex_1
jg @b
align 4
.no_text:
xor bh,bh
mov edx,esi ;restore edx
@@:
pop eax
mov bl,byte[eax] ;restore bl
ret
;input:
; edi = pointer to tedit struct
align 16
@ -3834,48 +3892,6 @@ popad
ret
endp
;input:
; eax - text need find
; bl - first symbol to find
; edx - first symbol pointer
; edi - pointer to tedit struct
;output:
; bh - rezult
; edx - last text position (if find sucess)
; esi - first symbol pointer
;description:
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
align 16
ted_get_find_rezult:
push eax
mov bh,1
mov esi,edx ;copy edx
@@:
cmp byte[edx],bl
jne .no_text
inc eax ;*** get next symbol (in find text) ***
mov bl,byte[eax]
or bl,bl
jz @f ;end of find text
call ted_iterat_next ;*** get next symbol (in editor text) ***
cmp edx,ted_tex_1
jle @f ;end of editor text
jmp @b
align 4
.no_text:
xor bh,bh
mov edx,esi ;restore edx
@@:
pop eax
mov bl,byte[eax] ;restore bl
ret
;input:
; clear_o - ¥á«¨ =1 ®ç¨áâ¨âì ®¤­ã áâபã, =0 ®ç¨áâ¨âì ¢á¥ áâப¨ ®ª­  ¤® ­¨§ã
align 16

View File

@ -1158,7 +1158,8 @@ import box_lib, \
ted_but_undo, 'ted_but_undo', \
ted_but_redo, 'ted_but_redo', \
ted_but_reverse, 'ted_but_reverse', \
ted_but_find_next, 'ted_but_find_next', \
ted_but_find, 'ted_but_find', \
ted_but_replace, 'ted_but_replace', \
ted_text_colored, 'ted_text_colored', \
progressbar_draw, 'progressbar_draw'

View File

@ -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 @@ proc str_instr uses edi esi, str0:dword, str1:dword
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 @@ proc str_instr uses edi esi, str0:dword, str1:dword
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

View File

@ -156,13 +156,13 @@ button:
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 @@ button:
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 @@ proc but_replace_all uses ebx ecx edx
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 @@ proc but_no_msg_OpenFile uses eax ebx esi
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 @@ proc but_no_msg_OpenFile uses eax ebx esi
jg @b
@@:
inc esi
call strlen
stdcall str_len,esi
cmp eax,255
jle @f
mov eax,255
@ -381,8 +388,7 @@ ted_but_open_file:
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 @@ ted_but_open_file:
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 @@ endp
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 @@ ted_messages_after_open_file:
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 @@ ted_save_err_msg:
; äã­ªæ¨ï ­ ¦ â¨ï ­  ª­®¯ªã [<EFBFBD>ਬ¥­¨âì] ¢ ¯ ­¥«¨ ᨭ⠪á¨á 
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 @@ endp
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 @@ db 168,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;240
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:

File diff suppressed because one or more lines are too long

View File

@ -340,12 +340,12 @@ proc draw_panel_syntax
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 @@ proc draw_panel_syntax
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,16 +371,17 @@ proc draw_panel_syntax
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
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:

View File

@ -47,7 +47,7 @@ start:
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 @@ mov ebp,lib0
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 @@ unpac_mem dd 0
if lang eq ru
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
err_message_found_lib0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib.obj',39,0
err_message_found_lib1 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'msgbox.obj',39,0
err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox.obj',39,0
err_message_found_lib2 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
err_message_found_lib_3 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
err_message_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
err_message_found_lib_4 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
err_message_import_4 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini.obj',39,0
err_message_found_lib_5 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',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 '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,'" -tE',0
err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib.obj',39,'" -tW',0
err_message_found_lib1 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'msgbox.obj',39,'" -tE',0
err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox.obj',39,'" -tW',0
err_message_found_lib2 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,'" -tE',0
err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,'" -tW',0
err_message_found_lib_3 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,'" -tE',0
err_message_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,'" -tW',0
err_message_found_lib_4 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,'" -tE',0
err_message_import_4 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini.obj',39,'" -tW',0
err_message_found_lib_5 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',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

View File

@ -16,7 +16,7 @@ but_cut=1
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

View File

@ -66,7 +66,7 @@ ted_but_paste dd sz_ted_but_paste
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_paste db 'ted_but_paste',0
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
@ -145,29 +145,10 @@ dd 0,0
aimg_to_rgb2 db 'img_to_rgb2',0
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

View File

@ -56,10 +56,9 @@ start:
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 @@ start:
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 @@ draw_window:
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 @@ get_wnd_in_focus:
;@@:
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_inp_file db '
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: