1) small update
2) code change

git-svn-id: svn://kolibrios.org@1456 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2010-04-22 19:39:39 +00:00
parent 999126566d
commit f751f0881f
6 changed files with 1656 additions and 1331 deletions

View File

@ -48,7 +48,7 @@ table
</head> </head>
<body> <body>
<h1>TextEditor версия от 29.12.2009</h1> <h1>TextEditor версия от 22.04.2010</h1>
<h2>О программе</h2> <h2>О программе</h2>
<p>Программа для работы с текстовыми файлами. <p>Программа для работы с текстовыми файлами.
Лицензия свободная.</p> Лицензия свободная.</p>
@ -67,11 +67,11 @@ table
у каждой из них есть свои сильные и слабые стороны. у каждой из них есть свои сильные и слабые стороны.
Проведу (не полное) сравнение программ TinyPad и TextEditor:</p> Проведу (не полное) сравнение программ TinyPad и TextEditor:</p>
<table border=1> <table border=1>
<tr><th>Действия</th><th>TinyPad</th><th>TextEditor</th><th>Комментарий</th></tr> <tr><th>Действия</th><th>TinyPad</th><th>TextEditor</th></tr>
<tr><td>Работа с несколькими документами</td> <tr><td>Работа с несколькими документами</td>
<td>есть</td><td>нет</td><td>пока не планирую сделать</td></tr> <td>есть</td><td>нет (возможно скоро будет)</td></tr>
<tr><td>Поддержка кодировок KOI8M, OEM</td> <tr><td>Поддержка кодировок KOI8M, OEM</td>
<td>есть</td><td>нет</td><td>хотелось-бы сделать</td></tr> <td>есть</td><td>нет</td></tr>
<tr><td>Подсветка синтаксиса</td> <tr><td>Подсветка синтаксиса</td>
<td>подсветка заранее зашита в программу</td><td>подсветка берется из файлов, которые может указать пользователь. Также есть возможность получать справку по подсвечиваемым словам (если она есть в файлах подсветки, навести курсор на слово и нажать F1).</td><td></td></tr> <td>подсветка заранее зашита в программу</td><td>подсветка берется из файлов, которые может указать пользователь. Также есть возможность получать справку по подсвечиваемым словам (если она есть в файлах подсветки, навести курсор на слово и нажать F1).</td><td></td></tr>
<tr><td>Многократная отмена/повтор действий</td> <tr><td>Многократная отмена/повтор действий</td>

View File

