forked from KolibriOS/kolibrios
1) revised 't_edit' new function 'ted_init_scroll_bars'
2) updated documentation git-svn-id: svn://kolibrios.org@1458 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> box_lib.obj
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TextEditor <20><><EFBFBD> Kolibri OS
|
||||
; 䠩<> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> ࠧ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 29.04.2010 IgorA
|
||||
; 䠩<> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> ࠧ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 03.05.2010 IgorA
|
||||
; <20><> <20><><EFBFBD> <20>ਬ<EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD> GPL2 <20><>業<EFBFBD><E6A5AD><EFBFBD>
|
||||
|
||||
;input:
|
||||
@@ -54,6 +54,8 @@ struct symbol
|
||||
ends
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
ted_symbol_tab db 26
|
||||
|
||||
if lang eq ru
|
||||
|
||||
txtFindCapt db '<27><><EFBFBD><EFBFBD><EFBFBD>',0
|
||||
@@ -80,7 +82,7 @@ end if
|
||||
|
||||
;------
|
||||
align 4
|
||||
EvChar db 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0
|
||||
EvChar db 0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0
|
||||
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
||||
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
|
||||
@@ -146,30 +148,95 @@ KEY_F3 equ 0x0000003D
|
||||
|
||||
align 4
|
||||
proc ted_init, edit:dword
|
||||
push eax ecx edi
|
||||
mov edi,dword[edit]
|
||||
push eax ecx edi
|
||||
mov edi,dword[edit]
|
||||
|
||||
mov ecx,sizeof.symbol
|
||||
imul ecx,ted_max_chars
|
||||
call mem_Alloc ;<3B>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov ted_tex,eax
|
||||
mov ted_tex_1,eax
|
||||
add ted_tex_1,sizeof.symbol
|
||||
add eax,ecx
|
||||
mov ted_tex_end,eax
|
||||
mov ecx,sizeof.symbol
|
||||
imul ecx,ted_max_chars
|
||||
call mem_Alloc ;<3B>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov ted_tex,eax
|
||||
mov ted_tex_1,eax
|
||||
add ted_tex_1,sizeof.symbol
|
||||
add eax,ecx
|
||||
mov ted_tex_end,eax
|
||||
|
||||
stdcall ted_clear, edi,1
|
||||
stdcall ted_clear, edi,1
|
||||
|
||||
;-------------------------------------------------
|
||||
mov ecx,1024 ;1024 - <20><><EFBFBD> <20><><EFBFBD>ᨢ<EFBFBD> ted_arr_key_pos
|
||||
add ecx,ted_syntax_file_size
|
||||
call mem_Alloc
|
||||
mov ted_arr_key_pos,eax
|
||||
add eax,1024
|
||||
mov ted_syntax_file,eax
|
||||
mov ecx,1024 ;1024 - <20><><EFBFBD> <20><><EFBFBD>ᨢ<EFBFBD> ted_arr_key_pos
|
||||
add ecx,ted_syntax_file_size
|
||||
call mem_Alloc
|
||||
mov ted_arr_key_pos,eax
|
||||
add eax,1024
|
||||
mov ted_syntax_file,eax
|
||||
|
||||
pop edi ecx eax
|
||||
ret
|
||||
stdcall ted_init_scroll_bars,edi,3
|
||||
pop edi ecx eax
|
||||
ret
|
||||
endp
|
||||
|
||||
MIN_W_SCRL_ARE equ 3 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
MIN_H_SCRL_ARE equ 3 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
;input:
|
||||
; opt = 1 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>譨<EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
||||
align 4
|
||||
proc ted_init_scroll_bars, edit:dword, opt:dword
|
||||
pushad
|
||||
mov esi,ted_scr_w
|
||||
mov ebx,ted_scr_h
|
||||
bt dword[opt],0
|
||||
jae @f
|
||||
mov ecx,ted_color_wnd_work
|
||||
mov dword[esi+sb_offs_bckg_col],ecx
|
||||
mov dword[ebx+sb_offs_bckg_col],ecx
|
||||
mov ecx,ted_color_wnd_capt
|
||||
mov dword[esi+sb_offs_frnt_col],ecx
|
||||
mov dword[ebx+sb_offs_frnt_col],ecx
|
||||
mov ecx,ted_color_wnd_bord
|
||||
mov dword[esi+sb_offs_line_col],ecx
|
||||
mov dword[ebx+sb_offs_line_col],ecx
|
||||
@@:
|
||||
bt dword[opt],1
|
||||
jae .no_size
|
||||
mov edx,ted_wnd_l
|
||||
add edx,ted_rec_l
|
||||
mov word[ebx+sb_offs_start_x],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_h ;calculate lines in page
|
||||
mov edx,ted_wnd_t
|
||||
add edx,eax
|
||||
mov word[ebx+sb_offs_start_y],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD>孨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
sub eax,ted_rec_t
|
||||
xor edx,edx
|
||||
mov ecx,ted_rec_h
|
||||
div ecx
|
||||
cmp eax,MIN_W_SCRL_ARE
|
||||
jg @f
|
||||
mov eax,MIN_W_SCRL_ARE
|
||||
@@:
|
||||
mov dword[esi+sb_offs_cur_area],eax
|
||||
|
||||
mov eax,ted_wnd_w ;calculate cols in page
|
||||
mov edx,ted_wnd_l ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
add edx,eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
mov word[esi+sb_offs_start_x],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov edx,ted_wnd_t
|
||||
mov word[esi+sb_offs_start_y],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD>孨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov edx,ted_wnd_h
|
||||
mov word[esi+sb_offs_size_y],dx ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
sub eax,ted_rec_l
|
||||
mov word[ebx+sb_offs_size_x],ax ;<3B><><EFBFBD>⠢<EFBFBD>塞 <20><>ਭ<EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
xor edx,edx
|
||||
mov ecx,ted_rec_w
|
||||
div ecx
|
||||
cmp eax,MIN_H_SCRL_ARE
|
||||
jg @f
|
||||
mov eax,MIN_H_SCRL_ARE
|
||||
@@:
|
||||
dec eax
|
||||
mov dword[ebx+sb_offs_cur_area],eax ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>࠭ <20><><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
.no_size:
|
||||
popad
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
@@ -193,6 +260,9 @@ align 4
|
||||
proc ted_key, edit:dword, table:dword, control:dword
|
||||
pushad
|
||||
mov edi,dword[edit]
|
||||
mov esi,ted_el_focus
|
||||
cmp dword[esi],edi
|
||||
jne .end_key_fun ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> 䮪<><E4AEAA><EFBFBD> <20><>室<EFBFBD><E5AEA4> <20><> <20>㭪樨
|
||||
mov esi,dword[control]
|
||||
|
||||
cmp ah,KEY_F1 ;[F1]
|
||||
@@ -214,6 +284,12 @@ proc ted_key, edit:dword, table:dword, control:dword
|
||||
je @f
|
||||
call ted_fun_on_key_ctrl_o
|
||||
@@:
|
||||
cmp ah,31 ;Ctrl+S
|
||||
jne @f
|
||||
cmp ted_fun_on_key_ctrl_s,0
|
||||
je @f
|
||||
call ted_fun_on_key_ctrl_s
|
||||
@@:
|
||||
cmp ah,33 ;Ctrl+F
|
||||
jne @f
|
||||
cmp ted_panel_id,TED_PANEL_FIND
|
||||
@@ -247,41 +323,41 @@ proc ted_key, edit:dword, table:dword, control:dword
|
||||
jmp .end_key_fun
|
||||
.key_Ctrl:
|
||||
|
||||
test esi,KM_SHIFT ;Shift+...
|
||||
jz .key_Shift
|
||||
cmp ah,72 ;Shift+Up
|
||||
jne @f
|
||||
call ted_sel_key_up
|
||||
@@:
|
||||
cmp ah,75 ;Shift+Left
|
||||
jne @f
|
||||
call ted_sel_key_left
|
||||
@@:
|
||||
cmp ah,77 ;Shift+Right
|
||||
jne @f
|
||||
call ted_sel_key_right
|
||||
@@:
|
||||
cmp ah,80 ;Shift+Down
|
||||
jne @f
|
||||
call ted_sel_key_down
|
||||
@@:
|
||||
;mov ted_drag_k,1 ;<3B><>稭<EFBFBD><E7A8AD><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmp .key_MoveCur
|
||||
.key_Shift:
|
||||
test esi,KM_SHIFT ;Shift+...
|
||||
jz .key_Shift
|
||||
cmp ah,72 ;Shift+Up
|
||||
jne @f
|
||||
call ted_sel_key_up
|
||||
@@:
|
||||
cmp ah,75 ;Shift+Left
|
||||
jne @f
|
||||
call ted_sel_key_left
|
||||
@@:
|
||||
cmp ah,77 ;Shift+Right
|
||||
jne @f
|
||||
call ted_sel_key_right
|
||||
@@:
|
||||
cmp ah,80 ;Shift+Down
|
||||
jne @f
|
||||
call ted_sel_key_down
|
||||
@@:
|
||||
;mov ted_drag_k,1 ;<3B><>稭<EFBFBD><E7A8AD><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmp .key_MoveCur
|
||||
.key_Shift:
|
||||
;-------------------------------------------------
|
||||
cmp ah,72 ;178 ;Up
|
||||
jne @f
|
||||
call ted_draw_cursor_sumb
|
||||
call ted_cur_move_up
|
||||
cmp dl,8
|
||||
jne .no_red_0
|
||||
call ted_scroll_set_redraw
|
||||
stdcall ted_draw,edi
|
||||
jmp @f
|
||||
.no_red_0:
|
||||
call ted_draw_main_cursor
|
||||
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@:
|
||||
cmp ah,72 ;178 ;Up
|
||||
jne @f
|
||||
call ted_draw_cursor_sumb
|
||||
call ted_cur_move_up
|
||||
cmp dl,8
|
||||
jne .no_red_0
|
||||
call ted_scroll_set_redraw
|
||||
stdcall ted_draw,edi
|
||||
jmp @f
|
||||
.no_red_0:
|
||||
call ted_draw_main_cursor
|
||||
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@:
|
||||
cmp ah,80 ;177 ;Down
|
||||
jne @f
|
||||
call ted_draw_cursor_sumb
|
||||
@@ -365,8 +441,8 @@ proc ted_key, edit:dword, table:dword, control:dword
|
||||
mov ted_drag_k,0 ;<3B><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@:
|
||||
;-------------------------------------------------
|
||||
; cmp esi,0
|
||||
; jne .end_key_fun
|
||||
; cmp esi,0
|
||||
; jne .end_key_fun
|
||||
.key_MoveCur:
|
||||
|
||||
cmp ah,69 ;[Pause Break]
|
||||
@@ -607,11 +683,11 @@ proc ted_clear, edit:dword, cl_al_mem:dword
|
||||
|
||||
mov ecx,ted_scr_w
|
||||
mov dword[ecx+sb_offs_position],0
|
||||
mov dword[ecx+sb_offs_max_area],100
|
||||
mov dword[ecx+sb_offs_max_area],100 ;<3B><> <20><>ப <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
||||
mov dword[ecx+sb_offs_redraw],1
|
||||
mov ecx,ted_scr_h
|
||||
mov dword[ecx+sb_offs_position],0
|
||||
mov dword[ecx+sb_offs_max_area],100
|
||||
mov dword[ecx+sb_offs_max_area],100 ;<3B><> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
||||
|
||||
mov ted_sel_x0,0
|
||||
mov ted_sel_y0,0
|
||||
@@ -724,6 +800,7 @@ proc ted_init_syntax_file, edit:dword, file:dword, f_name:dword
|
||||
add ecx,ted_key_words_data
|
||||
mov ted_help_text_f1,ecx
|
||||
|
||||
stdcall ted_init_scroll_bars,edi,1 ;<3B><><EFBFBD>塞 梥<><E6A2A5> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
.no_colors:
|
||||
popad
|
||||
ret
|
||||
@@ -2805,14 +2882,19 @@ ted_get_symb_color:
|
||||
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>⠥<EFBFBD><E2A0A5><EFBFBD> <20><> <20><>࠭<EFBFBD>
|
||||
align 4
|
||||
ted_convert_invis_symb:
|
||||
cmp ted_mode_invis,1
|
||||
jne @f
|
||||
cmp byte[edx],13
|
||||
jne @f
|
||||
mov edx,edi
|
||||
add edx,ted_offs_symbol_new_line
|
||||
@@:
|
||||
ret
|
||||
cmp ted_mode_invis,1
|
||||
jne .end_f
|
||||
cmp byte[edx],9
|
||||
jne @f
|
||||
lea edx,[ted_symbol_tab]
|
||||
@@:
|
||||
cmp byte[edx],13
|
||||
jne @f
|
||||
mov edx,edi
|
||||
add edx,ted_offs_symbol_new_line
|
||||
@@:
|
||||
.end_f:
|
||||
ret
|
||||
|
||||
;input:
|
||||
; edi = pointer to tedit struct
|
||||
@@ -2828,93 +2910,93 @@ ted_scroll_set_redraw:
|
||||
|
||||
align 4
|
||||
proc ted_draw, edit:dword
|
||||
locals
|
||||
line_num dd ?
|
||||
endl
|
||||
pushad
|
||||
mov edi,dword[edit]
|
||||
locals
|
||||
line_num dd ?
|
||||
endl
|
||||
pushad
|
||||
mov edi,dword[edit]
|
||||
|
||||
mov eax,4 ;draw text
|
||||
mov ecx,ted_text_colors
|
||||
mov ecx,dword[ecx]
|
||||
mov eax,4 ;draw text
|
||||
mov ecx,ted_text_colors
|
||||
mov ecx,dword[ecx]
|
||||
|
||||
mov ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
shl ebx,16
|
||||
add ebx,ted_wnd_t
|
||||
add ebx,ted_rec_t
|
||||
add ebx,0x10001 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㪢<EFBFBD> <20><> 業<><E6A5AD><EFBFBD>
|
||||
mov ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
shl ebx,16
|
||||
add ebx,ted_wnd_t
|
||||
add ebx,ted_rec_t
|
||||
add ebx,0x10001 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㪢<EFBFBD> <20><> 業<><E6A5AD><EFBFBD>
|
||||
|
||||
call ted_sel_normalize ;need before draw select
|
||||
mov esi,ted_scr_w
|
||||
mov esi,dword[esi+sb_offs_position]
|
||||
mov dword[line_num],esi
|
||||
call ted_sel_normalize ;need before draw select
|
||||
mov esi,ted_scr_w
|
||||
mov esi,dword[esi+sb_offs_position]
|
||||
mov dword[line_num],esi
|
||||
|
||||
stdcall ted_clear_line_before_draw, edi,ebx,1,esi
|
||||
call ted_get_first_visible_pos
|
||||
cmp edx,0
|
||||
je .no_draw_text
|
||||
mov esi,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뢮<EFBFBD><EBA2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD> <20><> 1-<2D><> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
||||
@@:
|
||||
call ted_iterat_next
|
||||
cmp edx,ted_tex_1
|
||||
jle .no_draw_text
|
||||
stdcall ted_clear_line_before_draw, edi,ebx,1,esi
|
||||
call ted_get_first_visible_pos
|
||||
cmp edx,0
|
||||
je .no_draw_text
|
||||
mov esi,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뢮<EFBFBD><EBA2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD> <20><> 1-<2D><> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
||||
@@:
|
||||
call ted_iterat_next
|
||||
cmp edx,ted_tex_1
|
||||
jle .no_draw_text
|
||||
|
||||
; *** 梥⮢<E6A2A5><E2AEA2> ࠧ<><E0A0A7>⪠
|
||||
cmp ted_mode_color,0
|
||||
je .no_col_change
|
||||
cmp byte[edx+1],0
|
||||
je .no_col_change
|
||||
call ted_get_symb_color
|
||||
.no_col_change:
|
||||
; *** 梥⮢<E6A2A5><E2AEA2> ࠧ<><E0A0A7>⪠
|
||||
cmp ted_mode_color,0
|
||||
je .no_col_change
|
||||
cmp byte[edx+1],0
|
||||
je .no_col_change
|
||||
call ted_get_symb_color
|
||||
.no_col_change:
|
||||
|
||||
cmp byte [edx],13
|
||||
jne .no_13
|
||||
cmp ted_mode_invis,1
|
||||
jne .no_invis
|
||||
push edx
|
||||
mov edx,edi
|
||||
add edx,ted_offs_symbol_new_line
|
||||
int 0x40
|
||||
pop edx
|
||||
.no_invis:
|
||||
add ebx,ted_rec_h
|
||||
;optimized output \/
|
||||
mov eax,ted_wnd_h
|
||||
add eax,ted_wnd_t
|
||||
cmp bx,ax
|
||||
jg .no_draw_text
|
||||
mov eax,4
|
||||
;optimized output /\
|
||||
and ebx,0xffff
|
||||
ror ebx,16
|
||||
add ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
inc ebx
|
||||
ror ebx,16
|
||||
inc dword[line_num] ;increment line number
|
||||
stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num]
|
||||
call ted_opt_draw_line_left
|
||||
jmp @b
|
||||
.no_13:
|
||||
cmp byte [edx],13
|
||||
jne .no_13
|
||||
cmp ted_mode_invis,1
|
||||
jne .no_invis
|
||||
push edx
|
||||
mov edx,edi
|
||||
add edx,ted_offs_symbol_new_line
|
||||
int 0x40
|
||||
pop edx
|
||||
.no_invis:
|
||||
add ebx,ted_rec_h
|
||||
;optimized output \/
|
||||
mov eax,ted_wnd_h
|
||||
add eax,ted_wnd_t
|
||||
cmp bx,ax
|
||||
jg .no_draw_text
|
||||
mov eax,4
|
||||
;optimized output /\
|
||||
and ebx,0xffff
|
||||
ror ebx,16
|
||||
add ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
inc ebx
|
||||
ror ebx,16
|
||||
inc dword[line_num] ;increment line number
|
||||
stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num]
|
||||
call ted_opt_draw_line_left
|
||||
jmp @b
|
||||
.no_13:
|
||||
|
||||
int 0x40
|
||||
ror ebx,16
|
||||
add ebx,ted_rec_w
|
||||
mov esi,ted_wnd_l
|
||||
add esi,ted_wnd_w
|
||||
cmp bx,si
|
||||
jl .no_opt
|
||||
call ted_opt_draw_line_right
|
||||
.no_opt:
|
||||
mov si,1
|
||||
ror ebx,16
|
||||
jmp @b
|
||||
.no_draw_text:
|
||||
int 0x40
|
||||
ror ebx,16
|
||||
add ebx,ted_rec_w
|
||||
mov esi,ted_wnd_l
|
||||
add esi,ted_wnd_w
|
||||
cmp bx,si
|
||||
jl .no_opt
|
||||
call ted_opt_draw_line_right
|
||||
.no_opt:
|
||||
mov si,1
|
||||
ror ebx,16
|
||||
jmp @b
|
||||
.no_draw_text:
|
||||
|
||||
stdcall ted_clear_line_before_draw,edi,ebx,0,dword[line_num]
|
||||
call ted_draw_line_numbers
|
||||
call ted_draw_main_cursor
|
||||
stdcall ted_clear_line_before_draw,edi,ebx,0,dword[line_num]
|
||||
call ted_draw_line_numbers
|
||||
call ted_draw_main_cursor
|
||||
|
||||
;---------------------------------------------
|
||||
; set all_redraw flag for draw all ScrollBar
|
||||
@@ -3086,7 +3168,8 @@ pop edi
|
||||
je @f
|
||||
mov ecx,ted_tim_undo
|
||||
add edx,0x500000
|
||||
int 0x40
|
||||
mov edi,ted_color_wnd_work ;<3B><><EFBFBD>⨬ ॣ<><E0A5A3><EFBFBD><EFBFBD> edi, <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20>㭪樨 <20><><EFBFBD> 㦥 <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
int 0x40 ;<3B>뢮<EFBFBD> <20><> <20>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⢨<EFBFBD>
|
||||
@@:
|
||||
|
||||
popad
|
||||
@@ -3101,9 +3184,12 @@ proc ted_draw_buffer
|
||||
mov eax,ted_buffer
|
||||
cmp byte[eax],0 ;ᬮ<>ਬ 1-<2D> ᨬ<><E1A8AC><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
je @f
|
||||
mov ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
mov ebx,ted_rec_l
|
||||
add bx,300
|
||||
cmp ebx,ted_wnd_w ;<3B>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD> <20>뢮<EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
jge @f ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
add ebx,ted_wnd_l
|
||||
shl ebx,16
|
||||
add ebx,ted_wnd_t
|
||||
add ebx,3
|
||||
@@ -3141,59 +3227,60 @@ endp
|
||||
; edi = pointer to tedit struct
|
||||
align 4
|
||||
proc ted_draw_help_f1
|
||||
pushad
|
||||
pushad
|
||||
cmp ted_rec_t,13 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2>
|
||||
jle @f
|
||||
mov eax,13 ;clear place before draw help
|
||||
mov ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
shl ebx,16
|
||||
add ebx,ted_wnd_w
|
||||
sub ebx,ted_rec_l
|
||||
mov ecx,ted_wnd_t
|
||||
add ecx,13
|
||||
shl ecx,16
|
||||
add ecx,ted_rec_h
|
||||
mov edx,ted_color_wnd_capt
|
||||
int 0x40
|
||||
|
||||
mov eax,13 ;clear place before draw help
|
||||
mov ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
shl ebx,16
|
||||
add ebx,ted_wnd_w
|
||||
sub ebx,ted_rec_l
|
||||
mov ecx,ted_wnd_t
|
||||
add ecx,13
|
||||
shl ecx,16
|
||||
add ecx,ted_rec_h
|
||||
mov edx,ted_color_wnd_capt
|
||||
int 0x40
|
||||
cmp ted_help_id,-1
|
||||
je @f
|
||||
mov eax,ted_help_id
|
||||
ColToIndexOffset eax,edx
|
||||
|
||||
cmp ted_help_id,-1
|
||||
je @f
|
||||
mov eax,ted_help_id
|
||||
ColToIndexOffset eax,edx
|
||||
;SetCoordinates
|
||||
mov ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
shl ebx,16
|
||||
add ebx,ted_wnd_t
|
||||
add ebx,13 ;=3+10
|
||||
|
||||
;SetCoordinates
|
||||
mov ebx,ted_wnd_l
|
||||
add ebx,ted_rec_l
|
||||
shl ebx,16
|
||||
add ebx,ted_wnd_t
|
||||
add ebx,13 ;=3+10
|
||||
;SetTextColor
|
||||
xor eax,eax
|
||||
mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
|
||||
shl ax,2
|
||||
mov ecx,ted_text_colors
|
||||
add ecx,eax
|
||||
mov ecx,dword[ecx]
|
||||
or ecx,0xc0000000 ;SetTextStyles
|
||||
mov esi,edi
|
||||
mov edi,ted_color_wnd_work
|
||||
mov eax,4
|
||||
int 0x40
|
||||
mov edi,esi
|
||||
|
||||
;SetTextColor
|
||||
xor eax,eax
|
||||
mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
|
||||
shl ax,2
|
||||
mov ecx,ted_text_colors
|
||||
add ecx,eax
|
||||
mov ecx,dword[ecx]
|
||||
or ecx,0xc0000000 ;SetTextStyles
|
||||
mov esi,edi
|
||||
mov edi,ted_color_wnd_work
|
||||
mov eax,4
|
||||
int 0x40
|
||||
mov edi,esi
|
||||
|
||||
;*** draw help string ***
|
||||
mov ecx,ted_color_wnd_bord
|
||||
or ecx,0x80000000
|
||||
mov edx,dword[edx+MAX_COLOR_WORD_LEN]
|
||||
cmp edx,0
|
||||
je @f
|
||||
add edx,ted_help_text_f1
|
||||
add ebx,0x500000
|
||||
int 0x40
|
||||
@@:
|
||||
popad
|
||||
ret
|
||||
;*** draw help string ***
|
||||
mov ecx,ted_color_wnd_bord
|
||||
or ecx,0x80000000
|
||||
mov edx,dword[edx+MAX_COLOR_WORD_LEN]
|
||||
cmp edx,0
|
||||
je @f
|
||||
add edx,ted_help_text_f1
|
||||
add ebx,0x500000
|
||||
int 0x40
|
||||
@@:
|
||||
popad
|
||||
ret
|
||||
endp
|
||||
|
||||
;input:
|
||||
@@ -3698,7 +3785,11 @@ proc ted_mouse, edit:dword
|
||||
call ted_wnd_main_click
|
||||
jmp .no_in_wnd
|
||||
@@:
|
||||
call ted_wnd_main_mouse_scroll
|
||||
mov edx,ted_el_focus
|
||||
cmp dword[edx],edi
|
||||
jne @f
|
||||
call ted_wnd_main_mouse_scroll ;ᬮ<>ਬ <20><> <20>ப<EFBFBD><E0AEAA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
@@:
|
||||
cmp ted_drag_m,0
|
||||
je .no_in_wnd
|
||||
mov ted_drag_m,0
|
||||
@@ -3718,7 +3809,9 @@ endp
|
||||
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢥<EFBFBD><EBA2A5><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⨨ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
align 4
|
||||
ted_wnd_main_click:
|
||||
push ebx ecx edx
|
||||
push ebx ecx edx
|
||||
mov ebx,ted_el_focus
|
||||
mov dword[ebx],edi ;<3B>⠢<EFBFBD><E2A0A2> 䮪<><E4AEAA>
|
||||
|
||||
push eax
|
||||
shr eax,16
|
||||
@@ -3757,23 +3850,23 @@ ted_wnd_main_click:
|
||||
mov ted_cur_y,eax
|
||||
pop eax
|
||||
|
||||
cmp ted_drag_m,0
|
||||
je @f
|
||||
call ted_sel_move
|
||||
jmp .sel_move
|
||||
@@:
|
||||
mov ted_drag_m,1
|
||||
call ted_sel_start
|
||||
.sel_move:
|
||||
pop edx ecx ebx
|
||||
ret
|
||||
cmp ted_drag_m,0
|
||||
je @f
|
||||
call ted_sel_move
|
||||
jmp .sel_move
|
||||
@@:
|
||||
mov ted_drag_m,1
|
||||
call ted_sel_start
|
||||
.sel_move:
|
||||
pop edx ecx ebx
|
||||
ret
|
||||
|
||||
;input:
|
||||
; edi = pointer to tedit struct
|
||||
align 4
|
||||
ted_wnd_main_mouse_scroll:
|
||||
push eax ebx ecx
|
||||
mcall 37,7
|
||||
mcall 37,7 ;<3B>ப<EFBFBD><E0AEAA>⪠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
cmp ax,0
|
||||
je .no_scroll
|
||||
mov ecx,ted_scr_w
|
||||
@@ -3782,16 +3875,16 @@ ted_wnd_main_mouse_scroll:
|
||||
btr ax,15
|
||||
jae @f
|
||||
or eax,0xffff8000
|
||||
@@:
|
||||
add dword[ecx+sb_offs_position],eax
|
||||
@@:
|
||||
add dword[ecx+sb_offs_position],eax
|
||||
|
||||
mov eax,[ecx+sb_offs_position]
|
||||
cmp eax,[ecx+sb_offs_max_area]
|
||||
jb @f
|
||||
mov dword[ecx+sb_offs_position],ebx ;if scroll position out of range
|
||||
jmp .no_scroll
|
||||
@@:
|
||||
stdcall ted_draw,edi
|
||||
mov eax,[ecx+sb_offs_position]
|
||||
cmp eax,[ecx+sb_offs_max_area]
|
||||
jb @f
|
||||
mov dword[ecx+sb_offs_position],ebx ;if scroll position out of range
|
||||
jmp .no_scroll
|
||||
@@:
|
||||
stdcall ted_draw,edi
|
||||
.no_scroll:
|
||||
pop ecx ebx eax
|
||||
ret
|
||||
|
Reference in New Issue
Block a user