2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc mouse_wnd_main, edit:dword
|
|
|
|
|
push eax ebx ecx edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mcall 37,2 ;get mouse buttons
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,1
|
|
|
|
|
jne @f
|
|
|
|
|
mcall 37,1 ;get mouse coords
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_t
|
|
|
|
|
add ebx,ted_rec_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp ax,bx
|
|
|
|
|
jl @f ;y_mouse<y_wnd
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
sub ebx,ted_rec_t
|
|
|
|
|
add ebx,ted_wnd_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp bx,ax
|
|
|
|
|
jl @f ;y_mouse>y_wnd
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov ecx,eax
|
|
|
|
|
shr ecx,16
|
|
|
|
|
cmp cx,bx
|
|
|
|
|
jl @f ;x_mouse<x_wnd
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
sub ebx,ted_rec_l
|
|
|
|
|
add ebx,ted_wnd_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp bx,cx
|
|
|
|
|
jl @f ;x_mouse>x_wnd
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall draw_cursor_sumb, tedit0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call wnd_main_click
|
|
|
|
|
jmp .no_in_wnd
|
|
|
|
|
@@:
|
|
|
|
|
call wnd_main_mouse_scroll
|
2010-04-15 17:50:49 +02:00
|
|
|
|
cmp ted_drag_m,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je .no_in_wnd
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ted_drag_m,0
|
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
|
|
|
|
.no_in_wnd:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
pop edi ecx ebx eax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
;input:
|
|
|
|
|
; eax -> (x,y)
|
|
|
|
|
; edi -> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> tedit
|
|
|
|
|
;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><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>
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
wnd_main_click:
|
|
|
|
|
push ecx edx
|
|
|
|
|
|
|
|
|
|
push eax
|
|
|
|
|
shr eax,16
|
|
|
|
|
and eax,0xffff
|
2010-04-15 17:50:49 +02:00
|
|
|
|
sub eax,ted_wnd_l
|
|
|
|
|
sub eax,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
xor edx,edx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_rec_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
div cx
|
|
|
|
|
;inc eax
|
|
|
|
|
cmp eax,[hScr.cur_area]
|
|
|
|
|
jle @f
|
|
|
|
|
mov eax,[hScr.cur_area]
|
|
|
|
|
@@:
|
|
|
|
|
;dec eax
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_cur_x,eax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
|
|
push eax
|
|
|
|
|
and eax,0xffff
|
2010-04-15 17:50:49 +02:00
|
|
|
|
sub eax,ted_wnd_t
|
|
|
|
|
sub eax,ted_rec_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
xor edx,edx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_rec_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
div cx
|
|
|
|
|
inc eax
|
|
|
|
|
cmp eax,[wScr.cur_area]
|
|
|
|
|
jle @f
|
|
|
|
|
mov eax,[wScr.cur_area]
|
|
|
|
|
@@:
|
|
|
|
|
dec eax
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ted_cur_y,eax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
pop eax
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
cmp ted_drag_m,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelMove,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp .sel_move
|
|
|
|
|
@@:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ted_drag_m,1
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelStart,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.sel_move:
|
|
|
|
|
pop edx ecx
|
|
|
|
|
ret
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
wnd_main_mouse_scroll:
|
|
|
|
|
push eax ebx
|
|
|
|
|
mcall 37,7
|
|
|
|
|
cmp ax,0
|
|
|
|
|
je .no_scroll
|
|
|
|
|
mov ebx,dword[wScr.position] ;copy old scroll position
|
|
|
|
|
and eax,0xffff
|
|
|
|
|
btr ax,15
|
|
|
|
|
jae @f
|
|
|
|
|
or eax,0xffff8000
|
|
|
|
|
@@:
|
|
|
|
|
add dword[wScr.position],eax
|
|
|
|
|
|
|
|
|
|
mov eax,[wScr.position]
|
|
|
|
|
cmp eax,[wScr.max_area]
|
|
|
|
|
jb @f
|
|
|
|
|
mov dword[wScr.position],ebx ;if scroll position out of range
|
|
|
|
|
jmp .no_scroll
|
|
|
|
|
@@:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall draw_main_win, tedit0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.no_scroll:
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
draw_but_toolbar: ;<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>
|
|
|
|
|
push ebx ecx edx edi
|
|
|
|
|
mov edi,tedit0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov ecx,0x40000000
|
|
|
|
|
; mov edx,5*65536+25
|
|
|
|
|
mov edx,85*65536+2
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
inc cx
|
|
|
|
|
; mov edx,30*65536+25
|
|
|
|
|
mov edx,110*65536+2
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall ted_can_save,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,1
|
|
|
|
|
je @f
|
|
|
|
|
and ecx,0xffff
|
|
|
|
|
@@:
|
|
|
|
|
inc cx
|
|
|
|
|
; mov edx,55*65536+25
|
|
|
|
|
mov edx,135*65536+2
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
or ecx,0x40000000
|
|
|
|
|
|
|
|
|
|
inc cx
|
|
|
|
|
mov edx,85*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall IsSel,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,0
|
|
|
|
|
jne @f
|
|
|
|
|
and ecx,0xffff
|
|
|
|
|
@@:
|
|
|
|
|
inc cx ; Cut
|
|
|
|
|
mov edx,110*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
inc cx ; Copy
|
|
|
|
|
mov edx,135*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
mov cx,10 ; Upper
|
|
|
|
|
mov edx,265*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
inc cx ; Lower
|
|
|
|
|
mov edx,290*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
inc cx ; Reverse
|
|
|
|
|
mov edx,315*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
or ecx,0x40000000
|
|
|
|
|
|
|
|
|
|
cmp byte[buf],0
|
|
|
|
|
jne @f
|
|
|
|
|
and ecx,0xffff
|
|
|
|
|
@@:
|
|
|
|
|
mov cx,6 ; Paste
|
|
|
|
|
mov edx,160*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
or ecx,0x40000000
|
|
|
|
|
|
|
|
|
|
inc cx
|
|
|
|
|
mov edx,185*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
inc cx
|
|
|
|
|
mov edx,210*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
inc cx
|
|
|
|
|
mov edx,235*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ebx,ted_tim_undo
|
|
|
|
|
cmp ted_tim_ch,ebx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jg @f
|
|
|
|
|
and ecx,0xffff
|
|
|
|
|
@@:
|
|
|
|
|
mov cx,13
|
|
|
|
|
mov edx,345*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
or ecx,0x40000000
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_tim_undo,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jge @f
|
|
|
|
|
and ecx,0xffff
|
|
|
|
|
@@:
|
|
|
|
|
inc cx
|
|
|
|
|
mov edx,370*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
or ecx,0x40000000
|
|
|
|
|
|
|
|
|
|
inc cx
|
|
|
|
|
mov edx,400*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
inc cx
|
|
|
|
|
mov edx,425*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
|
|
|
|
mov cx,17
|
|
|
|
|
mov edx,450*65536+25
|
|
|
|
|
call draw_but_icon
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop edi edx ecx ebx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
; clear_o - <EFBFBD><EFBFBD><EFBFBD><EFBFBD> =1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, =0 <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>
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
mov ebx,dword[coords] ;ebx = x*2^16+y coords to left up point clear line
|
|
|
|
|
mov esi,dword[numb_lin] ;esi - number text line
|
|
|
|
|
|
2009-12-29 00:19:20 +01:00
|
|
|
|
sub ebx,0x10001 ;<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>
|
2010-04-15 17:50:49 +02:00
|
|
|
|
cmp dword[clear_o],0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_rec_h
|
|
|
|
|
inc esi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ror ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
xor bx,bx
|
|
|
|
|
add ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ror ebx,16
|
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov eax,ted_wnd_h
|
|
|
|
|
add eax,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp ax,bx
|
|
|
|
|
jl .no_clear
|
|
|
|
|
sub ax,bx
|
|
|
|
|
|
|
|
|
|
mov cx,bx
|
|
|
|
|
shl ecx,16
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
xor bx,bx
|
|
|
|
|
add ebx,ted_wnd_w
|
|
|
|
|
sub ebx,ted_rec_l
|
|
|
|
|
xor cx,cx
|
|
|
|
|
add ecx,ted_rec_h
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_work
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
cmp dword[clear_o],0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je .pusto
|
|
|
|
|
cmp ax,cx
|
|
|
|
|
jge @f
|
|
|
|
|
.pusto:
|
|
|
|
|
mov cx,ax
|
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall IsSel,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,0
|
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_seln_y0,esi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jg @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_seln_y1,esi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jl @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_select ;draw selected line
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
mov eax,13 ;rect
|
|
|
|
|
int 0x40
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall IsSel,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp al,0
|
|
|
|
|
je .no_clear
|
|
|
|
|
|
|
|
|
|
mov al,13 ;rect
|
2010-04-15 17:50:49 +02:00
|
|
|
|
xor cx,cx
|
|
|
|
|
add ecx,ted_rec_h
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_seln_y0,esi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
|
|
|
|
push bx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_seln_x0 ; <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>)
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp edx,[hScr.position]
|
|
|
|
|
jle .in_wnd
|
|
|
|
|
sub edx,[hScr.position]
|
2010-04-15 17:50:49 +02:00
|
|
|
|
imul edx,ted_rec_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov bx,dx
|
|
|
|
|
jmp .no_wnd
|
|
|
|
|
.in_wnd:
|
|
|
|
|
mov bx,0
|
|
|
|
|
.no_wnd:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_work
|
2009-12-29 00:19:20 +01:00
|
|
|
|
int 0x40
|
|
|
|
|
pop bx
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_seln_y1,esi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_seln_x1 ; <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>)
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp edx,[hScr.position]
|
|
|
|
|
jle .in_wnd2
|
|
|
|
|
sub edx,[hScr.position]
|
2010-04-15 17:50:49 +02:00
|
|
|
|
imul edx,ted_rec_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
sub bx,dx
|
|
|
|
|
shl edx,16
|
|
|
|
|
add ebx,edx
|
|
|
|
|
.in_wnd2:
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_work
|
2009-12-29 00:19:20 +01:00
|
|
|
|
int 0x40
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
.no_clear:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc draw_main_win, edit:dword
|
|
|
|
|
locals
|
|
|
|
|
line_num dd ?
|
|
|
|
|
endl
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov eax,4 ;draw text
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_text_colors
|
|
|
|
|
mov ecx,dword[ecx]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_t
|
|
|
|
|
add ebx,ted_rec_t
|
|
|
|
|
add ebx,0x10001 ;<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>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelNormalize,edi ;need before draw select
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov esi,[wScr.position]
|
|
|
|
|
mov dword[line_num],esi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall clear_line_before_draw, edi,ebx,1,esi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call GetFirstVisiblePos
|
|
|
|
|
cmp edx,0
|
|
|
|
|
je .no_draw_text
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov esi,1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 1-<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
call IteratNext
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle .no_draw_text
|
|
|
|
|
|
|
|
|
|
; *** <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_mode_color,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je .no_col_change
|
|
|
|
|
cmp byte[edx+1],0
|
|
|
|
|
je .no_col_change
|
|
|
|
|
call GetSymbColor
|
|
|
|
|
.no_col_change:
|
|
|
|
|
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne .no_13
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_mode_invis,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne .no_invis
|
|
|
|
|
push edx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,edi
|
|
|
|
|
add edx,ted_offs_symbol_new_line
|
2009-12-29 00:19:20 +01:00
|
|
|
|
int 0x40
|
|
|
|
|
pop edx
|
|
|
|
|
.no_invis:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_rec_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
;optimized output \/
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov eax,ted_wnd_h
|
|
|
|
|
add eax,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp bx,ax
|
|
|
|
|
jg .no_draw_text
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov eax,4
|
2010-04-22 21:39:39 +02:00
|
|
|
|
;optimized output /\
|
2010-04-15 17:50:49 +02:00
|
|
|
|
and ebx,0xffff
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ror ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
inc ebx
|
|
|
|
|
ror ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
inc dword[line_num] ;increment line number
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall clear_line_before_draw,edi,ebx,1,dword[line_num]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call OptDrawLineLeft
|
|
|
|
|
jmp @b
|
|
|
|
|
.no_13:
|
|
|
|
|
|
|
|
|
|
int 0x40
|
|
|
|
|
ror ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_rec_w
|
|
|
|
|
mov esi,ted_wnd_l
|
|
|
|
|
add esi,ted_wnd_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp bx,si
|
|
|
|
|
jl .no_opt
|
|
|
|
|
call OptDrawLineRight
|
|
|
|
|
.no_opt:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov si,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ror ebx,16
|
|
|
|
|
jmp @b
|
|
|
|
|
.no_draw_text:
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall clear_line_before_draw,edi,ebx,0,dword[line_num]
|
|
|
|
|
stdcall draw_line_numbers,edi
|
|
|
|
|
stdcall draw_main_cursor,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
;---------------------------------------------
|
|
|
|
|
; set all_redraw flag for draw all ScrollBar
|
|
|
|
|
; In some cases it is necessity to draw only the area
|
|
|
|
|
; of moving of a "runner", for acceleration of output -
|
|
|
|
|
; in this case the flag needs to be reset to 0 (zero).
|
|
|
|
|
xor eax,eax
|
|
|
|
|
inc eax
|
|
|
|
|
mov [wScr.all_redraw],eax
|
|
|
|
|
mov [hScr.all_redraw],eax
|
|
|
|
|
|
|
|
|
|
; draw for Vertical ScrollBar
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall [scrollbar_ver_draw], dword wScr
|
|
|
|
|
stdcall [scrollbar_hor_draw], dword hScr
|
2009-12-29 00:19:20 +01:00
|
|
|
|
; reset all_redraw flag
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [wScr.all_redraw],eax
|
|
|
|
|
mov [hScr.all_redraw],eax
|
|
|
|
|
;---------------------------------------------
|
|
|
|
|
|
|
|
|
|
mov eax,13
|
|
|
|
|
;left-bottom square
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
mov ecx,ted_wnd_t
|
|
|
|
|
add ecx,ted_wnd_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ecx,16
|
|
|
|
|
mov cx,word[hScr.size_y]
|
|
|
|
|
inc cx
|
|
|
|
|
mov edx,[sc.work]
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
;right-bottom square
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_wnd_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ebx,16
|
|
|
|
|
mov bx,word[wScr.size_x]
|
|
|
|
|
inc bx
|
|
|
|
|
int 0x40
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
stdcall draw_panel_find, edi
|
|
|
|
|
stdcall draw_panel_syntax, edi
|
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
;txtBUp db 24
|
|
|
|
|
;txtBDn db 25
|
|
|
|
|
;txtBRi db 26
|
|
|
|
|
;txtBLe db 27
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc draw_panel_find, edit:dword
|
|
|
|
|
push edi
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_panel_id,TE_PANEL_FIND ;if not panel
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
|
|
|
|
push eax ebx ecx edx
|
|
|
|
|
|
|
|
|
|
mov eax,13 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,TE_PANEL_WIDTH
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ecx,16
|
|
|
|
|
mov cx,20
|
|
|
|
|
mov edx,[sc.work]
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
mov eax,4 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,30*65536+5
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov ecx,[sc.work_text]
|
|
|
|
|
or ecx,0x80000000
|
|
|
|
|
mov edx,txtFindCapt
|
|
|
|
|
int 0x40
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall [edit_box_draw], dword edit2
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov eax,13 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,TE_PANEL_WIDTH
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add cx,20+15 ; 15 - height text box
|
|
|
|
|
shl ecx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ecx,ted_wnd_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add cx,word[hScr.size_y]
|
|
|
|
|
sub cx,20+15-1 ; 15 - height text box
|
|
|
|
|
mov edx,[sc.work]
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
mov eax,8 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,5*65536+85
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add cx,20+15+5
|
|
|
|
|
shl ecx,16
|
|
|
|
|
mov cx,20
|
|
|
|
|
mov edx,201 ;button id
|
|
|
|
|
mov esi,[sc.work_button]
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
mov eax,4 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,15*65536+(20+15+10)
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov ecx,[sc.work_text]
|
|
|
|
|
or ecx,0x80000000
|
|
|
|
|
mov edx,txtFindNext
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
pop edx ecx ebx eax
|
2010-04-15 17:50:49 +02:00
|
|
|
|
jmp .end_f
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
push eax edx
|
|
|
|
|
mov eax,8
|
|
|
|
|
mov edx,201
|
|
|
|
|
or edx,0x80000000
|
|
|
|
|
int 0x40
|
|
|
|
|
pop edx eax
|
2010-04-15 17:50:49 +02:00
|
|
|
|
.end_f:
|
|
|
|
|
pop edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
|
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc draw_panel_syntax, 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_panel_id,TE_PANEL_SYNTAX ;if not panel
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
|
|
|
|
push eax ebx ecx edx
|
|
|
|
|
|
|
|
|
|
mov eax,13 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,TE_PANEL_WIDTH
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ecx,16
|
|
|
|
|
mov cx,20
|
|
|
|
|
mov edx,[sc.work]
|
2010-04-15 17:50:49 +02:00
|
|
|
|
int 0x40 ;<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>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall dword[tl_draw], tree1
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov [ws_dir_lbox.all_redraw],1 ;<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>
|
|
|
|
|
stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
ror ecx,16
|
|
|
|
|
add ecx,dword[tree1.box_height]
|
|
|
|
|
add ecx,20
|
2010-04-15 17:50:49 +02:00
|
|
|
|
and ecx,0xffff
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ror ecx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ecx,ted_wnd_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add cx,word[hScr.size_y]
|
|
|
|
|
sub cx,20
|
|
|
|
|
sub ecx,dword[tree1.box_height]
|
|
|
|
|
inc cx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
int 0x40 ;<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>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov eax,8 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,5*65536+65
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_wnd_t
|
|
|
|
|
add ecx,25
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,dword[tree1.box_height]
|
|
|
|
|
shl ecx,16
|
|
|
|
|
mov cx,20
|
|
|
|
|
mov edx,200 ;button id
|
|
|
|
|
mov esi,[sc.work_button]
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
mov eax,4 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx,30*65536+5
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov ecx,[sc.work_text]
|
|
|
|
|
or ecx,0x80000000
|
|
|
|
|
mov edx,txtFormatCapt
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
mov ebx,10*65536+30
|
|
|
|
|
add ebx,dword[tree1.box_height]
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov edx,txtFormatApply
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
pop edx ecx ebx eax
|
2010-04-15 17:50:49 +02:00
|
|
|
|
jmp .end_f
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
push eax edx
|
|
|
|
|
mov eax,8
|
|
|
|
|
mov edx,200
|
|
|
|
|
or edx,0x80000000
|
|
|
|
|
int 0x40 ;<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>
|
|
|
|
|
pop edx eax
|
|
|
|
|
.end_f:
|
|
|
|
|
pop edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
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 draw_cur_line, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ebx,16
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov eax,ted_cur_y
|
2010-04-15 17:50:49 +02:00
|
|
|
|
imul eax,ted_rec_h
|
|
|
|
|
mov bx,ax
|
|
|
|
|
add ebx,ted_wnd_t
|
|
|
|
|
add ebx,ted_rec_t ;ebx - <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>
|
|
|
|
|
add ebx,0x10001 ;<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>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelNormalize,edi ;need before draw select
|
|
|
|
|
mov ecx,ted_cur_y
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ecx,[wScr.position]
|
|
|
|
|
stdcall clear_line_before_draw, tedit0, ebx,1,ecx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov esi,[hScr.position]
|
|
|
|
|
call GetPosByParam
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_gp_opt,2
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne .no_draw_text
|
|
|
|
|
; mov eax,4 ;draw text
|
|
|
|
|
call GetSymbColor
|
|
|
|
|
mov esi,1 ;draw 1 symbol
|
|
|
|
|
@@:
|
|
|
|
|
;call IteratNext
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle .no_draw_text
|
|
|
|
|
|
|
|
|
|
; *** <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_mode_color,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je .no_col_change
|
|
|
|
|
cmp byte[edx+1],0
|
|
|
|
|
je .no_col_change
|
|
|
|
|
call GetSymbColor
|
|
|
|
|
.no_col_change:
|
|
|
|
|
|
|
|
|
|
mov eax,4 ;draw text
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne .no_13
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_mode_invis,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne .no_draw_text
|
|
|
|
|
push edx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,edi
|
|
|
|
|
add edx,ted_offs_symbol_new_line
|
2009-12-29 00:19:20 +01:00
|
|
|
|
int 0x40
|
|
|
|
|
pop edx
|
|
|
|
|
jmp .no_draw_text
|
|
|
|
|
.no_13:
|
|
|
|
|
|
|
|
|
|
int 0x40
|
|
|
|
|
ror ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_rec_w
|
|
|
|
|
mov eax,ted_wnd_w
|
|
|
|
|
add eax,ted_wnd_l ;ax = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> x
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp bx,ax
|
|
|
|
|
jge .no_draw_text ;Opt
|
|
|
|
|
ror ebx,16
|
|
|
|
|
call IteratNext
|
|
|
|
|
jmp @b
|
|
|
|
|
.no_draw_text:
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_main_cursor,edi
|
2010-04-15 17:50:49 +02:00
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
MIN_M_WND_H equ 100
|
|
|
|
|
MIN_W_SCRL_ARE equ 3
|
|
|
|
|
MIN_H_SCRL_ARE equ 3
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc EvSize, edit:dword
|
2009-12-29 00:19:20 +01:00
|
|
|
|
push eax ecx edx edi
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
|
|
|
|
m2m ted_wnd_w,[procinfo.client_box.width] ;<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>
|
|
|
|
|
mov eax,ted_wnd_l
|
|
|
|
|
sub ted_wnd_w,eax ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov eax,[wScr] ;+0 size_x
|
|
|
|
|
and eax,0xffff
|
|
|
|
|
sub ted_wnd_w,eax ;<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>
|
|
|
|
|
|
|
|
|
|
m2m ted_wnd_h,[procinfo.client_box.height] ;<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>
|
|
|
|
|
cmp ted_wnd_h,MIN_M_WND_H
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jg @f
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ted_wnd_h,MIN_M_WND_H
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
mov ax,word[hScr.size_y]
|
2010-04-15 17:50:49 +02:00
|
|
|
|
and eax,0xffff
|
|
|
|
|
sub ted_wnd_h,eax ;<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>
|
|
|
|
|
mov eax,ted_wnd_h ;eax = <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>
|
|
|
|
|
mov word[hScr.start_y],ax ;<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>
|
|
|
|
|
mov eax,ted_wnd_t
|
|
|
|
|
sub ted_wnd_h,eax ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
mov eax,ted_wnd_w
|
|
|
|
|
mov ecx,ted_wnd_l
|
|
|
|
|
add eax,ecx
|
|
|
|
|
mov word[wScr.start_x],ax ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov eax,ted_wnd_h
|
|
|
|
|
mov word[wScr.size_y],ax ;<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>
|
|
|
|
|
|
|
|
|
|
add ecx,ted_rec_l ;ecx=ted_wnd_l+ted_rec_l
|
|
|
|
|
mov [hScr.start_x],cx ;<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>
|
|
|
|
|
mov eax,ted_wnd_w
|
|
|
|
|
sub eax,ted_rec_l
|
|
|
|
|
mov word[hScr.size_x],ax ;<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>
|
|
|
|
|
|
|
|
|
|
mov eax,ted_wnd_h ;calculate lines in page
|
|
|
|
|
sub eax,ted_rec_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
xor edx,edx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_rec_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
div ecx
|
|
|
|
|
cmp eax,MIN_W_SCRL_ARE
|
|
|
|
|
jg @f
|
|
|
|
|
mov eax,MIN_W_SCRL_ARE
|
|
|
|
|
@@:
|
|
|
|
|
mov [wScr.cur_area],eax
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov eax,ted_wnd_w ;calculate cols in page
|
|
|
|
|
sub eax,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
xor edx,edx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_rec_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
div ecx
|
|
|
|
|
cmp eax,MIN_H_SCRL_ARE
|
|
|
|
|
jg @f
|
|
|
|
|
mov eax,MIN_H_SCRL_ARE
|
|
|
|
|
@@:
|
|
|
|
|
dec eax ; ???
|
|
|
|
|
mov [hScr.cur_area],eax
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov eax,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov edi,dword tree1
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov tl_box_top,eax ;=ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add tl_box_top,20
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov dword[edit2.top],eax ;=ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add dword[edit2.top],20
|
|
|
|
|
|
|
|
|
|
pop edi edx ecx eax
|
|
|
|
|
call OnInitialUpdate
|
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
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
|
|
|
|
OnInitialUpdate:
|
|
|
|
|
mov [wScr.redraw],1
|
|
|
|
|
mov [hScr.redraw],1
|
|
|
|
|
ret
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
2009-12-29 00:19:20 +01:00
|
|
|
|
;output:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; ecx = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
; edx = pointer to symbol
|
|
|
|
|
; edx = 0 if text not in screen
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
GetFirstVisiblePos:
|
|
|
|
|
push ecx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_tex
|
2009-12-29 00:19:20 +01:00
|
|
|
|
xor ecx,ecx
|
|
|
|
|
@@:
|
|
|
|
|
cmp ecx,[wScr.position]
|
|
|
|
|
je @f
|
|
|
|
|
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
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne @b
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
cmp ecx,[wScr.position]
|
|
|
|
|
je @f
|
|
|
|
|
xor edx,edx
|
|
|
|
|
@@:
|
|
|
|
|
cmp ecx,[wScr.max_area]
|
|
|
|
|
jle @f
|
|
|
|
|
mov [wScr.max_area],ecx
|
|
|
|
|
@@:
|
|
|
|
|
pop ecx
|
|
|
|
|
call OptDrawLineLeft
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to symbol
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; edi = pointer to tedit struct
|
2009-12-29 00:19:20 +01:00
|
|
|
|
;output:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; ecx = <EFBFBD><EFBFBD><EFBFBD><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
align 4
|
|
|
|
|
proc OptDrawLineLeft
|
|
|
|
|
push ebx
|
|
|
|
|
|
|
|
|
|
mov ebx,[hScr.position]
|
|
|
|
|
cmp ebx,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je .ret_f
|
|
|
|
|
push eax
|
|
|
|
|
mov eax,edx
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
|
|
|
|
call IteratNext
|
|
|
|
|
jmp .beg_cycle
|
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ebx,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
|
|
|
|
|
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
jne @f
|
|
|
|
|
call IteratNext
|
|
|
|
|
.beg_cycle:
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle @f
|
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ebx,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
;--------------------------------------
|
|
|
|
|
xor eax,eax ;eax <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
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:
|
|
|
|
|
;--------------------------------------
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov eax,edx
|
|
|
|
|
call IteratNext
|
2010-04-22 21:39:39 +02:00
|
|
|
|
dec ebx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,eax
|
|
|
|
|
pop eax
|
|
|
|
|
.ret_f:
|
|
|
|
|
call GetSymbColor
|
2010-04-22 21:39:39 +02:00
|
|
|
|
pop ebx
|
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:
|
|
|
|
|
; edx = pointer to symbol
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; edi = pointer to tedit struct
|
2009-12-29 00:19:20 +01:00
|
|
|
|
;output:
|
|
|
|
|
; edx = pointer to 13 symbol
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
|
|
|
|
proc OptDrawLineRight
|
2009-12-29 00:19:20 +01:00
|
|
|
|
push eax
|
|
|
|
|
mov eax,edx
|
|
|
|
|
@@:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle @f
|
|
|
|
|
cmp byte[edx],13
|
|
|
|
|
je @f
|
|
|
|
|
mov eax,edx
|
|
|
|
|
call IteratNext
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
mov edx,eax ;perv sumbol
|
|
|
|
|
call GetSymbColor
|
2010-04-22 21:39:39 +02:00
|
|
|
|
|
|
|
|
|
pop eax
|
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
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc draw_main_cursor, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov eax,13 ;draw cursor
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_wnd_t ;calc rect -> y0,y1
|
|
|
|
|
add ecx,ted_rec_t
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_cur_y
|
2010-04-15 17:50:49 +02:00
|
|
|
|
imul edx,ted_rec_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,edx
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_cur_ins,1 ;<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>)
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov edx,ted_rec_h
|
|
|
|
|
inc edx ;1->1, 3->2, 5->3, ...
|
|
|
|
|
shr edx,1 ;edx = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 2 (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,edx
|
|
|
|
|
@@:
|
|
|
|
|
shl ecx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ecx,ted_rec_h
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_cur_ins,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
2010-04-15 17:50:49 +02:00
|
|
|
|
shr cx,1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 2
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l ;calc rect -> x0,x1
|
|
|
|
|
add ebx,ted_rec_l
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_cur_x
|
2010-04-15 17:50:49 +02:00
|
|
|
|
imul edx,ted_rec_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ebx,edx
|
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_rec_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_cursor
|
2010-04-15 17:50:49 +02:00
|
|
|
|
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
call GetPos
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_gp_opt,2
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
|
|
|
|
mov eax,4 ;draw text
|
|
|
|
|
mov esi,1
|
|
|
|
|
ror ecx,16
|
|
|
|
|
mov bx,cx
|
|
|
|
|
add ebx,0x10001
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_cur_ins,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne .no_up_tetx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_rec_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
inc cx ; 1->1, 3->2, 5->3, ...
|
|
|
|
|
shr cx,1
|
|
|
|
|
sub bx,cx
|
|
|
|
|
.no_up_tetx:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_color_cur_text
|
2009-12-29 00:19:20 +01:00
|
|
|
|
call ConvertInvisSymb
|
|
|
|
|
int 0x40
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
mov eax,4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ebx,3
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_color_wnd_bord
|
2009-12-29 00:19:20 +01:00
|
|
|
|
or ecx,0x80000000
|
|
|
|
|
mov edx,txtRow
|
2010-04-15 17:50:49 +02:00
|
|
|
|
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
add ebx,0x500000
|
|
|
|
|
mov edx,txtCol
|
2010-04-15 17:50:49 +02:00
|
|
|
|
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '<27><><EFBFBD><EFBFBD>'
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_tim_undo,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
|
|
|
|
add ebx,0x500000
|
|
|
|
|
mov edx,txtOtm
|
|
|
|
|
int 0x40
|
|
|
|
|
sub ebx,0x500000
|
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall draw_bufer,edi
|
|
|
|
|
stdcall draw_help_f1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov eax,47 ;draw cursor coords
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov esi,ted_color_wnd_bord
|
2009-12-29 00:19:20 +01:00
|
|
|
|
or esi,0x40000000
|
|
|
|
|
|
|
|
|
|
mov edx,ebx
|
|
|
|
|
ror edx,16
|
|
|
|
|
sub edx,35
|
|
|
|
|
ror edx,16
|
|
|
|
|
;add edx,3
|
|
|
|
|
mov ebx,0x40000 ;Row=...
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_cur_y
|
2009-12-29 00:19:20 +01:00
|
|
|
|
inc ecx
|
|
|
|
|
add ecx,[wScr.position]
|
2010-04-22 21:39:39 +02:00
|
|
|
|
|
|
|
|
|
push edi
|
|
|
|
|
mov edi,ted_color_wnd_work
|
|
|
|
|
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
pop edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
;mov ebx,0x40000 ;Col=...
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_cur_x
|
2009-12-29 00:19:20 +01:00
|
|
|
|
inc ecx
|
|
|
|
|
add ecx,[hScr.position]
|
|
|
|
|
add edx,0x500000
|
2010-04-22 21:39:39 +02:00
|
|
|
|
push edi
|
|
|
|
|
mov edi,ted_color_wnd_work
|
|
|
|
|
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
pop edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_tim_undo,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_tim_undo
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add edx,0x500000
|
|
|
|
|
int 0x40
|
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
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 draw_bufer, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
cmp byte[buf],0
|
|
|
|
|
je @f
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add bx,250
|
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ebx,3
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_color_wnd_bord
|
2009-12-29 00:19:20 +01:00
|
|
|
|
or ecx,0x40000000
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edi,ted_color_wnd_work
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov edx,txtBuf
|
|
|
|
|
mov esi,buf
|
|
|
|
|
call strlen
|
2009-12-30 20:07:50 +01:00
|
|
|
|
if lang eq ru
|
2009-12-29 00:19:20 +01:00
|
|
|
|
cmp eax,15
|
|
|
|
|
jle .crop_buf
|
|
|
|
|
mov eax,15
|
|
|
|
|
.crop_buf:
|
2009-12-30 20:07:50 +01:00
|
|
|
|
mov esi,7 ;7=len(txtBuf)
|
|
|
|
|
else
|
|
|
|
|
cmp eax,14
|
|
|
|
|
jle .crop_buf
|
|
|
|
|
mov eax,14
|
|
|
|
|
.crop_buf:
|
|
|
|
|
mov esi,8 ;8=len(txtBuf)
|
|
|
|
|
end if
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add esi,eax
|
|
|
|
|
|
|
|
|
|
mov eax,4
|
|
|
|
|
int 0x40
|
|
|
|
|
@@:
|
2010-04-15 17:50:49 +02:00
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
;input:
|
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
align 4
|
|
|
|
|
proc draw_help_f1
|
2010-04-15 17:50:49 +02:00
|
|
|
|
pushad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov eax,13 ;clear place before draw help
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_w
|
|
|
|
|
sub ebx,ted_rec_l
|
|
|
|
|
mov ecx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,13
|
|
|
|
|
shl ecx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ecx,ted_rec_h
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_capt
|
2009-12-29 00:19:20 +01:00
|
|
|
|
int 0x40
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_help_id,-1
|
2010-04-15 17:50:49 +02:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov eax,ted_help_id
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ColToIndexOffset eax,edx
|
|
|
|
|
|
|
|
|
|
;SetCoordinates
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ebx,13 ;=3+10
|
|
|
|
|
|
|
|
|
|
;SetTextColor
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
|
|
|
|
|
shl ax,2
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_text_colors
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,eax
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,dword[ecx]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
or ecx,0xc0000000 ;SetTextStyles
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov esi,edi
|
|
|
|
|
mov edi,ted_color_wnd_work
|
|
|
|
|
mov eax,4
|
|
|
|
|
int 0x40
|
|
|
|
|
mov edi,esi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
;*** draw help string ***
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_color_wnd_bord
|
2009-12-29 00:19:20 +01:00
|
|
|
|
or ecx,0x80000000
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,dword[edx+MAX_COLOR_WORD_LEN]
|
|
|
|
|
cmp edx,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
add edx,ted_help_text_f1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ebx,0x500000
|
|
|
|
|
int 0x40
|
2010-04-15 17:50:49 +02:00
|
|
|
|
@@:
|
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc draw_line_numbers, edit:dword
|
|
|
|
|
pushad
|
|
|
|
|
mov edi,dword[edit]
|
|
|
|
|
|
|
|
|
|
;top panel with caption
|
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
; add ebx,ted_rec_l
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,ted_wnd_w
|
|
|
|
|
; sub ebx,ted_rec_l
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_work
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_wnd_t
|
|
|
|
|
shl ecx,16
|
|
|
|
|
add ecx,ted_rec_t
|
|
|
|
|
mov eax,13
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_capt
|
2010-04-15 17:50:49 +02:00
|
|
|
|
int 0x40
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
;line numbers
|
|
|
|
|
mov ebx,0x40000 ;format
|
|
|
|
|
mov ecx,[wScr.position]
|
|
|
|
|
inc ecx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov edx,3
|
|
|
|
|
add edx,ted_wnd_l
|
|
|
|
|
rol edx,16
|
|
|
|
|
add edx,ted_wnd_t
|
|
|
|
|
add edx,ted_rec_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
push ebx ecx edx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
;left panel with numbers
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
2009-12-29 00:19:20 +01:00
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_rec_l
|
|
|
|
|
mov ecx,ted_rec_h
|
|
|
|
|
rol ecx,16
|
2009-12-29 00:19:20 +01:00
|
|
|
|
mov cx,dx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
rol ecx,16
|
|
|
|
|
mov eax,13
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_capt
|
2010-04-15 17:50:49 +02:00
|
|
|
|
int 0x40 ;<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>
|
|
|
|
|
pop edx ecx ebx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov eax,47
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov esi,ted_color_wnd_bord
|
2010-04-15 17:50:49 +02:00
|
|
|
|
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
inc ecx
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add edx,ted_rec_h
|
|
|
|
|
sub edx,ted_wnd_t
|
|
|
|
|
mov esi,edx
|
|
|
|
|
and esi,0xffff
|
|
|
|
|
cmp esi,ted_wnd_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jge @f
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add edx,ted_wnd_t
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
popad
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;this function need to optimize output
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2010-04-15 17:50:49 +02:00
|
|
|
|
proc draw_cursor_sumb, edit:dword
|
|
|
|
|
push eax ecx edx edi
|
|
|
|
|
mov edi,dword[edit]
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov eax,13 ;rect
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ebx,ted_wnd_l
|
|
|
|
|
add ebx,ted_rec_l
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_cur_x
|
2010-04-15 17:50:49 +02:00
|
|
|
|
imul edx,ted_rec_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ebx,edx
|
|
|
|
|
shl ebx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ebx,ted_rec_w
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
mov ecx,ted_wnd_t ;calc rect -> y0,y1
|
|
|
|
|
add ecx,ted_rec_t
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_cur_y
|
2010-04-15 17:50:49 +02:00
|
|
|
|
imul edx,ted_rec_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,edx
|
|
|
|
|
shl ecx,16
|
2010-04-15 17:50:49 +02:00
|
|
|
|
add ecx,ted_rec_h
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_work
|
2009-12-29 00:19:20 +01:00
|
|
|
|
push ecx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
stdcall SelNormalize,edi
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
mov ecx,[wScr.position]
|
2010-04-22 21:39:39 +02:00
|
|
|
|
sub ted_seln_y0,ecx
|
|
|
|
|
sub ted_seln_y1,ecx
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_cur_y
|
|
|
|
|
cmp ecx,ted_seln_y0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jl .no_cur_sel
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ecx,ted_seln_y1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jg .no_cur_sel
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_select
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ecx,ted_seln_y0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_cur_x
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,[hScr.position]
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ecx,ted_seln_x0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jge @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_work
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_cur_y
|
|
|
|
|
cmp ecx,ted_seln_y1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne .no_cur_sel
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_cur_x
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,[hScr.position]
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ecx,ted_seln_x1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jl .no_cur_sel
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,ted_color_wnd_work
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
.no_cur_sel:
|
|
|
|
|
pop ecx
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
call GetPos
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_gp_opt,2
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
|
|
|
|
push esi
|
|
|
|
|
mov eax,4 ;draw text
|
|
|
|
|
mov esi,1
|
|
|
|
|
ror ecx,16
|
|
|
|
|
mov bx,cx
|
|
|
|
|
add ebx,0x10001
|
|
|
|
|
call GetSymbColor
|
|
|
|
|
call ConvertInvisSymb
|
|
|
|
|
int 0x40
|
|
|
|
|
pop esi
|
|
|
|
|
@@:
|
|
|
|
|
|
2010-04-15 17:50:49 +02:00
|
|
|
|
pop edi edx ecx eax
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ret
|
2010-04-15 17:50:49 +02:00
|
|
|
|
endp
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;input:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; edx -> pointer to text
|
|
|
|
|
; edi -> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> tedit
|
2009-12-29 00:19:20 +01:00
|
|
|
|
;output:
|
|
|
|
|
; ecx = color
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; if ted_mode_color=0 then ecx=ted_color_wnd_text
|
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
GetSymbColor:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,ted_color_wnd_text ;<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>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
|
|
|
|
|
push eax edx
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_mode_color,0
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je .exit
|
|
|
|
|
jmp .on_first
|
|
|
|
|
@@:
|
|
|
|
|
call IteratPerv
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp edx,ted_tex_1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jle .exit
|
|
|
|
|
.on_first:
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov al,byte[edx+1]
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp al,0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> al=0 <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
je @b
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp eax,ted_colors_text_count
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jge .exit
|
|
|
|
|
|
2010-04-22 21:39:39 +02:00
|
|
|
|
shl ax,2 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 4 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx,ted_text_colors ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1-<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
add ecx,eax
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov ecx,dword[ecx] ;<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>
|
2009-12-29 00:19:20 +01:00
|
|
|
|
.exit:
|
|
|
|
|
pop edx eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; edx = pointer to text
|
2010-04-22 21:39:39 +02:00
|
|
|
|
; edi = pointer to tedit struct
|
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
ConvertInvisSymb:
|
2010-04-22 21:39:39 +02:00
|
|
|
|
cmp ted_mode_invis,1
|
2009-12-29 00:19:20 +01:00
|
|
|
|
jne @f
|
|
|
|
|
cmp byte [edx],13
|
|
|
|
|
jne @f
|
2010-04-22 21:39:39 +02:00
|
|
|
|
mov edx,edi
|
|
|
|
|
add edx,ted_offs_symbol_new_line
|
2009-12-29 00:19:20 +01:00
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;input:
|
|
|
|
|
; ecx = 0x4000____
|
|
|
|
|
; cx = icon index
|
|
|
|
|
; edx = x*2^16+y
|
2010-04-22 21:39:39 +02:00
|
|
|
|
align 4
|
2009-12-29 00:19:20 +01:00
|
|
|
|
draw_but_icon:
|
|
|
|
|
push eax ebx
|
|
|
|
|
|
|
|
|
|
mov eax,8 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
push ecx edx esi
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
mov edx,ecx
|
|
|
|
|
add edx,3
|
|
|
|
|
mov cx,bx
|
|
|
|
|
shl ecx,16
|
|
|
|
|
mov cx,19 ;=20-1
|
|
|
|
|
mov bx,19 ;=20-1
|
|
|
|
|
mov esi,[sc.work_button]
|
|
|
|
|
int 0x40
|
|
|
|
|
pop esi edx ecx
|
|
|
|
|
|
|
|
|
|
mov ebx,ecx
|
|
|
|
|
ror ebx,16
|
|
|
|
|
cmp bx,0x4000
|
|
|
|
|
jne @f
|
|
|
|
|
|
|
|
|
|
mov eax,7 ;bmp
|
|
|
|
|
mov ebx,[bmp_icon]
|
|
|
|
|
push ecx
|
|
|
|
|
and ecx,0xffff
|
|
|
|
|
imul ecx,1200
|
|
|
|
|
add ebx,ecx
|
|
|
|
|
mov ecx,20
|
|
|
|
|
shl ecx,16
|
|
|
|
|
add ecx,20
|
|
|
|
|
int 0x40
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
pop ebx eax
|
|
|
|
|
ret
|
|
|
|
|
|