@ -1,16 +1,14 @@
align 4
but_NewFile: but_NewFile:
push eax ebx push eax ebx
call CanSave stdcall ted_can_save, tedit0
cmp al,1 cmp al,1
jne @f jne @f
push thread stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
push msgbox_2
call [mb_create] ;message: save changes in file?
;mov eax,5 ;mov eax,5
;mov ebx,50 ;mov ebx,50
;int 0x40 ;int 0x40
push msgbox_2_funct stdcall [mb_setfunctions],msgbox_2_funct
call [mb_setfunctions]
jmp .ret_f jmp .ret_f
@@: @@:
call On_NewFile call On_NewFile
@ -18,48 +16,59 @@ but_NewFile:
pop ebx eax pop ebx eax
ret ret
align 4
On_NewFile: On_NewFile:
push eax stdcall ted_clear, tedit0,1
mov al,1
call Clear
call draw_but_toolbar call draw_but_toolbar
stdcall draw_main_win, tedit0 stdcall draw_main_win, tedit0
pop eax
ret ret
align 4
On_SaveAndNewFile: On_SaveAndNewFile:
call but_SaveFile push edi
cmp byte[err_sav],0 mov edi, tedit0
stdcall but_SaveFile,edi
cmp ted_err_save,0
jne @f jne @f
call On_NewFile call On_NewFile
@@: @@:
pop edi
ret ret
align 4
but_no_msg_OpenFile: ;äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ç¥à¥§ ¡¥§ ®ª®­  á®®¡é¥­¨ï
stdcall ted_on_open_file, tedit0
ret
;äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
align 4
but_OpenFile: but_OpenFile:
push eax push eax
call CanSave stdcall ted_can_save, tedit0
cmp al,1 cmp al,1
jne @f jne @f
push thread stdcall [mb_create],msgbox_5,thread ;message: save changes in file?
push msgbox_5 stdcall [mb_setfunctions],msgbox_5_funct
call [mb_create] ;message: save changes in file?
push msgbox_5_funct
call [mb_setfunctions]
jmp .ret_f jmp .ret_f
@@: @@:
call On_OpenFile stdcall ted_on_open_file, tedit0
.ret_f: .ret_f:
pop eax pop eax
ret ret
On_OpenFile: align 4
push eax ebx proc ted_on_open_file, edit:dword ;äã­ªæ¨ï ®âªàëâ¨ï ä ©« 
push eax ebx edi
mov edi,dword[edit]
mov eax,70 mov eax,70
mov [run_file_70.func_n], 0 mov [run_file_70.func_n], 0
mov [run_file_70.param1], 0 mov [run_file_70.param1], 0
mov [run_file_70.param2], 0 mov [run_file_70.param2], 0
mov [run_file_70.param3], maxChars-2 ;sizeof.symbol mov [run_file_70.param3], maxChars-2 ;sizeof.symbol
m2m [run_file_70.param4], [tex] m2m [run_file_70.param4], ted_tex
mov [run_file_70.rezerv], 0 mov [run_file_70.rezerv], 0
push dword[edit1.text] push dword[edit1.text]
pop dword[run_file_70.name] pop dword[run_file_70.name]
@ -78,42 +87,42 @@ On_OpenFile:
add ax,48 add ax,48
mov byte[msgbox_4.err],al mov byte[msgbox_4.err],al
push thread stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
push msgbox_4
call [mb_create] ;message: Can-t open text file!
jmp .ret_f jmp .ret_f
@@: @@:
cmp ebx,-1 cmp ebx,-1
je .ret_f je .ret_f
;if open file ;if open file
call OpenFile call OpenFile
call draw_but_toolbar
stdcall draw_main_win, tedit0
cmp ebx,maxChars-2 cmp ebx,maxChars-2
jl .ret_f jl .ret_f
push thread stdcall [mb_create],msgbox_1,thread
push msgbox_1
call [mb_create]
.ret_f: .ret_f:
pop ebx eax pop edi ebx eax
ret ret
endp
but_SaveFile:
push eax ebx ecx edx align 4
call CanSave proc but_SaveFile, edit:dword
pushad
stdcall ted_can_save,edi
cmp al,0 cmp al,0
je .no_save je .no_save
mov ecx,maxChars mov edi,dword[edit]
mov ecx,maxChars
call mem_Alloc call mem_Alloc
push eax push eax
mov edx,[tex] mov edx,ted_tex
xor ecx,ecx xor ecx,ecx
@@: @@:
call IteratNext call IteratNext
cmp edx,[tex_1] cmp edx,ted_tex_1
jle @f ;edx = [tex] or edx = [tex]+sizeof.symbol jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol
mov bl,[edx] mov bl,[edx]
mov byte[eax],bl mov byte[eax],bl
inc eax inc eax
@ -137,7 +146,7 @@ but_SaveFile:
mov ebx,run_file_70 mov ebx,run_file_70
int 0x40 int 0x40
mov [err_sav],al mov ted_err_save,ax
cmp eax,0 cmp eax,0
je .no_msg je .no_msg
@ -151,22 +160,25 @@ but_SaveFile:
add ax,48 add ax,48
mov byte[msgbox_6.err],al mov byte[msgbox_6.err],al
push thread stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
push msgbox_6
call [mb_create] ;message: Can-t save text file!
jmp @f jmp @f
.no_msg: .no_msg:
m2m [ls_tim],[ch_tim] m2m ted_tim_ls,ted_tim_ch
@@: @@:
pop ecx pop ecx
call mem_Free call mem_Free
.no_save: .no_save:
pop edx ecx ebx eax popad
ret ret
endp
align 4
proc but_FindText, edit:dword
pushad
mov edi,dword[edit]
but_FindText:
push eax ebx ecx edx edi
call GetPos call GetPos
mov eax,[edit2.text] mov eax,[edit2.text]
mov bl,byte[eax] mov bl,byte[eax]
@ -176,7 +188,7 @@ but_FindText:
je @f ; find je @f ; find
call IteratNext call IteratNext
cmp edx,[tex_1] cmp edx,ted_tex_1
jle @f jle @f
jmp @b jmp @b
@@: @@:
@ -184,37 +196,43 @@ but_FindText:
je @f je @f
call GetTexCoords call GetTexCoords
inc ebx ;move cursor right inc ebx ;move cursor right
mov [sel.x1],ebx mov ted_sel_x1,ebx
mov [sel.y1],eax mov ted_sel_y1,eax
mov edx,eax mov edx,eax
mov ecx,ebx mov ecx,ebx
call GoToPos call GoToPos
mov edx,edi mov edx,esi ;esi ¡ë«® ãáâ ­®¢«¥® ¢ GetFindRezult
call GetTexCoords call GetTexCoords
mov [sel.x0],ebx mov ted_sel_x0,ebx
mov [sel.y0],eax mov ted_sel_y0,eax
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
jmp .end_find jmp .end_find
@@: @@:
push thread stdcall [mb_create],msgbox_7,thread ;message: Can not find text
push msgbox_7
call [mb_create] ;message: Can not find text
.end_find: .end_find:
pop edi edx ecx ebx eax popad
ret ret
endp
;input: ;input:
; eax - text need find ; eax - text need find
; bl - first symbol to find ; bl - first symbol to find
; edx - first symbol pointer ; edx - first symbol pointer
; edi - pointer to tedit struct
;output: ;output:
; bh - rezult ; bh - rezult
; edx - last text position (if find sucess) ; edx - last text position (if find sucess)
; edi - first symbol pointer ; esi - first symbol pointer
;description:
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
align 4
GetFindRezult: GetFindRezult:
push eax push eax
mov bh,1 mov bh,1
mov edi,edx ;copy edx mov esi,edx ;copy edx
@@: @@:
cmp byte[edx],bl cmp byte[edx],bl
jne .no_text jne .no_text
@ -225,95 +243,108 @@ GetFindRezult:
je @f ;end of find text je @f ;end of find text
call IteratNext ;*** get next symbol (in editor text) *** call IteratNext ;*** get next symbol (in editor text) ***
cmp edx,[tex_1] cmp edx,ted_tex_1
jle @f ;end of editor text jle @f ;end of editor text
jmp @b jmp @b
.no_text: .no_text:
xor bh,bh xor bh,bh
mov edx,edi ;restore edx mov edx,esi ;restore edx
@@: @@:
pop eax pop eax
mov bl,byte[eax] ;restore bl mov bl,byte[eax] ;restore bl
ret ret
but_OpenSyntax: align 4
cmp byte[panel_id],TE_PANEL_SYNTAX proc ted_but_open_syntax, edit:dword
jne @f push edi
stdcall dword[tl_node_get_data], dword tree1 mov edi,dword[edit]
pop dword[fn_col_option]
call InitColText
call CmColored
stdcall draw_main_win, tedit0
@@:
ret
but_select_word: cmp ted_panel_id,TE_PANEL_SYNTAX
push eax ebx ecx edx jne @f
stdcall dword[tl_node_get_data], tree1
pop dword[fn_col_option]
stdcall InitColText,edi
call CmColored
stdcall draw_main_win,edi
@@:
pop edi
ret
endp
align 4
proc ted_but_select_word, edit:dword
pushad
mov edi,dword[edit]
call GetPos call GetPos
push edx push edx
call ItPervColorTag call ItPervColorTag
cmp edx,[tex_1] cmp edx,ted_tex_1
jle @f jle @f
call GetTexCoords call GetTexCoords
mov [sel.x0],ebx mov ted_sel_x0,ebx
mov [sel.y0],eax mov ted_sel_y0,eax
@@: @@:
pop edx pop edx
call ItNextColorTag call ItNextColorTag
cmp edx,[tex_1] cmp edx,ted_tex_1
jle @f jle @f
call GetTexCoords call GetTexCoords
mov [sel.x1],ebx mov ted_sel_x1,ebx
mov [sel.y1],eax mov ted_sel_y1,eax
@@: @@:
pop edx ecx ebx eax
call draw_but_toolbar
stdcall draw_main_win, tedit0
jmp still
but_cut: call draw_but_toolbar
call but_Copy stdcall draw_main_win,edi
call SetUndo popad
push bx ret
mov bl,1 endp
call SelTextDel
pop bx align 4
proc ted_but_cut, edit:dword
push edi
mov edi,dword[edit]
stdcall ted_but_copy,edi
stdcall ted_set_undo,edi
stdcall SelTextDel,ted_opt_ed_change_time
cmp al,1 cmp al,1
jne @f jne @f
call draw_but_toolbar call draw_but_toolbar
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
@@: @@:
jmp still pop edi
ret
endp
;output: ;output:
; al = 1 if copy text ; al = 1 if copy text
but_Copy: align 4
push ax proc ted_but_copy, edit:dword
stdcall IsSel, tedit0 pushad
cmp al,0 mov edi,dword[edit]
jne @f
pop ax
ret ;if not selected text
@@:
call SelNormalize
push ebx ecx edx esi stdcall IsSel,edi
mov esi,[seln.x1] cmp al,0
mov ecx,[seln.y1] je .end_f ;if not selected text
stdcall SelNormalize,edi
mov esi,ted_seln_x1
mov ecx,ted_seln_y1
call GetPosByParam call GetPosByParam
mov ebx,edx mov ebx,edx
mov esi,[seln.x0] mov esi,ted_seln_x0
mov ecx,[seln.y0] mov ecx,ted_seln_y0
call GetPosByParam call GetPosByParam
mov esi,ebx mov esi,ebx
xor ecx,ecx xor ecx,ecx
mov ebx,buf mov ebx,buf
;mov edx,[tex] ;mov edx,ted_tex
@@: @@:
cmp edx,[tex_1] ;end of file cmp edx,ted_tex_1 ;end of file
jle @f jle @f
cmp edx,esi ;end of select cmp edx,esi ;end of select
je @f je @f
@ -332,42 +363,52 @@ but_Copy:
mov byte[ebx],0 mov byte[ebx],0
cmp ecx,0 cmp ecx,0
je @f je .end_f
call draw_but_toolbar call draw_but_toolbar
stdcall draw_bufer, tedit0 stdcall draw_bufer,edi
@@: .end_f:
pop esi edx ecx ebx ax popad
ret ret
endp
align 4
proc ted_but_paste, edit:dword
push eax ebx esi edi
mov edi,dword[edit]
but_paste:
push eax bx esi edi
mov esi,buf mov esi,buf
call strlen call strlen
cmp eax,1 cmp eax,1
jl @f jl @f
call SetUndo stdcall ted_set_undo,edi
mov esi,eax mov esi,eax
mov bx,0x0101 mov ebx,ted_opt_ed_change_time+ted_opt_ed_move_cursor
call SelTextDel stdcall SelTextDel,ebx
mov edi,buf cmp al,1
call TextAdd jne .del
mov ebx,ted_opt_ed_move_cursor
.del:
stdcall ted_text_add,edi,buf,esi,ebx
call draw_but_toolbar call draw_but_toolbar
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
@@: @@:
pop edi esi bx eax pop edi esi ebx eax
jmp still ret
endp
align 4
proc but_find, edit:dword ;¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª  proc but_find, edit:dword ;¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
push edi push edi
mov edi,[edit] mov edi,dword[edit]
cmp byte[panel_id],TE_PANEL_NULL cmp ted_panel_id,TE_PANEL_NULL
je @f je @f
mov byte[panel_id],TE_PANEL_NULL mov ted_panel_id,TE_PANEL_NULL
mov ted_wnd_l,0 mov ted_wnd_l,0
jmp .e_if jmp .e_if
@@: @@:
mov byte[panel_id],TE_PANEL_FIND mov ted_panel_id,TE_PANEL_FIND
mov ted_wnd_l,TE_PANEL_WIDTH mov ted_wnd_l,TE_PANEL_WIDTH
.e_if: .e_if:
stdcall EvSize,edi stdcall EvSize,edi
@ -376,51 +417,64 @@ proc but_find, edit:dword ;
ret ret
endp endp
align 4
but_replace: but_replace:
jmp still ret
align 4
but_find_key_w: but_find_key_w:
jmp still ret
align 4
proc but_sumb_upper, edit:dword
push edi esi
mov edi,dword[edit]
but_sumb_upper:
push edi
mov [conv_table],EvUpper mov [conv_table],EvUpper
call ConvertSelText call ConvertSelText
cmp edi,0 cmp esi,0
je @f je @f
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
@@: @@:
pop edi pop esi edi
jmp still ret
endp
align 4
proc but_sumb_lover, edit:dword
push edi esi
mov edi,dword[edit]
but_sumb_lover:
push edi
mov [conv_table],EvLover mov [conv_table],EvLover
call ConvertSelText call ConvertSelText
cmp edi,0 cmp esi,0
je @f je @f
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
@@: @@:
pop edi pop esi edi
jmp still ret
endp
but_reverse: align 4
push eax ebx proc but_reverse, edit:dword
stdcall IsSel, tedit0 push eax ebx edi
mov edi,dword[edit]
stdcall IsSel,edi
cmp al,0 cmp al,0
je @f je @f
call SelNormalize stdcall SelNormalize,edi
push esi ecx edx push esi ecx edx
mov esi,[seln.x0] mov esi,ted_seln_x0
mov ecx,[seln.y0] mov ecx,ted_seln_y0
call GetPosByParam call GetPosByParam
mov eax,edx mov eax,edx
mov esi,[seln.x1] mov esi,ted_seln_x1
cmp esi,0 cmp esi,0
je .beg_str je .beg_str
dec esi dec esi
.beg_str: .beg_str:
mov ecx,[seln.y1] mov ecx,ted_seln_y1
call GetPosByParam call GetPosByParam
;call GetTexPervPos ;call GetTexPervPos
mov ebx,edx mov ebx,edx
@ -429,95 +483,101 @@ but_reverse:
;je @f ;je @f
call Revers call Revers
@@: @@:
pop ebx eax stdcall draw_main_win,edi
stdcall draw_main_win, tedit0 pop edi ebx eax
jmp still
but_undo:
mov eax,[tim_Undo]
cmp [ch_tim],eax
jbe still
inc [tim_Undo]
;call CmColored
jmp red_win
but_redo:
cmp [tim_Undo],1
jb still
dec [tim_Undo]
;call CmColored
jmp red_win
but_sumb_invis:
xor [invis],1
jmp red_win
but_k_words_show:
xor byte[mode_colored],1
cmp byte[mode_colored],0
je red_win
call CmColored
; push eax ebx ecx esi edi
; mov eax,dword[cur_x]
; ColToIndexOffset eax,edx
; mov eax,4
; mov ebx,50*65536+75
; mov ecx,0x40ffffff
; mov edi,0x404040
; mov esi,10
; int 0x40
;
; mov eax,47
; mov ecx,250
; mov esi,0xffff80
; mov edx,50*65536+80
; mov esi,FkPos;[keyW]
; @@:
; mov ebx,0x30001
; cmp dx,300
; jl .no_br
; mov dx,80
; add edx,0x200000
; .no_br:
; add dx,10
; push ecx esi
; mov ecx,esi
; cmp dword[ecx],-1
; jne .no_minus
; mov ebx,0x10000
; mov ecx,1
; .no_minus:
; mov esi,0xffff00
; int 0x40
; pop esi ecx
; add esi,4
; loop @b
; pop edi esi ecx ebx eax
jmp red_win
but_CtrlHome:
mov [cur_x],0
mov [cur_y],0
mov [wScr.position],0
mov [hScr.position],0
call draw_but_toolbar
stdcall draw_main_win, tedit0
ret ret
endp
align 4
proc ted_but_undo, edit:dword
push eax edi
mov edi,dword[edit]
mov eax,ted_tim_undo
cmp ted_tim_ch,eax
jbe @f
inc ted_tim_undo
;call CmColored
stdcall draw_main_win,edi
call draw_but_toolbar
@@:
pop edi eax
ret
endp
align 4
proc ted_but_redo, edit:dword
push edi
mov edi,dword[edit]
cmp ted_tim_undo,1
jb @f
dec ted_tim_undo
;call CmColored
stdcall draw_main_win,edi
call draw_but_toolbar
@@:
pop edi
ret
endp
align 4
proc but_sumb_invis, edit:dword
push edi
mov edi,dword[edit]
xor ted_mode_invis,1
call draw_but_toolbar
stdcall draw_main_win,edi
pop edi
ret
endp
align 4
proc but_k_words_show, edit:dword
push edi
mov edi,dword[edit]
xor ted_mode_color,1
cmp ted_mode_color,0
je @f
call CmColored
@@:
call draw_but_toolbar
stdcall draw_main_win,edi
pop edi
ret
endp
;input:
; edi = pointer to tedit struct
align 4
but_CtrlHome:
mov ted_cur_x,0
mov ted_cur_y,0
push eax
mov eax,ted_scr_w
mov dword[eax+sb_offs_position],0
mov eax,ted_scr_h
mov dword[eax+sb_offs_position],0
pop eax
call draw_but_toolbar
stdcall draw_main_win,edi
ret
align 4
proc but_synt_show, edit:dword proc but_synt_show, edit:dword
push edi push edi
mov edi,[edit] mov edi,[edit]
cmp byte[panel_id],TE_PANEL_NULL cmp ted_panel_id,TE_PANEL_NULL
je @f je @f
mov byte[panel_id],TE_PANEL_NULL mov ted_panel_id,TE_PANEL_NULL
mov ted_wnd_l,0 mov ted_wnd_l,0
jmp .e_if jmp .e_if
@@: @@:
mov byte[panel_id],TE_PANEL_SYNTAX mov ted_panel_id,TE_PANEL_SYNTAX
mov ted_wnd_l,TE_PANEL_WIDTH mov ted_wnd_l,TE_PANEL_WIDTH
.e_if: .e_if:
stdcall EvSize,edi stdcall EvSize,edi
@ -526,11 +586,15 @@ proc but_synt_show, edit:dword
ret ret
endp endp
sel_KeyUp: align 4
cmp [dragk],1 proc ted_sel_key_up, edit:dword
push edi
mov edi,dword[edit]
cmp ted_drag_k,1
je @f je @f
call SelStart stdcall SelStart,edi
mov [dragk],1 mov ted_drag_k,1
@@: @@:
push dx push dx
call CurMoveUp call CurMoveUp
@ -539,15 +603,21 @@ sel_KeyUp:
call OnInitialUpdate call OnInitialUpdate
@@: @@:
pop dx pop dx
call SelMove stdcall SelMove,edi
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
pop edi
ret ret
endp
sel_KeyDown: align 4
cmp [dragk],1 proc ted_sel_key_down, edit:dword
push edi
mov edi,dword[edit]
cmp ted_drag_k,1
je @f je @f
call SelStart stdcall SelStart,edi
mov [dragk],1 mov ted_drag_k,1
@@: @@:
push dx push dx
call CurMoveDown call CurMoveDown
@ -556,54 +626,68 @@ sel_KeyDown:
call OnInitialUpdate call OnInitialUpdate
@@: @@:
pop dx pop dx
call SelMove stdcall SelMove,edi
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
pop edi
ret ret
endp
sel_KeyLeft: align 4
cmp [dragk],1 proc ted_sel_key_left, edit:dword
push edi
mov edi,dword[edit]
cmp ted_drag_k,1
je @f je @f
call SelStart stdcall SelStart,edi
@@: @@:
push dx push dx
call CurMoveLeft call CurMoveLeft
call SelMove stdcall SelMove,edi
cmp [dragk],1 cmp ted_drag_k,1
je @f je @f
mov [dragk],1 mov ted_drag_k,1
mov dl,8 mov dl,8
@@: @@:
cmp dl,8 cmp dl,8
jne @f jne @f
call OnInitialUpdate call OnInitialUpdate
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
jmp .end_f jmp .end_f
@@: @@:
stdcall draw_cur_line, tedit0 stdcall draw_cur_line,edi
.end_f: .end_f:
pop dx pop dx
pop edi
ret ret
endp
sel_KeyRight: align 4
cmp [dragk],1 proc ted_sel_key_right, edit:dword
push edi
mov edi,dword[edit]
cmp ted_drag_k,1
je @f je @f
call SelStart stdcall SelStart,edi
@@: @@:
push dx push dx
call CurMoveRight call CurMoveRight
call SelMove stdcall SelMove,edi
cmp [dragk],1 cmp ted_drag_k,1
je @f je @f
mov [dragk],1 mov ted_drag_k,1
mov dl,8 mov dl,8
@@: @@:
cmp dl,8 cmp dl,8
jne @f jne @f
call OnInitialUpdate call OnInitialUpdate
stdcall draw_main_win, tedit0 stdcall draw_main_win,edi
jmp .end_f jmp .end_f
@@: @@:
stdcall draw_cur_line, tedit0 stdcall draw_cur_line,edi
.end_f: .end_f:
pop dx pop dx
ret pop edi
ret
endp

