2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
but_NewFile:
|
|
|
|
|
push eax ebx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall ted_can_save, tedit0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,1
|
|
|
|
|
jne @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
|
2009-12-29 00:19:20 +01:00
|
|
|
|
;mov eax,5
|
|
|
|
|
;mov ebx,50
|
|
|
|
|
;int 0x40
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall [mb_setfunctions],msgbox_2_funct
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
call On_NewFile
|
|
|
|
|
.ret_f:
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
On_NewFile:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall ted_clear, tedit0,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call draw_but_toolbar
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall draw_main_win, tedit0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
On_SaveAndNewFile:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
push edi
|
|
|
|
|
mov edi, tedit0
|
|
|
|
|
|
|
|
|
|
stdcall but_SaveFile,edi
|
|
|
|
|
cmp ted_err_save,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
|
|
|
|
call On_NewFile
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop edi
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
but_no_msg_OpenFile: ;<EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>१ <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<EFBFBD>饭<EFBFBD><EFBFBD>
|
|
|
|
|
stdcall ted_on_open_file, tedit0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
|
|
|
|
|
;<EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<EFBFBD>饭<EFBFBD><EFBFBD> (<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>⬥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⨥)
|
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
but_OpenFile:
|
|
|
|
|
push eax
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall ted_can_save, tedit0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,1
|
|
|
|
|
jne @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall [mb_create],msgbox_5,thread ;message: save changes in file?
|
|
|
|
|
stdcall [mb_setfunctions],msgbox_5_funct
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall ted_on_open_file, tedit0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.ret_f:
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
proc ted_on_open_file, edit:dword ;<EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD>
|
|
|
|
|
push eax ebx edi
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov eax,70
|
|
|
|
|
mov [run_file_70.func_n], 0
|
|
|
|
|
mov [run_file_70.param1], 0
|
|
|
|
|
mov [run_file_70.param2], 0
|
|
|
|
|
mov [run_file_70.param3], maxChars-2 ;sizeof.symbol
|
2010-04-22 21:39:39 +02:00
|
|
|
|
m2m [run_file_70.param4], ted_tex
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov [run_file_70.rezerv], 0
|
|
|
|
|
push dword[edit1.text]
|
|
|
|
|
pop dword[run_file_70.name]
|
|
|
|
|
mov ebx,run_file_70
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
cmp eax,0
|
|
|
|
|
je @f
|
|
|
|
|
cmp eax,6
|
|
|
|
|
je @f
|
|
|
|
|
cmp ax,10
|
|
|
|
|
jl .zifra_0_9
|
|
|
|
|
mov al,'?'
|
|
|
|
|
sub ax,48
|
|
|
|
|
.zifra_0_9:
|
|
|
|
|
add ax,48
|
|
|
|
|
|
|
|
|
|
mov byte[msgbox_4.err],al
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .ret_f
|
|
|
|
|
@@:
|
|
|
|
|
cmp ebx,-1
|
|
|
|
|
je .ret_f
|
|
|
|
|
;if open file
|
|
|
|
|
call OpenFile
|
|
|
|
|
cmp ebx,maxChars-2
|
|
|
|
|
jl .ret_f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall [mb_create],msgbox_1,thread
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.ret_f:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop edi ebx eax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
proc but_SaveFile, edit:dword
|
|
|
|
|
pushad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall ted_can_save,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,0
|
|
|
|
|
je .no_save
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
|
|
|
|
mov ecx,maxChars
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call mem_Alloc
|
|
|
|
|
push eax
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_tex
|
2009-12-29 00:19:20 +01:00
|
|
|
|
xor ecx,ecx
|
|
|
|
|
@@:
|
|
|
|
|
call IteratNext
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
|
|
|
|
jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov bl,[edx]
|
|
|
|
|
mov byte[eax],bl
|
|
|
|
|
inc eax
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
cmp ecx,0
|
|
|
|
|
je @f
|
|
|
|
|
pop eax
|
|
|
|
|
mov [run_file_70.param4],eax
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,70
|
|
|
|
|
mov [run_file_70.func_n], 2
|
|
|
|
|
mov [run_file_70.param1], 0
|
|
|
|
|
mov [run_file_70.param2], 0
|
|
|
|
|
mov [run_file_70.param3], ecx
|
|
|
|
|
mov [run_file_70.rezerv], 0
|
|
|
|
|
push [edit1.text]
|
|
|
|
|
pop [run_file_70.name]
|
|
|
|
|
mov ebx,run_file_70
|
|
|
|
|
int 0x40
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_err_save,ax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
cmp eax,0
|
|
|
|
|
je .no_msg
|
|
|
|
|
; cmp eax,6
|
|
|
|
|
; je @f
|
|
|
|
|
cmp ax,10
|
|
|
|
|
jl .zifra_0_9
|
|
|
|
|
mov al,'?'
|
|
|
|
|
sub ax,48
|
|
|
|
|
.zifra_0_9:
|
|
|
|
|
add ax,48
|
|
|
|
|
|
|
|
|
|
mov byte[msgbox_6.err],al
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp @f
|
|
|
|
|
.no_msg:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
m2m ted_tim_ls,ted_tim_ch
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
call mem_Free
|
|
|
|
|
.no_save:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
proc but_FindText, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
call GetPos
|
|
|
|
|
mov eax,[edit2.text]
|
|
|
|
|
mov bl,byte[eax]
|
|
|
|
|
@@:
|
|
|
|
|
call GetFindRezult
|
|
|
|
|
cmp bh,1
|
|
|
|
|
je @f ; find
|
|
|
|
|
|
|
|
|
|
call IteratNext
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle @f
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
cmp bh,0
|
|
|
|
|
je @f
|
|
|
|
|
call GetTexCoords
|
|
|
|
|
inc ebx ;move cursor right
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_sel_x1,ebx
|
|
|
|
|
mov ted_sel_y1,eax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov edx,eax
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
call GoToPos
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,esi ;esi <EFBFBD>뫮 <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> GetFindRezult
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call GetTexCoords
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_sel_x0,ebx
|
|
|
|
|
mov ted_sel_y0,eax
|
|
|
|
|
stdcall draw_main_win,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .end_find
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall [mb_create],msgbox_7,thread ;message: Can not find text
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.end_find:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; eax - text need find
|
|
|
|
|
; bl - first symbol to find
|
|
|
|
|
; edx - first symbol pointer
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; edi - pointer to tedit struct
|
2009-12-29 00:19:20 +01:00
|
|
|
|
;output:
|
|
|
|
|
; bh - rezult
|
|
|
|
|
; edx - last text position (if find sucess)
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; esi - first symbol pointer
|
|
|
|
|
;description:
|
|
|
|
|
; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> ⥪<EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> eax
|
|
|
|
|
; <EFBFBD> ⥪<EFBFBD>⮬ ।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> edx.
|
|
|
|
|
; <EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㭪樨 (<EFBFBD><EFBFBD><EFBFBD><EFBFBD>. strcmp) <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>⮬<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<EFBFBD><EFBFBD> ᮤ<EFBFBD>ন<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ascii <EFBFBD><EFBFBD>ப.
|
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
GetFindRezult:
|
|
|
|
|
push eax
|
|
|
|
|
mov bh,1
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov esi,edx ;copy edx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
cmp byte[edx],bl
|
|
|
|
|
jne .no_text
|
|
|
|
|
|
|
|
|
|
inc eax ;*** get next symbol (in find text) ***
|
|
|
|
|
mov bl,byte[eax]
|
|
|
|
|
cmp bl,0
|
|
|
|
|
je @f ;end of find text
|
|
|
|
|
|
|
|
|
|
call IteratNext ;*** get next symbol (in editor text) ***
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle @f ;end of editor text
|
|
|
|
|
|
|
|
|
|
jmp @b
|
|
|
|
|
.no_text:
|
|
|
|
|
xor bh,bh
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,esi ;restore edx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
pop eax
|
|
|
|
|
mov bl,byte[eax] ;restore bl
|
|
|
|
|
ret
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
proc ted_but_open_syntax, edit:dword
|
|
|
|
|
push edi
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
|
|
|
|
cmp ted_panel_id,TE_PANEL_SYNTAX
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall dword[tl_node_get_data], tree1
|
2010-04-15 17:50:49 +02:00
|
|
|
|
pop dword[fn_col_option]
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall InitColText,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call CmColored
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
proc ted_but_select_word, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
call GetPos
|
|
|
|
|
push edx
|
|
|
|
|
call ItPervColorTag
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle @f
|
|
|
|
|
call GetTexCoords
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_sel_x0,ebx
|
|
|
|
|
mov ted_sel_y0,eax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
pop edx
|
|
|
|
|
call ItNextColorTag
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle @f
|
|
|
|
|
call GetTexCoords
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_sel_x1,ebx
|
|
|
|
|
mov ted_sel_y1,eax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call draw_but_toolbar
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,1
|
|
|
|
|
jne @f
|
|
|
|
|
call draw_but_toolbar
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop edi
|
|
|
|
|
ret
|
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
;output:
|
|
|
|
|
; al = 1 if copy text
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
proc ted_but_copy, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
|
|
|
|
stdcall IsSel,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,0
|
2010-04-22 21:39:39 +02:00
|
|
|
|
je .end_f ;if not selected text
|
|
|
|
|
stdcall SelNormalize,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov esi,ted_seln_x1
|
|
|
|
|
mov ecx,ted_seln_y1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call GetPosByParam
|
|
|
|
|
mov ebx,edx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov esi,ted_seln_x0
|
|
|
|
|
mov ecx,ted_seln_y0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call GetPosByParam
|
|
|
|
|
mov esi,ebx
|
|
|
|
|
|
|
|
|
|
xor ecx,ecx
|
|
|
|
|
mov ebx,buf
|
2010-04-22 21:39:39 +02:00
|
|
|
|
;mov edx,ted_tex
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1 ;end of file
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle @f
|
|
|
|
|
cmp edx,esi ;end of select
|
|
|
|
|
je @f
|
|
|
|
|
inc ecx
|
|
|
|
|
cmp ecx,BUF_SIZE ;owerflow bufer
|
|
|
|
|
je @f
|
|
|
|
|
|
|
|
|
|
mov al,byte[edx]
|
|
|
|
|
mov byte[ebx],al
|
|
|
|
|
inc ebx
|
|
|
|
|
|
|
|
|
|
call IteratNext
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
add ecx,buf
|
|
|
|
|
mov byte[ebx],0
|
|
|
|
|
|
|
|
|
|
cmp ecx,0
|
2010-04-22 21:39:39 +02:00
|
|
|
|
je .end_f
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call draw_but_toolbar
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_bufer,edi
|
|
|
|
|
.end_f:
|
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
proc ted_but_paste, edit:dword
|
|
|
|
|
push eax ebx esi edi
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov esi,buf
|
|
|
|
|
call strlen
|
|
|
|
|
cmp eax,1
|
|
|
|
|
jl @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall ted_set_undo,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov esi,eax
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ebx,ted_opt_ed_change_time+ted_opt_ed_move_cursor
|
|
|
|
|
stdcall SelTextDel,ebx
|
|
|
|
|
cmp al,1
|
|
|
|
|
jne .del
|
|
|
|
|
mov ebx,ted_opt_ed_move_cursor
|
|
|
|
|
.del:
|
|
|
|
|
stdcall ted_text_add,edi,buf,esi,ebx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call draw_but_toolbar
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop edi esi ebx eax
|
|
|
|
|
ret
|
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc but_find, edit:dword ;<EFBFBD>맮<EFBFBD>/<EFBFBD><EFBFBD><EFBFBD><EFBFBD>⨥ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>᪠
|
|
|
|
|
push edi
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edi,dword[edit]
|
2010-04-15 17:50:49 +02:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_panel_id,TE_PANEL_NULL
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_panel_id,TE_PANEL_NULL
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ted_wnd_l,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .e_if
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_panel_id,TE_PANEL_FIND
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ted_wnd_l,TE_PANEL_WIDTH
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.e_if:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall EvSize,edi
|
|
|
|
|
stdcall draw_main_win,edi
|
|
|
|
|
pop edi
|
|
|
|
|
ret
|
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
but_replace:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
ret
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
but_find_key_w:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
proc but_sumb_upper, edit:dword
|
|
|
|
|
push edi esi
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov [conv_table],EvUpper
|
|
|
|
|
call ConvertSelText
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp esi,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop esi edi
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
proc but_sumb_lover, edit:dword
|
|
|
|
|
push edi esi
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov [conv_table],EvLover
|
|
|
|
|
call ConvertSelText
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp esi,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop esi edi
|
|
|
|
|
ret
|
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
proc but_reverse, edit:dword
|
|
|
|
|
push eax ebx edi
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
|
|
|
|
stdcall IsSel,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,0
|
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelNormalize,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
push esi ecx edx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov esi,ted_seln_x0
|
|
|
|
|
mov ecx,ted_seln_y0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call GetPosByParam
|
|
|
|
|
mov eax,edx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov esi,ted_seln_x1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp esi,0
|
|
|
|
|
je .beg_str
|
|
|
|
|
dec esi
|
|
|
|
|
.beg_str:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_seln_y1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call GetPosByParam
|
|
|
|
|
;call GetTexPervPos
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
pop edx ecx esi
|
|
|
|
|
;cmp eax,...
|
|
|
|
|
;je @f
|
|
|
|
|
call Revers
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
|
|
|
|
pop edi ebx eax
|
|
|
|
|
ret
|
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
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
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
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
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call draw_but_toolbar
|
2010-04-22 21:39:39 +02:00
|
|
|
|
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
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
;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
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc but_synt_show, edit:dword
|
|
|
|
|
push edi
|
|
|
|
|
mov edi,[edit]
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_panel_id,TE_PANEL_NULL
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_panel_id,TE_PANEL_NULL
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ted_wnd_l,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .e_if
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_panel_id,TE_PANEL_SYNTAX
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ted_wnd_l,TE_PANEL_WIDTH
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.e_if:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall EvSize,edi
|
|
|
|
|
stdcall draw_main_win,edi
|
|
|
|
|
pop edi
|
|
|
|
|
ret
|
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
proc ted_sel_key_up, edit:dword
|
|
|
|
|
push edi
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
|
|
|
|
cmp ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelStart,edi
|
|
|
|
|
mov ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
call CurMoveUp
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne @f
|
|
|
|
|
call OnInitialUpdate
|
|
|
|
|
@@:
|
|
|
|
|
pop dx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelMove,edi
|
|
|
|
|
stdcall draw_main_win,edi
|
|
|
|
|
pop edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
proc ted_sel_key_down, edit:dword
|
|
|
|
|
push edi
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
|
|
|
|
cmp ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelStart,edi
|
|
|
|
|
mov ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
call CurMoveDown
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne @f
|
|
|
|
|
call OnInitialUpdate
|
|
|
|
|
@@:
|
|
|
|
|
pop dx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelMove,edi
|
|
|
|
|
stdcall draw_main_win,edi
|
|
|
|
|
pop edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
proc ted_sel_key_left, edit:dword
|
|
|
|
|
push edi
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelStart,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
call CurMoveLeft
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelMove,edi
|
|
|
|
|
cmp ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov dl,8
|
|
|
|
|
@@:
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne @f
|
|
|
|
|
call OnInitialUpdate
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .end_f
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_cur_line,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.end_f:
|
|
|
|
|
pop dx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-22 21:39:39 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
proc ted_sel_key_right, edit:dword
|
|
|
|
|
push edi
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelStart,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
push dx
|
|
|
|
|
call CurMoveRight
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelMove,edi
|
|
|
|
|
cmp ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_drag_k,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov dl,8
|
|
|
|
|
@@:
|
|
|
|
|
cmp dl,8
|
|
|
|
|
jne @f
|
|
|
|
|
call OnInitialUpdate
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_win,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .end_f
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_cur_line,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.end_f:
|
|
|
|
|
pop dx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop edi
|
|
|
|
|
ret
|
|
|
|
|
endp
|