View File

@ -300,17 +300,116 @@ ted_rec_w equ dword[edi+24] ;
ted_rec_h equ dword[edi+28] ;¢ëá®â  ᨬ¢®«  (§­ ª®¬¥áâ ) ¢ ®ª­¥ ted_rec_h equ dword[edi+28] ;¢ëá®â  ᨬ¢®«  (§­ ª®¬¥áâ ) ¢ ®ª­¥
ted_drag_m equ byte[edi+32] ;¢ë¤¥«¥­¨¥ ®â ¬ëè¨ ted_drag_m equ byte[edi+32] ;¢ë¤¥«¥­¨¥ ®â ¬ëè¨
ted_drag_k equ byte[edi+33] ;¢ë¤¥«¥­¨¥ ®â ª« ¢¨ âãàë ted_drag_k equ byte[edi+33] ;¢ë¤¥«¥­¨¥ ®â ª« ¢¨ âãàë
ted_sel_x0 equ dword[edi+34] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï x0
ted_sel_y0 equ dword[edi+38] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï y0
ted_sel_x1 equ dword[edi+42] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï x1
ted_sel_y1 equ dword[edi+46] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï y1
;§ ¯ á­ë¥ ª®®à¤¨­ âë ¢ë¤¥«¥­¨ï
ted_seln_x0 equ dword[edi+50]
ted_seln_y0 equ dword[edi+54]
ted_seln_x1 equ dword[edi+58]
ted_seln_y1 equ dword[edi+62]
ted_tex equ dword[edi+66] ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ⥪áâ 
ted_tex_1 equ dword[edi+70] ;㪠§ â¥«ì ­  1-î áâàªãâàã ᨬ¢®« 
ted_tex_end equ dword[edi+74] ;㪠§ â¥«ì ­  ¯®á«¥¤­îî áâàãªâãàã ᨬ¢®« 
ted_cur_x equ dword[edi+78] ;ª®®à¤¨­ â  x ªãàá®à 
ted_cur_y equ dword[edi+82] ;ª®®à¤¨­ â  y ªãàá®à 
ted_cur_ins equ byte[edi+86] ;०¨¬ à ¡®âë ªãàá®à  (®¡ëç­ë© ¨«¨ § ¬¥­ )
ted_mode_color equ byte[edi+87] ;०¨¬ ¢ë¤¥«¥­¨ï á«®¢ 梥⮬ (0-¢ëª«. 1-¢ª«.)
ted_mode_invis equ byte[edi+88] ;०¨¬ ¯®ª §  ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
ted_gp_opt equ byte[edi+89] ;®¯æ¨¨ ¢®§¢à é ¥¬ë¥ ä㭪樥© GetPos
ted_colors_text_count equ dword[edi+90] ;ª®««¨ç¥á⢮ 梥⮢ ⥪áâ 
ted_key_words_count equ dword[edi+94] ;ª®««¨ç¥á⢮ ª«î祢ëå á«®¢
ted_color_cursor equ dword[edi+98] ;梥⠪ãàá®à 
ted_color_wnd_capt equ dword[edi+102] ;梥⠯®«¥© ¢®ªà㣠®ª­ 
ted_color_wnd_work equ dword[edi+106] ;梥â ä®­  ®ª­ 
ted_color_wnd_bord equ dword[edi+110] ;梥â ⥪áâ  ­  ¯®«ïå
ted_color_select equ dword[edi+114] ;梥⠢뤥«¥­¨ï
ted_color_cur_text equ dword[edi+118] ;梥â ᨬ¢®«  ¯®¤ ªãàá®à®¬
ted_color_wnd_text equ dword[edi+122] ;梥â ⥪áâ  ¢ ®ª­¥
ted_syntax_file equ dword[edi+126] ;㪠§ â¥«ì ­  ­ ç «® ä ©«  ᨭ⠪á¨á 
ted_syntax_file_end equ dword[edi+130] ;㪠§ â¥«ì ­  ª®­¥æ ä ©«  ᨭ⠪á¨á 
ted_text_colors equ dword[edi+134] ;㪠§ â¥«ì ­  ¬ áᨢ 梥⮢ ⥪áâ 
ted_help_text_f1 equ dword[edi+138] ;㪠§ â¥«ì ­  ⥪áâ á¯à ¢ª¨ (¯® ­ ¦ â¨¨ F1)
ted_help_id equ dword[edi+142] ;¨¤¥­â¨ä¨ª â®à ¤«ï á¯à ¢ª¨
ted_key_words_data equ dword[edi+146] ;㪠§ â¥«ì ­  áâàãªâãàë ª«î祢ëå á«®¢ TexColViv
ted_tim_ch equ dword[edi+150] ;ª®««¨ç¥á⢮ ¨§¬¥­¥­¨© ¢ ä ©«¥
ted_tim_undo equ dword[edi+154] ;ª®««¨ç¥á⢮ ®â¬¥­¥­­ëå ¤¥©á⢨©
ted_tim_ls equ dword[edi+158] ;¢à¥¬ï ¯®á«¥¤­¥£® á®åà ­¥­¨ï
ted_tim_co equ dword[edi+162] ;¢à¥¬ï ¯®á«¥¤­¥© 梥⮢®© à §¬¥âª¨
ted_el_focus equ dword[edi+166] ;㪠§ â¥«ì ­  ¯¥à¥¬¥­­ãî í«¥¬¥­â  ¢ 䮪ãá¥
ted_err_save equ word[edi+170] ;®è¨¡ª  á®åà ­¥­¨ï ä ©« 
ted_key_new equ byte[edi+172] ;ᨬ¢®«, ª®â®àë© ¡ã¤¥â ¤®¡ ¢«ïâáï á ª« ¢¨ âãàë
ted_symbol_new_line equ byte[edi+173] ;ᨬ¢®« § ¢¥à襭¨ï áâப¨
ted_scr_w equ dword[edi+174] ;¢¥à⨪ «ì­ë© áªà®««¨­£
ted_scr_h equ dword[edi+178] ;£®à¨§®­â «ì­ë© áªà®««¨­£
ted_panel_id equ byte[edi+182] ;­®¬¥à ®âªàë⮩ ¯ ­¥«¨
;------------------------------------------------------------------------------
sb_offs_max_area equ 16
sb_offs_cur_area equ 20
sb_offs_position equ 24
sb_offs_redraw equ 40
;------------------------------------------------------------------------------
ted_opt_ed_move_cursor equ 1 ;¤¢¨£ âì ªãàá®à ¯®á«¥ ¤®¡ ¢«¥­¨ï ⥪áâ 
ted_opt_ed_change_time equ 2 ;¤®¡ ¢«ïâì ¨§¬¥­¥­¨ï ¯à¨ । ªâ¨à®¢ ­¨¨ ⥪áâ 
ted_offs_sel equ 34 ;ᬥ饭¨¥ áâàãªâãàë sel
ted_offs_seln equ 50 ;ᬥ饭¨¥ áâàãªâãàë seln
ted_offs_count_colors equ 90 ;ᬥ饭¨¥ ¯¥à¥¬¥­­®© ª®««¨ç¥á⢠ 梥⮢
ted_offs_key_new equ 172
ted_offs_symbol_new_line equ 173 ;ᬥ饭¨¥ ᨬ¢®«  ­®¢®© áâப¨
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
tedit0: ;áâàãªâãà  â¥ªá⮢®£® । ªâ®à  tedit0: ;áâàãªâãà  â¥ªá⮢®£® । ªâ®à 
.wnd BOX 0,50,440,150 ;+ 0 .wnd BOX 0,50,440,150 ;+ 0
.rec BOX 30,23,7,10 ;+16 .rec BOX 30,23,7,10 ;+16
.dragm db 0 ;+32 ¢ë¤¥«¥­¨¥ ®â ¬ëè¨ .drag_m db 0 ;+32 ¢ë¤¥«¥­¨¥ ®â ¬ëè¨
dragk db 0 ;+33 ¢ë¤¥«¥­¨¥ ®â ª« ¢¨ âãàë .drag_k db 0 ;+33 ¢ë¤¥«¥­¨¥ ®â ª« ¢¨ âãàë
sel TexSelect 0,0,0,0 ;+34 áâàãªâãà  ¢ë¤¥«¥­¨ï .sel TexSelect 0,0,0,0 ;+34 áâàãªâãà  ¢ë¤¥«¥­¨ï
seln TexSelect ;+50 ¤®¯®«­¨â¥«ì­ ï áâàãªâãà  ¢ë¤¥«¥­¨ï .seln TexSelect ;+50 ¤®¯®«­¨â¥«ì­ ï áâàãªâãà  ¢ë¤¥«¥­¨ï
.tex dd 0 ;+66 text memory pointer
.tex_1 dd 0 ;+70 text first symbol pointer
.tex_end dd 0 ;+74 text end memory pointer
.cur_x dd 0 ;+78
.cur_y dd 0 ;+82
.cur_ins db 1 ;+86
.mode_color db 1 ;+87 ०¨¬ ¢ë¤¥«¥­¨ï á«®¢ 梥⮬ (0-¢ëª«. 1-¢ª«.)
.mode_invis db 0 ;+88 ०¨¬ ¯®ª §  ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
.gp_opt db 0 ;+89 ®¯æ¨¨ ¢®§¢à é ¥¬ë¥ ä㭪樥© GetPos
; \/ ­¥ à §à뢠âì á«¥¤ãî騥 ¯¥à¥¬¥­­ë¥:
.count_colors_text dd 1 ;+90 ª®««¨ç¥á⢮ 梥⮢ ⥪áâ 
.count_key_words dd 0 ;+94 ª®««¨ç¥á⢮ ª«î祢ëå á«®¢
.color_cursor dd 0x808080 ;+98 梥⠪ãàá®à 
.color_wnd_capt dd 0x80 ;+102 梥⠯®«¥© ¢®ªà㣠®ª­ 
.color_wnd_work dd 0x0 ;+106 梥â ä®­  ®ª­ 
.color_wnd_bord dd 0xd0d0d0 ;+110 梥â ⥪áâ  ­  ¯®«ïå
.color_select dd 0x208080 ;+114 梥⠢뤥«¥­¨ï
.color_cur_text dd 0xff0000 ;+118 梥â ᨬ¢®«  ¯®¤ ªãàá®à®¬
.color_wnd_text dd 0xffff00 ;+122 梥â ⥪áâ  ¢ ®ª­¥
; /\ ¤à㣨¥, ¨¤ã騥 ­¨¦¥ ¬®¦­® à §à뢠âì.
.syntax_file dd 0 ;+126 㪠§ â¥«ì ­  ­ ç «® ä ©«  ᨭ⠪á¨á 
.syntax_file_end dd 0 ;+130 㪠§ â¥«ì ­  ª®­¥æ ä ©«  ᨭ⠪á¨á 
.text_colors dd 0 ;+134 㪠§ â¥«ì ­  ¬ áᨢ 梥⮢ ⥪áâ 
.help_text_f1 dd 0 ;+138 㪠§ â¥«ì ­  ⥪áâ á¯à ¢ª¨ (¯® ­ ¦ â¨¨ F1)
.help_id dd -1 ;+142 ¨¤¥­â¨ä¨ª â®à ¤«ï á¯à ¢ª¨
.key_words_data dd 0 ;+146 㪠§ â¥«ì ­  áâàãªâãàë ª«î祢ëå á«®¢ TexColViv
.tim_ch dd ? ;+150 ª®«¨ç¥á⢮ ¨§¬¥­¥­¨© ¢ ä ©«¥
.tim_undo dd ? ;+154 ª®«¨ç¥á⢮ ®â¬¥­¥­­ëå ¤¥©á⢨©
.tim_ls dd ? ;+158 ¢à¥¬ï ¯®á«¥¤­¥£® á®åà ­¥­¨ï
.tim_co dd ? ;+162 ¢à¥¬ï ¯®á«¥¤­¥© 梥⮢®© à §¬¥âª¨
.el_focus dd el_focus ;+166 㪠§ â¥«ì ­  ¯¥à¥¬¥­­ãî í«¥¬¥­â  ¢ 䮪ãá¥
.err_save dw 0 ;+170 ®è¨¡ª  á®åà ­¥­¨ï ä ©« 
.key_new db 0 ;+172 ᨬ¢®«, ª®â®àë© ¡ã¤¥â ¤®¡ ¢«ïâáï á ª« ¢¨ âãàë
.symbol_new_line db 20 ;+173 ᨬ¢®« § ¢¥à襭¨ï áâப¨
.scr_w dd wScr ;+174 ¢¥à⨪ «ì­ë© áªà®««¨­£
.scr_h dd hScr ;+178 £®à¨§®­â «ì­ë© áªà®««¨­£
.panel_id db 0 ;+182 ­®¬¥à ®âªàë⮩ ¯ ­¥«¨
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
FkPos: rd 256
conv_tabl rb 128 ; â ¡«¨æ  ¤«ï ª®­¢¥àâ¨à®¢ ­¨ï scan-ª®¤  ¢ ascii-ª®¤
el_focus dd 0 el_focus dd 0
mouse_dd dd 0 mouse_dd dd 0
tree1 tree_list 264,count_of_dir_list_files+2, tl_key_no_edit+tl_draw_par_line+tl_list_box_mode,\ tree1 tree_list 264,count_of_dir_list_files+2, tl_key_no_edit+tl_draw_par_line+tl_list_box_mode,\
@ -392,8 +491,7 @@ msgbox_5:
db 'Žâ¬¥­ ',0 db 'Žâ¬¥­ ',0
db 0 db 0
msgbox_5_funct: msgbox_5_funct:
; dd but_SaveFile dd but_no_msg_OpenFile
dd On_OpenFile
dd 0 dd 0
msgbox_6: msgbox_6:
@ -497,8 +595,7 @@ msgbox_5:
db 'Cancel',0 db 'Cancel',0
db 0 db 0
msgbox_5_funct: msgbox_5_funct:
; dd but_SaveFile dd but_no_msg_OpenFile
dd On_OpenFile
dd 0 dd 0
msgbox_6: msgbox_6:

View File

@ -1,3 +1,4 @@
align 4
proc mouse_wnd_main, edit:dword proc mouse_wnd_main, edit:dword
push eax ebx ecx edi push eax ebx ecx edi
mcall 37,2 ;get mouse buttons mcall 37,2 ;get mouse buttons
@ -49,6 +50,7 @@ endp
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit ; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
;description: ;description:
; ôóíêöèÿ âûçûâåòñÿ ïðè íàæàòèè êíîïêîé ìûøè è ïîïàäåíèè êóðñîðîì â îêíî ðåäàêòîðà ; ôóíêöèÿ âûçûâåòñÿ ïðè íàæàòèè êíîïêîé ìûøè è ïîïàäåíèè êóðñîðîì â îêíî ðåäàêòîðà
align 4
wnd_main_click: wnd_main_click:
push ecx edx push ecx edx
@ -67,7 +69,7 @@ wnd_main_click:
mov eax,[hScr.cur_area] mov eax,[hScr.cur_area]
@@: @@:
;dec eax ;dec eax
mov [cur_x],eax mov ted_cur_x,eax
pop eax pop eax
push eax push eax
@ -84,20 +86,21 @@ wnd_main_click:
mov eax,[wScr.cur_area] mov eax,[wScr.cur_area]
@@: @@:
dec eax dec eax
mov [cur_y],eax mov ted_cur_y,eax
pop eax pop eax
cmp ted_drag_m,0 cmp ted_drag_m,0
je @f je @f
call SelMove stdcall SelMove,edi
jmp .sel_move jmp .sel_move
@@: @@:
mov ted_drag_m,1 mov ted_drag_m,1
call SelStart stdcall SelStart,edi
.sel_move: .sel_move:
pop edx ecx pop edx ecx
ret ret
align 4
wnd_main_mouse_scroll: wnd_main_mouse_scroll:
push eax ebx push eax ebx
mcall 37,7 mcall 37,7
@ -122,9 +125,11 @@ wnd_main_mouse_scroll:
pop ebx eax pop ebx eax
ret ret
draw_but_toolbar: align 4
draw_but_toolbar: ;âíåøíÿÿ ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
push ebx ecx edx edi
mov edi,tedit0
push ebx ecx edx
mov ecx,0x40000000 mov ecx,0x40000000
; mov edx,5*65536+25 ; mov edx,5*65536+25
mov edx,85*65536+2 mov edx,85*65536+2
@ -135,7 +140,7 @@ draw_but_toolbar:
mov edx,110*65536+2 mov edx,110*65536+2
call draw_but_icon call draw_but_icon
call CanSave stdcall ted_can_save,edi
cmp al,1 cmp al,1
je @f je @f
and ecx,0xffff and ecx,0xffff
@ -150,7 +155,7 @@ or ecx,0x40000000
mov edx,85*65536+25 mov edx,85*65536+25
call draw_but_icon call draw_but_icon
stdcall IsSel, tedit0 stdcall IsSel,edi
cmp al,0 cmp al,0
jne @f jne @f
and ecx,0xffff and ecx,0xffff
@ -197,8 +202,8 @@ or ecx,0x40000000
mov edx,235*65536+25 mov edx,235*65536+25
call draw_but_icon call draw_but_icon
mov ebx,[tim_Undo] mov ebx,ted_tim_undo
cmp [ch_tim],ebx cmp ted_tim_ch,ebx
jg @f jg @f
and ecx,0xffff and ecx,0xffff
@@: @@:
@ -207,7 +212,7 @@ and ecx,0xffff
call draw_but_icon call draw_but_icon
or ecx,0x40000000 or ecx,0x40000000
cmp [tim_Undo],1 cmp ted_tim_undo,1
jge @f jge @f
and ecx,0xffff and ecx,0xffff
@@: @@:
@ -228,11 +233,12 @@ or ecx,0x40000000
mov edx,450*65536+25 mov edx,450*65536+25
call draw_but_icon call draw_but_icon
pop edx ecx ebx pop edi edx ecx ebx
ret ret
;input: ;input:
; clear_o - åñëè =1 î÷èñòèòü îäíó ñòðîêó, =0 î÷èñòèòü âñå ñòðîêè îêíà äî íèçó ; clear_o - åñëè =1 î÷èñòèòü îäíó ñòðîêó, =0 î÷èñòèòü âñå ñòðîêè îêíà äî íèçó
align 4
proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
pushad pushad
mov edi,dword[edit] mov edi,dword[edit]
@ -265,7 +271,7 @@ proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:d
sub ebx,ted_rec_l sub ebx,ted_rec_l
xor cx,cx xor cx,cx
add ecx,ted_rec_h add ecx,ted_rec_h
mov edx,[WND_WORK_COLOR] mov edx,ted_color_wnd_work
cmp dword[clear_o],0 cmp dword[clear_o],0
je .pusto je .pusto
@ -278,11 +284,11 @@ proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:d
stdcall IsSel,edi stdcall IsSel,edi
cmp al,0 cmp al,0
je @f je @f
cmp [seln.y0],esi cmp ted_seln_y0,esi
jg @f jg @f
cmp [seln.y1],esi cmp ted_seln_y1,esi
jl @f jl @f
mov edx,[SELECT_COLOR] ;draw selected line mov edx,ted_color_select ;draw selected line
@@: @@:
mov eax,13 ;rect mov eax,13 ;rect
@ -295,10 +301,10 @@ proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:d
mov al,13 ;rect mov al,13 ;rect
xor cx,cx xor cx,cx
add ecx,ted_rec_h add ecx,ted_rec_h
cmp [seln.y0],esi cmp ted_seln_y0,esi
jne @f jne @f
push bx push bx
mov edx,[seln.x0] ; âĺđőí˙˙ ďîëîńŕ (çŕňčđŕĺň ńëĺâŕ) mov edx,ted_seln_x0 ; âåðõíÿÿ ïîëîñà (çàòèðàåò ñëåâà)
cmp edx,[hScr.position] cmp edx,[hScr.position]
jle .in_wnd jle .in_wnd
sub edx,[hScr.position] sub edx,[hScr.position]
@ -308,13 +314,13 @@ proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:d
.in_wnd: .in_wnd:
mov bx,0 mov bx,0
.no_wnd: .no_wnd:
mov edx,[WND_WORK_COLOR] mov edx,ted_color_wnd_work
int 0x40 int 0x40
pop bx pop bx
@@: @@:
cmp [seln.y1],esi cmp ted_seln_y1,esi
jne @f jne @f
mov edx,[seln.x1] ; íčćí˙˙ ďîëîńŕ (çŕňčđŕĺň ńďđŕâŕ) mov edx,ted_seln_x1 ; íèæíÿÿ ïîëîñà (çàòèðàåò ñïðàâà)
cmp edx,[hScr.position] cmp edx,[hScr.position]
jle .in_wnd2 jle .in_wnd2
sub edx,[hScr.position] sub edx,[hScr.position]
@ -324,7 +330,7 @@ proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:d
add ebx,edx add ebx,edx
.in_wnd2: .in_wnd2:
mov edx,[WND_WORK_COLOR] mov edx,ted_color_wnd_work
int 0x40 int 0x40
@@: @@:
@ -333,7 +339,7 @@ proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:d
ret ret
endp endp
align 4
proc draw_main_win, edit:dword proc draw_main_win, edit:dword
locals locals
line_num dd ? line_num dd ?
@ -342,9 +348,8 @@ proc draw_main_win, edit:dword
mov edi,dword[edit] mov edi,dword[edit]
mov eax,4 ;draw text mov eax,4 ;draw text
mov ecx,[tex_colors] mov ecx,ted_text_colors
push dword[ecx] mov ecx,dword[ecx]
pop ecx
mov ebx,ted_wnd_l mov ebx,ted_wnd_l
add ebx,ted_rec_l add ebx,ted_rec_l
@ -353,22 +358,22 @@ proc draw_main_win, edit:dword
add ebx,ted_rec_t add ebx,ted_rec_t
add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
call SelNormalize ;need before draw select stdcall SelNormalize,edi ;need before draw select
mov esi,[wScr.position] mov esi,[wScr.position]
mov dword[line_num],esi mov dword[line_num],esi
stdcall clear_line_before_draw, tedit0,ebx,1,esi stdcall clear_line_before_draw, edi,ebx,1,esi
call GetFirstVisiblePos call GetFirstVisiblePos
cmp edx,0 cmp edx,0
je .no_draw_text je .no_draw_text
mov esi,1 ;äëèííà âûâîäèìîãî òåêñòà ïî 1-ìó ñèìâîëó mov esi,1 ;äëèííà âûâîäèìîãî òåêñòà ïî 1-ìó ñèìâîëó
@@: @@:
call IteratNext call IteratNext
cmp edx,[tex_1] cmp edx,ted_tex_1
jle .no_draw_text jle .no_draw_text
; *** öâåòîâàÿ ðàçìåòêà ; *** öâåòîâàÿ ðàçìåòêà
cmp byte[mode_colored],0 cmp ted_mode_color,0
je .no_col_change je .no_col_change
cmp byte[edx+1],0 cmp byte[edx+1],0
je .no_col_change je .no_col_change
@ -377,10 +382,11 @@ proc draw_main_win, edit:dword
cmp byte [edx],13 cmp byte [edx],13
jne .no_13 jne .no_13
cmp [invis],1 cmp ted_mode_invis,1
jne .no_invis jne .no_invis
push edx push edx
mov edx,symbol_new_line mov edx,edi
add edx,ted_offs_symbol_new_line
int 0x40 int 0x40
pop edx pop edx
.no_invis: .no_invis:
@ -391,7 +397,7 @@ proc draw_main_win, edit:dword
cmp bx,ax cmp bx,ax
jg .no_draw_text jg .no_draw_text
mov eax,4 mov eax,4
;optimized output /\ ;optimized output /\
and ebx,0xffff and ebx,0xffff
ror ebx,16 ror ebx,16
add ebx,ted_wnd_l add ebx,ted_wnd_l
@ -399,7 +405,7 @@ proc draw_main_win, edit:dword
inc ebx inc ebx
ror ebx,16 ror ebx,16
inc dword[line_num] ;increment line number inc dword[line_num] ;increment line number
stdcall clear_line_before_draw, tedit0,ebx,1,dword[line_num] stdcall clear_line_before_draw,edi,ebx,1,dword[line_num]
call OptDrawLineLeft call OptDrawLineLeft
jmp @b jmp @b
.no_13: .no_13:
@ -418,9 +424,9 @@ proc draw_main_win, edit:dword
jmp @b jmp @b
.no_draw_text: .no_draw_text:
stdcall clear_line_before_draw, tedit0,ebx,0,dword[line_num] stdcall clear_line_before_draw,edi,ebx,0,dword[line_num]
stdcall draw_line_numbers, tedit0 stdcall draw_line_numbers,edi
stdcall draw_main_cursor, tedit0 stdcall draw_main_cursor,edi
;--------------------------------------------- ;---------------------------------------------
; set all_redraw flag for draw all ScrollBar ; set all_redraw flag for draw all ScrollBar
@ -472,11 +478,12 @@ endp
;txtBDn db 25 ;txtBDn db 25
;txtBRi db 26 ;txtBRi db 26
;txtBLe db 27 ;txtBLe db 27
align 4
proc draw_panel_find, edit:dword proc draw_panel_find, edit:dword
push edi push edi
mov edi,dword[edit] mov edi,dword[edit]
cmp byte[panel_id],TE_PANEL_FIND ;if not panel cmp ted_panel_id,TE_PANEL_FIND ;if not panel
jne @f jne @f
push eax ebx ecx edx push eax ebx ecx edx
@ -496,8 +503,7 @@ proc draw_panel_find, edit:dword
mov edx,txtFindCapt mov edx,txtFindCapt
int 0x40 int 0x40
push dword edit2 stdcall [edit_box_draw], dword edit2
call [edit_box_draw]
mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
mov ebx,TE_PANEL_WIDTH mov ebx,TE_PANEL_WIDTH
@ -542,11 +548,13 @@ proc draw_panel_find, edit:dword
ret ret
endp endp
align 4
proc draw_panel_syntax, edit:dword proc draw_panel_syntax, edit:dword
push edi push edi
mov edi,dword[edit] mov edi,dword[edit]
cmp byte[panel_id],TE_PANEL_SYNTAX ;if not panel cmp ted_panel_id,TE_PANEL_SYNTAX ;if not panel
jne @f jne @f
push eax ebx ecx edx push eax ebx ecx edx
@ -558,7 +566,7 @@ proc draw_panel_syntax, edit:dword
mov edx,[sc.work] mov edx,[sc.work]
int 0x40 ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà int 0x40 ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
stdcall dword[tl_draw], dword tree1 stdcall dword[tl_draw], tree1
mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà
stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox
@ -613,6 +621,8 @@ proc draw_panel_syntax, edit:dword
ret ret
endp endp
align 4
proc draw_cur_line, edit:dword proc draw_cur_line, edit:dword
pushad pushad
mov edi,dword[edit] mov edi,dword[edit]
@ -620,33 +630,33 @@ proc draw_cur_line, edit:dword
mov ebx,ted_wnd_l mov ebx,ted_wnd_l
add ebx,ted_rec_l add ebx,ted_rec_l
shl ebx,16 shl ebx,16
mov eax,[cur_y] mov eax,ted_cur_y
imul eax,ted_rec_h imul eax,ted_rec_h
mov bx,ax mov bx,ax
add ebx,ted_wnd_t add ebx,ted_wnd_t
add ebx,ted_rec_t ;ebx - êîîðäèíàòû äëÿ ïðÿìîóãîëüíèêà î÷èñòêè ëèíèè add ebx,ted_rec_t ;ebx - êîîðäèíàòû äëÿ ïðÿìîóãîëüíèêà î÷èñòêè ëèíèè
add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
call SelNormalize ;need before draw select stdcall SelNormalize,edi ;need before draw select
mov ecx,[cur_y] mov ecx,ted_cur_y
add ecx,[wScr.position] add ecx,[wScr.position]
stdcall clear_line_before_draw, tedit0, ebx,1,ecx stdcall clear_line_before_draw, tedit0, ebx,1,ecx
mov esi,[hScr.position] mov esi,[hScr.position]
call GetPosByParam call GetPosByParam
cmp [gpOpt],2 cmp ted_gp_opt,2
jne .no_draw_text jne .no_draw_text
; mov eax,4 ;draw text ; mov eax,4 ;draw text
call GetSymbColor call GetSymbColor
mov esi,1 ;draw 1 symbol mov esi,1 ;draw 1 symbol
@@: @@:
;call IteratNext ;call IteratNext
cmp edx,[tex_1] cmp edx,ted_tex_1
jle .no_draw_text jle .no_draw_text
; *** öâåòîâàÿ ðàçìåòêà ; *** öâåòîâàÿ ðàçìåòêà
cmp byte[mode_colored],0 cmp ted_mode_color,0
je .no_col_change je .no_col_change
cmp byte[edx+1],0 cmp byte[edx+1],0
je .no_col_change je .no_col_change
@ -656,10 +666,11 @@ proc draw_cur_line, edit:dword
mov eax,4 ;draw text mov eax,4 ;draw text
cmp byte [edx],13 cmp byte [edx],13
jne .no_13 jne .no_13
cmp [invis],1 cmp ted_mode_invis,1
jne .no_draw_text jne .no_draw_text
push edx push edx
mov edx,symbol_new_line mov edx,edi
add edx,ted_offs_symbol_new_line
int 0x40 int 0x40
pop edx pop edx
jmp .no_draw_text jmp .no_draw_text
@ -677,7 +688,7 @@ proc draw_cur_line, edit:dword
jmp @b jmp @b
.no_draw_text: .no_draw_text:
stdcall draw_main_cursor, tedit0 stdcall draw_main_cursor,edi
popad popad
ret ret
endp endp
@ -685,6 +696,7 @@ endp
MIN_M_WND_H equ 100 MIN_M_WND_H equ 100
MIN_W_SCRL_ARE equ 3 MIN_W_SCRL_ARE equ 3
MIN_H_SCRL_ARE equ 3 MIN_H_SCRL_ARE equ 3
align 4
proc EvSize, edit:dword proc EvSize, edit:dword
push eax ecx edx edi push eax ecx edx edi
mov edi,dword[edit] mov edi,dword[edit]
@ -759,23 +771,28 @@ proc EvSize, edit:dword
ret ret
endp endp
align 4
OnInitialUpdate: OnInitialUpdate:
mov [wScr.redraw],1 mov [wScr.redraw],1
mov [hScr.redraw],1 mov [hScr.redraw],1
ret ret
;input:
; edi = pointer to tedit struct
;output: ;output:
; ecx = íîâûé öâåò ñèìâîëà
; edx = pointer to symbol ; edx = pointer to symbol
; edx = 0 if text not in screen ; edx = 0 if text not in screen
align 4
GetFirstVisiblePos: GetFirstVisiblePos:
push ecx push ecx
mov edx,[tex] mov edx,ted_tex
xor ecx,ecx xor ecx,ecx
@@: @@:
cmp ecx,[wScr.position] cmp ecx,[wScr.position]
je @f je @f
call IteratNext call IteratNext
cmp edx,[tex_1] cmp edx,ted_tex_1
jle @f jle @f
cmp byte [edx],13 cmp byte [edx],13
jne @b jne @b
@ -799,23 +816,27 @@ GetFirstVisiblePos:
;input: ;input:
; edx = pointer to symbol ; edx = pointer to symbol
; edi = pointer to tedit struct
;output: ;output:
; edx = pointer to first left symbol ; ecx = íîâûé öâåò ñèìâîëà
OptDrawLineLeft: ; edx = óêàçàòåëü íà ïåðâûé ëåâûé ñèìâîë
push ecx align 4
mov ecx,[hScr.position] proc OptDrawLineLeft
cmp ecx,0 push ebx
mov ebx,[hScr.position]
cmp ebx,0
je .ret_f je .ret_f
push eax push eax
mov eax,edx mov eax,edx
cmp edx,[tex] cmp edx,ted_tex
jne @f jne @f
call IteratNext call IteratNext
jmp .beg_cycle jmp .beg_cycle
@@: @@:
cmp ecx,0 cmp ebx,0
je @f je @f
cmp byte[edx],13 cmp byte[edx],13
@ -823,33 +844,50 @@ OptDrawLineLeft:
call IteratNext call IteratNext
.beg_cycle: .beg_cycle:
@@: @@:
cmp edx,[tex_1] cmp edx,ted_tex_1
jle @f jle @f
cmp byte[edx],13 cmp byte[edx],13
je @f je @f
cmp ecx,0 cmp ebx,0
je @f je @f
;--------------------------------------
xor eax,eax ;eax áóäåò ìåíÿòüñÿ
mov al,byte[edx+1]
cmp al,0
je .no_color
cmp eax,ted_colors_text_count
jge .no_color
xor ecx,ecx
mov cl,byte[edx+1]
shl cx,2
add ecx,ted_text_colors
mov ecx,dword[ecx]
.no_color:
;--------------------------------------
mov eax,edx mov eax,edx
call IteratNext call IteratNext
dec ecx dec ebx
jmp @b jmp @b
@@: @@:
mov edx,eax mov edx,eax
pop eax pop eax
.ret_f: .ret_f:
pop ecx
call GetSymbColor call GetSymbColor
pop ebx
ret ret
endp
;input: ;input:
; edx = pointer to symbol ; edx = pointer to symbol
; edi = pointer to tedit struct
;output: ;output:
; edx = pointer to 13 symbol ; edx = pointer to 13 symbol
OptDrawLineRight: align 4
proc OptDrawLineRight
push eax push eax
mov eax,edx mov eax,edx
@@: @@:
cmp edx,[tex_1] cmp edx,ted_tex_1
jle @f jle @f
cmp byte[edx],13 cmp byte[edx],13
je @f je @f
@ -858,10 +896,13 @@ OptDrawLineRight:
jmp @b jmp @b
@@: @@:
mov edx,eax ;perv sumbol mov edx,eax ;perv sumbol
pop eax
call GetSymbColor call GetSymbColor
ret
pop eax
ret
endp
align 4
proc draw_main_cursor, edit:dword proc draw_main_cursor, edit:dword
pushad pushad
mov edi,dword[edit] mov edi,dword[edit]
@ -869,11 +910,11 @@ proc draw_main_cursor, edit:dword
mov eax,13 ;draw cursor mov eax,13 ;draw cursor
mov ecx,ted_wnd_t ;calc rect -> y0,y1 mov ecx,ted_wnd_t ;calc rect -> y0,y1
add ecx,ted_rec_t add ecx,ted_rec_t
mov edx,[cur_y] mov edx,ted_cur_y
imul edx,ted_rec_h imul edx,ted_rec_h
add ecx,edx add ecx,edx
cmp [curMod],1 ;ďđîâĺđęŕ đĺćčěŕ đŕáîňű ęóđńîđŕ (îáű÷íűé čëč âńňŕâęŕ) cmp ted_cur_ins,1 ;ïðîâåðêà ðåæèìà ðàáîòû êóðñîðà (îáû÷íûé èëè âñòàâêà)
jne @f jne @f
mov edx,ted_rec_h mov edx,ted_rec_h
inc edx ;1->1, 3->2, 5->3, ... inc edx ;1->1, 3->2, 5->3, ...
@ -882,38 +923,38 @@ proc draw_main_cursor, edit:dword
@@: @@:
shl ecx,16 shl ecx,16
add ecx,ted_rec_h add ecx,ted_rec_h
cmp [curMod],1 cmp ted_cur_ins,1
jne @f jne @f
shr cx,1 ;äåëèì âûñîòó êóðñîðà íà 2 shr cx,1 ;äåëèì âûñîòó êóðñîðà íà 2
@@: @@:
mov ebx,ted_wnd_l ;calc rect -> x0,x1 mov ebx,ted_wnd_l ;calc rect -> x0,x1
add ebx,ted_rec_l add ebx,ted_rec_l
mov edx,[cur_x] mov edx,ted_cur_x
imul edx,ted_rec_w imul edx,ted_rec_w
add ebx,edx add ebx,edx
shl ebx,16 shl ebx,16
add ebx,ted_rec_w add ebx,ted_rec_w
mov edx,[CURSOR_COLOR] mov edx,ted_color_cursor
int 0x40 ;âûâîä êóðñîðà int 0x40 ;âûâîä êóðñîðà
call GetPos call GetPos
cmp [gpOpt],2 cmp ted_gp_opt,2
jne @f jne @f
mov eax,4 ;draw text mov eax,4 ;draw text
mov esi,1 mov esi,1
ror ecx,16 ror ecx,16
mov bx,cx mov bx,cx
add ebx,0x10001 add ebx,0x10001
cmp [curMod],1 cmp ted_cur_ins,1
jne .no_up_tetx jne .no_up_tetx
mov ecx,ted_rec_h mov ecx,ted_rec_h
inc cx ; 1->1, 3->2, 5->3, ... inc cx ; 1->1, 3->2, 5->3, ...
shr cx,1 shr cx,1
sub bx,cx sub bx,cx
.no_up_tetx: .no_up_tetx:
mov ecx,[CUR_TEXT_COLOR] mov ecx,ted_color_cur_text
call ConvertInvisSymb call ConvertInvisSymb
int 0x40 int 0x40
@@: @@:
@ -924,7 +965,7 @@ proc draw_main_cursor, edit:dword
shl ebx,16 shl ebx,16
add ebx,ted_wnd_t add ebx,ted_wnd_t
add ebx,3 add ebx,3
mov ecx,[WND_BORD_COLOR] mov ecx,ted_color_wnd_bord
or ecx,0x80000000 or ecx,0x80000000
mov edx,txtRow mov edx,txtRow
int 0x40 ;âûâîä ïîäïèñè 'Ñòðîêà' int 0x40 ;âûâîä ïîäïèñè 'Ñòðîêà'
@ -933,7 +974,7 @@ proc draw_main_cursor, edit:dword
mov edx,txtCol mov edx,txtCol
int 0x40 ;âûâîä ïîäïèñè 'Çíàê' int 0x40 ;âûâîä ïîäïèñè 'Çíàê'
cmp [tim_Undo],0 cmp ted_tim_undo,0
je @f je @f
add ebx,0x500000 add ebx,0x500000
mov edx,txtOtm mov edx,txtOtm
@ -941,11 +982,11 @@ proc draw_main_cursor, edit:dword
sub ebx,0x500000 sub ebx,0x500000
@@: @@:
stdcall draw_bufer, edi stdcall draw_bufer,edi
stdcall draw_help_f1, edi stdcall draw_help_f1
mov eax,47 ;draw cursor coords mov eax,47 ;draw cursor coords
mov esi,[WND_BORD_COLOR] mov esi,ted_color_wnd_bord
or esi,0x40000000 or esi,0x40000000
mov edx,ebx mov edx,ebx
@ -954,23 +995,28 @@ proc draw_main_cursor, edit:dword
ror edx,16 ror edx,16
;add edx,3 ;add edx,3
mov ebx,0x40000 ;Row=... mov ebx,0x40000 ;Row=...
mov ecx,[cur_y] mov ecx,ted_cur_y
inc ecx inc ecx
add ecx,[wScr.position] add ecx,[wScr.position]
; edi <> tedit ----------------------------------------------------------------
mov edi,[WND_WORK_COLOR] push edi
int 0x40 mov edi,ted_color_wnd_work
int 0x40 ;âûâîä ÷èñëà òåêóùåé ñòðîêè
pop edi
;mov ebx,0x40000 ;Col=... ;mov ebx,0x40000 ;Col=...
mov ecx,[cur_x] mov ecx,ted_cur_x
inc ecx inc ecx
add ecx,[hScr.position] add ecx,[hScr.position]
add edx,0x500000 add edx,0x500000
int 0x40 push edi
mov edi,ted_color_wnd_work
int 0x40 ;âûâîä ÷èñëà çíàêîâ
pop edi
cmp [tim_Undo],0 cmp ted_tim_undo,0
je @f je @f
mov ecx,[tim_Undo] mov ecx,ted_tim_undo
add edx,0x500000 add edx,0x500000
int 0x40 int 0x40
@@: @@:
@ -979,6 +1025,7 @@ proc draw_main_cursor, edit:dword
ret ret
endp endp
align 4
proc draw_bufer, edit:dword proc draw_bufer, edit:dword
pushad pushad
mov edi,dword[edit] mov edi,dword[edit]
@ -991,9 +1038,9 @@ proc draw_bufer, edit:dword
shl ebx,16 shl ebx,16
add ebx,ted_wnd_t add ebx,ted_wnd_t
add ebx,3 add ebx,3
mov ecx,[WND_BORD_COLOR] mov ecx,ted_color_wnd_bord
or ecx,0x40000000 or ecx,0x40000000
mov edi,[WND_WORK_COLOR] mov edi,ted_color_wnd_work
mov edx,txtBuf mov edx,txtBuf
mov esi,buf mov esi,buf
@ -1020,9 +1067,11 @@ end if
ret ret
endp endp
proc draw_help_f1, edit:dword ;input:
; edi = pointer to tedit struct
align 4
proc draw_help_f1
pushad pushad
mov edi,dword[edit]
mov eax,13 ;clear place before draw help mov eax,13 ;clear place before draw help
mov ebx,ted_wnd_l mov ebx,ted_wnd_l
@ -1034,12 +1083,12 @@ proc draw_help_f1, edit:dword
add ecx,13 add ecx,13
shl ecx,16 shl ecx,16
add ecx,ted_rec_h add ecx,ted_rec_h
mov edx,[WND_CAPT_COLOR] mov edx,ted_color_wnd_capt
int 0x40 int 0x40
cmp [help_id],-1 cmp ted_help_id,-1
je @f je @f
mov eax,[help_id] mov eax,ted_help_id
ColToIndexOffset eax,edx ColToIndexOffset eax,edx
;SetCoordinates ;SetCoordinates
@ -1053,24 +1102,23 @@ proc draw_help_f1, edit:dword
xor eax,eax xor eax,eax
mov al,byte[edx+MAX_COLOR_WORD_LEN+6] mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
shl ax,2 shl ax,2
mov ecx,[tex_colors] mov ecx,ted_text_colors
add ecx,eax add ecx,eax
push dword[ecx] mov ecx,dword[ecx]
pop ecx
or ecx,0xc0000000 ;SetTextStyles or ecx,0xc0000000 ;SetTextStyles
mov edi,[WND_WORK_COLOR] mov esi,edi
; edi <> edit ----------------------------------------------------------------- mov edi,ted_color_wnd_work
mov eax,4 mov eax,4
int 0x40 int 0x40
mov edi,esi
;*** draw help string *** ;*** draw help string ***
mov ecx,[WND_BORD_COLOR] mov ecx,ted_color_wnd_bord
or ecx,0x80000000 or ecx,0x80000000
mov edi,dword[edx+MAX_COLOR_WORD_LEN] mov edx,dword[edx+MAX_COLOR_WORD_LEN]
cmp edi,0 cmp edx,0
je @f je @f
add edi,dword[tex_help_f1] add edx,ted_help_text_f1
mov edx,edi
add ebx,0x500000 add ebx,0x500000
int 0x40 int 0x40
@@: @@:
@ -1078,6 +1126,7 @@ proc draw_help_f1, edit:dword
ret ret
endp endp
align 4
proc draw_line_numbers, edit:dword proc draw_line_numbers, edit:dword
pushad pushad
mov edi,dword[edit] mov edi,dword[edit]
@ -1088,12 +1137,12 @@ proc draw_line_numbers, edit:dword
shl ebx,16 shl ebx,16
add ebx,ted_wnd_w add ebx,ted_wnd_w
; sub ebx,ted_rec_l ; sub ebx,ted_rec_l
mov edx,[WND_WORK_COLOR] mov edx,ted_color_wnd_work
mov ecx,ted_wnd_t mov ecx,ted_wnd_t
shl ecx,16 shl ecx,16
add ecx,ted_rec_t add ecx,ted_rec_t
mov eax,13 mov eax,13
mov edx,[WND_CAPT_COLOR] mov edx,ted_color_wnd_capt
int 0x40 int 0x40
;line numbers ;line numbers
@ -1117,12 +1166,12 @@ push ebx ecx edx
mov cx,dx mov cx,dx
rol ecx,16 rol ecx,16
mov eax,13 mov eax,13
mov edx,[WND_CAPT_COLOR] mov edx,ted_color_wnd_capt
int 0x40 ;ðèñóåì ïðÿìîóãîëüíèê ïîä íîìåðîì ñòðîêè int 0x40 ;ðèñóåì ïðÿìîóãîëüíèê ïîä íîìåðîì ñòðîêè
pop edx ecx ebx pop edx ecx ebx
mov eax,47 mov eax,47
mov esi,[WND_BORD_COLOR] mov esi,ted_color_wnd_bord
int 0x40 ;ðèñóåì íîìåð ñòðîêè int 0x40 ;ðèñóåì íîìåð ñòðîêè
inc ecx inc ecx
add edx,ted_rec_h add edx,ted_rec_h
@ -1140,6 +1189,7 @@ pop edx ecx ebx
endp endp
;this function need to optimize output ;this function need to optimize output
align 4
proc draw_cursor_sumb, edit:dword proc draw_cursor_sumb, edit:dword
push eax ecx edx edi push eax ecx edx edi
mov edi,dword[edit] mov edi,dword[edit]
@ -1147,7 +1197,7 @@ proc draw_cursor_sumb, edit:dword
mov eax,13 ;rect mov eax,13 ;rect
mov ebx,ted_wnd_l mov ebx,ted_wnd_l
add ebx,ted_rec_l add ebx,ted_rec_l
mov edx,[cur_x] mov edx,ted_cur_x
imul edx,ted_rec_w imul edx,ted_rec_w
add ebx,edx add ebx,edx
shl ebx,16 shl ebx,16
@ -1155,51 +1205,51 @@ proc draw_cursor_sumb, edit:dword
mov ecx,ted_wnd_t ;calc rect -> y0,y1 mov ecx,ted_wnd_t ;calc rect -> y0,y1
add ecx,ted_rec_t add ecx,ted_rec_t
mov edx,[cur_y] mov edx,ted_cur_y
imul edx,ted_rec_h imul edx,ted_rec_h
add ecx,edx add ecx,edx
shl ecx,16 shl ecx,16
add ecx,ted_rec_h add ecx,ted_rec_h
mov edx,[WND_WORK_COLOR] mov edx,ted_color_wnd_work
push ecx push ecx
call SelNormalize stdcall SelNormalize,edi
mov ecx,[wScr.position] mov ecx,[wScr.position]
sub [seln.y0],ecx sub ted_seln_y0,ecx
sub [seln.y1],ecx sub ted_seln_y1,ecx
mov ecx,[cur_y] mov ecx,ted_cur_y
cmp ecx,[seln.y0] cmp ecx,ted_seln_y0
jl .no_cur_sel jl .no_cur_sel
cmp ecx,[seln.y1] cmp ecx,ted_seln_y1
jg .no_cur_sel jg .no_cur_sel
mov edx,[SELECT_COLOR] mov edx,ted_color_select
cmp ecx,[seln.y0] cmp ecx,ted_seln_y0
jne @f jne @f
mov ecx,[cur_x] mov ecx,ted_cur_x
add ecx,[hScr.position] add ecx,[hScr.position]
cmp ecx,[seln.x0] cmp ecx,ted_seln_x0
jge @f jge @f
mov edx,[WND_WORK_COLOR] mov edx,ted_color_wnd_work
@@: @@:
mov ecx,[cur_y] mov ecx,ted_cur_y
cmp ecx,[seln.y1] cmp ecx,ted_seln_y1
jne .no_cur_sel jne .no_cur_sel
mov ecx,[cur_x] mov ecx,ted_cur_x
add ecx,[hScr.position] add ecx,[hScr.position]
cmp ecx,[seln.x1] cmp ecx,ted_seln_x1
jl .no_cur_sel jl .no_cur_sel
mov edx,[WND_WORK_COLOR] mov edx,ted_color_wnd_work
.no_cur_sel: .no_cur_sel:
pop ecx pop ecx
int 0x40 int 0x40
call GetPos call GetPos
cmp [gpOpt],2 cmp ted_gp_opt,2
jne @f jne @f
push esi push esi
mov eax,4 ;draw text mov eax,4 ;draw text
@ -1207,7 +1257,6 @@ proc draw_cursor_sumb, edit:dword
ror ecx,16 ror ecx,16
mov bx,cx mov bx,cx
add ebx,0x10001 add ebx,0x10001
;mov ecx,[WND_TEXT_COLOR]
call GetSymbColor call GetSymbColor
call ConvertInvisSymb call ConvertInvisSymb
int 0x40 int 0x40
@ -1220,49 +1269,51 @@ endp
;input: ;input:
; edx = pointer to text ; edx -> pointer to text
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
;output: ;output:
; ecx = color ; ecx = color
; if mode_colored=0 then ecx=WND_TEXT_COLOR ; if ted_mode_color=0 then ecx=ted_color_wnd_text
align 4
GetSymbColor: GetSymbColor:
mov ecx,[WND_TEXT_COLOR] mov ecx,ted_color_wnd_text ;çàäàåì öâåò òåêñòà ïî óìîë÷àíèþ
push eax edx push eax edx
cmp byte[mode_colored],0 cmp ted_mode_color,0
je .exit je .exit
jmp .on_first jmp .on_first
@@: @@:
call IteratPerv call IteratPerv
cmp edx,[tex_1] cmp edx,ted_tex_1
jle .exit jle .exit
.on_first: .on_first:
xor eax,eax xor eax,eax
mov al,byte[edx+1] mov al,byte[edx+1]
cmp al,0 cmp al,0 ;åñëè al=0 òî öâåò íå ìåíÿåòñÿ
je @b je @b
;cmp al,0xff cmp eax,ted_colors_text_count
;je .exit
cmp eax,[ColColor]
jge .exit jge .exit
shl ax,2 ;*4 shl ax,2 ;óìíîæàåì èíäåêñ öâåòà íà 4 áàéòà
mov ecx,[tex_colors] mov ecx,ted_text_colors ;ïðèáàâëÿåì ñìåùåíèå 1-ãî öâåòà
add ecx,eax add ecx,eax
push dword[ecx] mov ecx,dword[ecx] ;óñòàíàâëèâàåì òåêóùèé öâåò òåêñòà ïî ñìåùåíèþ
pop ecx
.exit: .exit:
pop edx eax pop edx eax
ret ret
;input: ;input:
; edx = pointer to text ; edx = pointer to text
; edi = pointer to tedit struct
align 4
ConvertInvisSymb: ConvertInvisSymb:
cmp [invis],1 cmp ted_mode_invis,1
jne @f jne @f
cmp byte [edx],13 cmp byte [edx],13
jne @f jne @f
mov edx,symbol_new_line mov edx,edi
add edx,ted_offs_symbol_new_line
@@: @@:
ret ret
@ -1270,6 +1321,7 @@ ConvertInvisSymb:
; ecx = 0x4000____ ; ecx = 0x4000____
; cx = icon index ; cx = icon index
; edx = x*2^16+y ; edx = x*2^16+y
align 4
draw_but_icon: draw_but_icon:
push eax ebx push eax ebx

View File

@ -33,12 +33,9 @@ include 't_button.inc'
@use_library @use_library
align 4
start: start:
mov eax,48 mcall 48,3,sc,sizeof.system_colors
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
mcall
m2m [wScr.bckg_col],[sc.work] m2m [wScr.bckg_col],[sc.work]
m2m [wScr.frnt_col],[sc.work_button] m2m [wScr.frnt_col],[sc.work_button]
@ -55,39 +52,37 @@ start:
mcall 66,1,1 ;scan code mcall 66,1,1 ;scan code
;mcall 26,2,1,conv_tabl ;mcall 26,2,1,conv_tabl
mov ecx,sizeof.symbol*maxChars
call mem_Alloc
mov [tex],eax
mov [tex_1],eax
add [tex_1],sizeof.symbol
mov [tex_end],eax
add [tex_end],sizeof.symbol*maxChars
mcall 40,0x27 mcall 40,0x27
call Clear
;-------------------------------------------------
mov ecx,maxColWords*sizeof.TexColViv+40
;add ecx,40
call mem_Alloc
mov [options_file],eax
mov [options_file_end],eax
add [options_file_end],maxColWords*sizeof.TexColViv
add [options_file_end],40
;-------------------------------------------------
; init bmp file
mov ecx,1200*18
call mem_Alloc
mov [bmp_icon],eax
mov esi,file_name mov esi,file_name
call strlen call strlen
mov ecx,eax mov ecx,eax
mov edi,buf_cmd_lin mov edi,buf_cmd_lin
rep movsb rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¡ãä¥à edit1
load_libraries l_libs_start,load_lib_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
mov ebp,lib0
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall -1 ;exit not correct
@@:
mov ebp,lib1 ;
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall -1 ;exit not correct
@@:
;---------------------------------------------------------------------
stdcall ted_init, tedit0
stdcall dword[tl_data_init], tree1
;---------------------------------------------------------------------
; init bmp file
mov ecx,1200*18
call mem_Alloc
mov [bmp_icon],eax
copy_path fn_icon,sys_path,file_name,0x0 copy_path fn_icon,sys_path,file_name,0x0
@ -108,24 +103,6 @@ start:
mov [err_ini0],0 mov [err_ini0],0
@@: @@:
load_libraries l_libs_start,load_lib_end
;ŻŕŽ˘ĽŕŞ  ­  ᪎ŤěŞŽ 㤠筎 § Łă§¨Ť áě ­ č  Ť¨Ą 
mov ebp,lib0
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall -1 ;exit not correct
@@:
mov ebp,lib1 ;
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall -1 ;exit not correct
@@:
;---------------------------------------------------------------------
push dword tree1
call dword[tl_data_init]
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
; ç¨â ¥¬ bmp ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨ ; ç¨â ¥¬ bmp ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
copy_path fn_icon_tl_sys,sys_path,file_name,0x0 copy_path fn_icon_tl_sys,sys_path,file_name,0x0
@ -187,26 +164,17 @@ mov ecx,ebx
@@: @@:
cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..' cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
je .filter je .filter
push dword tree1 ;0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
push dword 0x10000 ;1*2^16 - Ł¤Ľ 1 ­ŽŹĽŕ ¨ŞŽ­Ş¨ á Ş­¨ŁŽŠ stdcall dword[tl_node_add], eax,0x10000, tree1
push dword eax
call dword[tl_node_add]
push dword tree1 stdcall dword[tl_cur_next], tree1
call dword[tl_cur_next]
.filter: .filter:
add eax,304 add eax,304
loop @b loop @b
.end_dir_init: .end_dir_init:
; push dword tree1
; push dword 0
; push dword file_name
; call dword[tl_node_add]
;--- load color option file --- ;--- load color option file ---
call InitColText stdcall InitColText, tedit0
;--- get cmd line --- ;--- get cmd line ---
cmp byte[buf_cmd_lin+3],0 ;buf_cmd_lin cmp byte[buf_cmd_lin+3],0 ;buf_cmd_lin
@ -214,10 +182,10 @@ mov ecx,ebx
mov esi,buf_cmd_lin mov esi,buf_cmd_lin
call strlen ;eax=strlen call strlen ;eax=strlen
mov [edit1.size],eax mov [edit1.size],eax
call but_OpenFile call but_no_msg_OpenFile
@@: @@:
align 4
red_win: red_win:
mcall 12,1 mcall 12,1
@ -271,6 +239,7 @@ red_win:
mcall 12,2 mcall 12,2
align 4
still: still:
mov eax,10 mov eax,10
mcall mcall
@ -287,7 +256,7 @@ still:
jmp still jmp still
align 4
mouse: mouse:
stdcall [edit_box_mouse], dword edit1 stdcall [edit_box_mouse], dword edit1
@ -336,15 +305,13 @@ mouse:
stdcall mouse_wnd_main, tedit0 stdcall mouse_wnd_main, tedit0
cmp byte[panel_id],TE_PANEL_FIND ;if not panel cmp byte[tedit0.panel_id],TE_PANEL_FIND ;if not panel
jne @f jne @f
push dword edit2 stdcall [edit_box_mouse], dword edit2
call [edit_box_mouse]
@@: @@:
cmp byte[panel_id],TE_PANEL_SYNTAX ;if not panel cmp byte[tedit0.panel_id],TE_PANEL_SYNTAX ;if not panel
jne .menu_bar_1 ;@f jne .menu_bar_1 ;@f
push dword tree1 stdcall [tl_mouse], tree1
call [tl_mouse]
;----------------------------------------------- ;-----------------------------------------------
.menu_bar_1: .menu_bar_1:
mov [menu_data_1.get_mouse_flag],1 mov [menu_data_1.get_mouse_flag],1
@ -357,7 +324,7 @@ mouse:
je button.exit je button.exit
cmp [menu_data_1.cursor_out],dword 3 cmp [menu_data_1.cursor_out],dword 3
jne @f jne @f
call but_SaveFile stdcall but_SaveFile, tedit0
@@: @@:
cmp [menu_data_1.cursor_out],dword 2 cmp [menu_data_1.cursor_out],dword 2
jne @f jne @f
@ -373,21 +340,28 @@ mouse:
jmp still jmp still
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
KeyConvertToASCII: ;output:
mov ebx,conv_tabl ;convert scan to ascii ; ah = symbol
align 4
proc KeyConvertToASCII, table:dword
push ebx
mov ebx,dword[table] ;convert scan to ascii
ror ax,8 ror ax,8
xor ah,ah xor ah,ah
add bx,ax add bx,ax
mov ah,byte[ebx] mov ah,byte[ebx]
pop ebx
ret ret
endp
align 4
key: key:
mov ecx,1 mcall 66,3 ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
mcall 66,3
xor ebx,ebx xor ebx,ebx
mov ecx,1
test al,0x03 ;[Shift] test al,0x03 ;[Shift]
jz @f jz @f
inc cl mov cl,2
or ebx,KM_SHIFT or ebx,KM_SHIFT
@@: @@:
test al,0x0c ;[Ctrl] test al,0x0c ;[Ctrl]
@ -396,19 +370,16 @@ key:
@@: @@:
test al,0x30 ;[Alt] test al,0x30 ;[Alt]
jz @f jz @f
mov cl,3
or ebx,KM_ALT or ebx,KM_ALT
@@: @@:
test al,0x80 ;[NumLock] test al,0x80 ;[NumLock]
jz @f jz @f
or ebx,KM_NUMLOCK or ebx,KM_NUMLOCK
@@: @@:
mcall 26,2,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
mov [keyUpr],ebx mcall 2 ;¯®«ãç ¥¬ ª®¤ ­ ¦ â®© ª« ¢¨è¨
mcall 26,2,,conv_tabl ;stdcall [tl_key], tree1 ;???
mcall 2
; push dword tree1 ;???
; call [tl_key] ;???
test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬ test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f je @f
@ -424,13 +395,9 @@ key:
je still je still
cmp ah,69 ;[Pause Break] cmp ah,69 ;[Pause Break]
je still je still
; cmp [keyUpr],0
; jne still
call KeyConvertToASCII stdcall KeyConvertToASCII, dword conv_tabl
stdcall [edit_box_key], dword edit1
push dword edit1
call [edit_box_key]
jmp still jmp still
@@: @@:
@ -448,281 +415,13 @@ key:
je still je still
cmp ah,69 ;[Pause Break] cmp ah,69 ;[Pause Break]
je still je still
; cmp [keyUpr],0
; jne still
call KeyConvertToASCII stdcall KeyConvertToASCII, dword conv_tabl
stdcall [edit_box_key], dword edit2 stdcall [edit_box_key], dword edit2
jmp still jmp still
@@: @@:
cmp ah,KEY_F1 ;[F1] stdcall ted_key, tedit0, conv_tabl
jne @f
call ShowHelpF1
jmp still
@@:
cmp ah,KEY_F3 ;[F3]
jne @f
call but_FindText
jmp still
@@:
test [keyUpr],KM_CTRL ;Ctrl+...
jz .key_Ctrl
cmp ah,24 ;Ctrl+O
jne @f
call but_OpenFile
@@:
cmp ah,33 ;Ctrl+F
jne @f
cmp byte[panel_id],TE_PANEL_FIND
je @f
stdcall but_find, tedit0
@@:
cmp ah,44 ;Ctrl+Z
je but_undo
cmp ah,46 ;Ctrl+C
jne @f
call but_Copy
@@:
cmp ah,47 ;Ctrl+V
je but_paste
cmp ah,49 ;Ctrl+N
jne @f
call but_NewFile
@@:
cmp ah,199 ;Ctrl+Home
jne @f
call but_CtrlHome
@@:
;jmp still
.key_Ctrl:
test [keyUpr],KM_SHIFT ;Shift+...
jz .key_Shift
cmp ah,72 ;Shift+Up
jne @f
call sel_KeyUp
@@:
cmp ah,75 ;Shift+Left
jne @f
call sel_KeyLeft
@@:
cmp ah,77 ;Shift+Right
jne @f
call sel_KeyRight
@@:
cmp ah,80 ;Shift+Down
jne @f
call sel_KeyDown
@@:
;mov [dragk],1 ;­ ç¨­ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
jmp .key_MoveCur
.key_Shift:
;-------------------------------------------------
cmp ah,72 ;178 ;Up
jne @f
push dx
stdcall draw_cursor_sumb, tedit0
call CurMoveUp
cmp dl,8
jne .no_red_0
call OnInitialUpdate
stdcall draw_main_win, tedit0
pop dx
jmp @f
.no_red_0:
stdcall draw_main_cursor, tedit0
pop dx
mov [dragk],0 ;§ Ş ­ç¨˘ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
@@:
cmp ah,80 ;177 ;Down
jne @f
push dx
stdcall draw_cursor_sumb, tedit0
call CurMoveDown
cmp dl,8
jne .no_red_1
call OnInitialUpdate
stdcall draw_main_win, tedit0
pop dx
jmp @f
.no_red_1:
stdcall draw_main_cursor, tedit0
pop dx
mov [dragk],0 ;§ Ş ­ç¨˘ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
@@:
cmp ah,75 ;176 ;Left
jne @f
push dx
stdcall draw_cursor_sumb, tedit0
call CurMoveLeft
cmp dl,8
jne .no_red_2
call OnInitialUpdate
stdcall draw_main_win, tedit0
pop dx
jmp @f
.no_red_2:
stdcall draw_main_cursor, tedit0
pop dx
mov [dragk],0 ;§ Ş ­ç¨˘ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
@@:
cmp ah,77 ;179 ;Right
jne @f
push dx
stdcall draw_cursor_sumb, tedit0
call CurMoveRight
cmp dl,8
jne .no_red_3
call OnInitialUpdate
stdcall draw_main_win, tedit0
pop dx
jmp @f
.no_red_3:
stdcall draw_main_cursor, tedit0
pop dx
mov [dragk],0 ;§ Ş ­ç¨˘ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
@@:
cmp ah,71 ;180 ;Home
jne @f
push dx
stdcall draw_cursor_sumb, tedit0
call CurMoveX_FirstChar
cmp dl,8
jne .no_red_4
call OnInitialUpdate
stdcall draw_main_win, tedit0
pop dx
jmp @f
.no_red_4:
stdcall draw_main_cursor, tedit0
pop dx
mov [dragk],0 ;§ Ş ­ç¨˘ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
@@:
cmp ah,79 ;181 ;End
jne @f
push dx
stdcall draw_cursor_sumb, tedit0
call CurMoveX_LastChar
cmp dl,8
jne .no_red_5
call OnInitialUpdate
stdcall draw_main_win, tedit0
pop dx
jmp @f
.no_red_5:
stdcall draw_main_cursor, tedit0
pop dx
mov [dragk],0 ;§ Ş ­ç¨˘ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
@@:
cmp ah,73 ;184 ;PageUp
jne @f
push dx
call CurMovePageUp
cmp dl,0
pop dx
je @f
call OnInitialUpdate
stdcall draw_main_win, tedit0
@@:
cmp ah,81 ;183 ;PageDown
jne @f
push dx
call CurMovePageDown
cmp dl,0
pop dx
je @f
call OnInitialUpdate
stdcall draw_main_win, tedit0
mov [dragk],0 ;§ Ş ­ç¨˘ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
@@:
;-------------------------------------------------
cmp [keyUpr],0
jne still
.key_MoveCur:
cmp ah,69 ;[Pause Break]
je still
cmp ah,120 ;[Fn]
je still
cmp ah,0x80 ;if key up
ja still
call KeyConvertToASCII
;mov [dragk],0 ;§ Ş ­ç¨˘ ĽŹ ˘ë¤ĽŤĽ­¨Ľ Žâ ŞŤ ˘¨ âăŕë
push ebx
xor ebx,ebx
mov bl,ah
add ebx,EvChar ;add char to text
cmp byte [ebx],1
jne @f
push esi edi
call SetUndo
mov bx,0x0101
call SelTextDel
mov esi,1
mov byte [key_new],ah
mov edi,dword key_new
cmp [curMod],1
je .no_ins_mod
call TextDel
xor bl,1
.no_ins_mod:
call TextAdd
call draw_but_toolbar
cmp byte [key_new],13
jne .dr_m_win
stdcall draw_main_win, tedit0
jmp .dr_cur_l
.dr_m_win:
stdcall draw_cur_line, tedit0
.dr_cur_l:
pop edi esi
@@:
pop ebx
cmp ah,8 ;[<-]
jne @f
push ax bx
call SetUndo
mov bx,0x0001
call SelTextDel
cmp al,1
je .del_one_b
call TextDel
.del_one_b:
call draw_but_toolbar
stdcall draw_main_win, tedit0
pop bx ax
@@:
cmp ah,182 ;Delete
jne @f
push ax bx
call SetUndo
mov bx,0x0101
call SelTextDel
cmp al,1
je .del_one_d
call TextDel
.del_one_d:
call draw_but_toolbar
stdcall draw_main_win, tedit0
pop bx ax
@@:
cmp ah,185 ;Ins
jne @f
stdcall draw_cursor_sumb, tedit0
xor [curMod],1
stdcall draw_main_cursor, tedit0
@@:
jmp still jmp still
button: button:
@ -743,40 +442,64 @@ button:
@@: @@:
cmp ah,5 cmp ah,5
jne @f jne @f
call but_SaveFile stdcall but_SaveFile, tedit0
@@: @@:
cmp ah,6 cmp ah,6
jz but_select_word jne @f
stdcall ted_but_select_word, tedit0
@@:
cmp ah,7 cmp ah,7
jz but_cut jne @f
stdcall ted_but_cut, tedit0
@@:
cmp ah,8 cmp ah,8
jne @f jne @f
call but_Copy stdcall ted_but_copy, tedit0
@@: @@:
cmp ah,9 cmp ah,9
jz but_paste jne @f
stdcall ted_but_paste, tedit0
@@:
cmp ah,10 cmp ah,10
jne @f jne @f
stdcall but_find, tedit0 stdcall but_find, tedit0
@@: @@:
cmp ah,11 cmp ah,11
jz but_replace jne @f
call but_replace
@@:
cmp ah,12 cmp ah,12
jz but_find_key_w jne @f
call but_find_key_w
@@:
cmp ah,13 cmp ah,13
jz but_sumb_upper jne @f
stdcall but_sumb_upper, tedit0
@@:
cmp ah,14 cmp ah,14
jz but_sumb_lover jne @f
stdcall but_sumb_lover, tedit0
@@:
cmp ah,15 cmp ah,15
jz but_reverse jne @f
stdcall but_reverse, tedit0
@@:
cmp ah,16 cmp ah,16
jz but_undo jne @f
stdcall ted_but_undo, tedit0
@@:
cmp ah,17 cmp ah,17
jz but_redo jne @f
stdcall ted_but_redo, tedit0
@@:
cmp ah,18 cmp ah,18
jz but_sumb_invis jne @f
stdcall but_sumb_invis, tedit0
@@:
cmp ah,19 cmp ah,19
jz but_k_words_show jne @f
stdcall but_k_words_show, tedit0
@@:
cmp ah,20 cmp ah,20
jne @f jne @f
stdcall but_synt_show, tedit0 stdcall but_synt_show, tedit0
@ -784,33 +507,27 @@ button:
cmp ah,200 cmp ah,200
jne @f jne @f
call but_OpenSyntax stdcall ted_but_open_syntax, tedit0
@@: @@:
cmp ah,201 cmp ah,201
jne @f jne @f
call but_FindText stdcall but_FindText, tedit0
@@: @@:
cmp ah,1 cmp ah,1
jne still jne still
.exit: .exit:
;push eax stdcall ted_can_save, tedit0
call CanSave
cmp al,1 cmp al,1
jne @f jne @f
push thread stdcall [mb_create],msgbox_8,thread ;message: save changes in file?
push msgbox_8
call [mb_create] ;message: save changes in file?
jmp still jmp still
@@: @@:
mov ecx,[tex]
call mem_Free
mov ecx,[bmp_icon] mov ecx,[bmp_icon]
call mem_Free call mem_Free
mov ecx,[options_file]
call mem_Free stdcall ted_delete, tedit0
push dword tree1 stdcall dword[tl_data_clear], tree1
call dword[tl_data_clear]
mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë

File diff suppressed because it is too large Load Diff