1,6 → 1,6 |
; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj |
; í«¥¬¥â TextEditor ¤«ï Kolibri OS |
; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 29.04.2010 IgorA |
; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 03.05.2010 IgorA |
; ª®¤ ¯à¨¬¥¥ GPL2 «¨æ¥§¨ï |
|
;input: |
54,6 → 54,8 |
ends |
;------------------------------------------------------------------------------ |
|
ted_symbol_tab db 26 |
|
if lang eq ru |
|
txtFindCapt db '®¨áª',0 |
80,7 → 82,7 |
|
;------ |
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 |
168,11 → 170,76 |
add eax,1024 |
mov ted_syntax_file,eax |
|
stdcall ted_init_scroll_bars,edi,3 |
pop edi ecx eax |
ret |
endp |
|
MIN_W_SCRL_ARE equ 3 ;¬¨¨¬ «ì ï ®â®¡à ¦ ¥¬ ï ®¡« áâì ¤«ï ¢¥àâ. áªà®««¨£ |
MIN_H_SCRL_ARE equ 3 ;¬¨¨¬ «ì ï ®â®¡à ¦ ¥¬ ï ®¡« áâì ¤«ï £®à¨§. áªà®««¨£ |
;input: |
; opt = 1 - ¬¥ïâì 梥â áªà®««¨£®¢, 2 - ¬¥ïâì ¢¥è¨¥ à §¬¥àë |
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 ;¢ëáâ ¢«ï¥¬ «¥¢ë© ®âáâ㯠£®à¨§. áªà®««¨£ |
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 ;¢ëáâ ¢«ï¥¬ ¢¥à娩 ®âáâ㯠£®à¨§. áªà®««¨£ |
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 ;«¥¢ë© ®âáâ㯠®ª |
add edx,eax ;¤®¡ ¢«ï¥¬ è¨à¨ã ®ª |
mov word[esi+sb_offs_start_x],dx ;¢ëáâ ¢«ï¥¬ «¥¢ë© ®âáâ㯠¢¥àâ. áªà®««¨£ |
mov edx,ted_wnd_t |
mov word[esi+sb_offs_start_y],dx ;¢ëáâ ¢«ï¥¬ ¢¥à娩 ®âáâ㯠¢¥àâ. áªà®««¨£ |
mov edx,ted_wnd_h |
mov word[esi+sb_offs_size_y],dx ;¢ëáâ ¢«ï¥¬ ¢ëá®âã ¢¥àâ. áªà®««¨£ |
sub eax,ted_rec_l |
mov word[ebx+sb_offs_size_x],ax ;¢ëáâ ¢«ï¥¬ è¨à¨ã £®à¨§. áªà®««¨£ |
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 ;ãáâ ¢«¨¢ ¥¬ ç¨á«® ᨬ¢®«®¢, ª®â®àë¥ ¢« §ïâ ¢ íªà ¤«ï £®à¨§. áªà®««¨£ |
.no_size: |
popad |
ret |
endp |
|
align 4 |
proc ted_delete, edit:dword |
push ecx edi |
mov edi,dword[edit] |
193,6 → 260,9 |
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 ;í«¥¬¥â ¥ ¢ 䮪ãᥠ¢ë室¨¬ ¨§ äãªæ¨¨ |
mov esi,dword[control] |
|
cmp ah,KEY_F1 ;[F1] |
214,6 → 284,12 |
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 |
607,11 → 683,11 |
|
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 ;ç¨á«® áâப ¢¨¤¨¬ëå ¢ ®¢®¬ ¤®ªã¬¥â¥ |
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 ;ç¨á«® ᨬ¢®«®¢ ¢¨¤¨¬ëå ¢ ®¢®¬ ¤®ªã¬¥â¥ |
|
mov ted_sel_x0,0 |
mov ted_sel_y0,0 |
724,6 → 800,7 |
add ecx,ted_key_words_data |
mov ted_help_text_f1,ecx |
|
stdcall ted_init_scroll_bars,edi,1 ;¬¥ï¥¬ 梥â áªà®««¨£®¢ |
.no_colors: |
popad |
ret |
2806,12 → 2883,17 |
align 4 |
ted_convert_invis_symb: |
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: |
3086,7 → 3168,8 |
je @f |
mov ecx,ted_tim_undo |
add edx,0x500000 |
int 0x40 |
mov edi,ted_color_wnd_work ;¯®à⨬ ॣ¨áâà edi, ® ¢ ª®æ¥ äãªæ¨¨ í⮠㦥 ¥ ¢ ¦® |
int 0x40 ;¢ë¢®¤ ç¨á« ®â¬¥¥ëå ¤¥©á⢨© |
@@: |
|
popad |
3101,9 → 3184,12 |
mov eax,ted_buffer |
cmp byte[eax],0 ;ᬮâਬ 1-© ᨬ¢®« ¨§ ¡ãä¥à |
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 ;áà ¢¨¢ ¥¬ ª®®à¤¨ âã ¤«ï ¢ë¢®¤ ⥪áâ |
jge @f ;¯®¤¯¨áì ¥ ¢« §¨â ¢ ®ª® |
|
add ebx,ted_wnd_l |
shl ebx,16 |
add ebx,ted_wnd_t |
add ebx,3 |
3142,7 → 3228,8 |
align 4 |
proc ted_draw_help_f1 |
pushad |
|
cmp ted_rec_t,13 ;¬¨¨¬ «ì ï ¢ëá®â ¤«ï à¨á®¢ ¨ï á¯à ¢ª¨ |
jle @f |
mov eax,13 ;clear place before draw help |
mov ebx,ted_wnd_l |
add ebx,ted_rec_l |
3698,7 → 3785,11 |
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 ;ᬮâਬ ¯à®ªàãâªã ª®«¥á ¬ëè¨ |
@@: |
cmp ted_drag_m,0 |
je .no_in_wnd |
mov ted_drag_m,0 |
3719,6 → 3810,8 |
align 4 |
ted_wnd_main_click: |
push ebx ecx edx |
mov ebx,ted_el_focus |
mov dword[ebx],edi ;áâ ¢¨¬ 䮪ãá |
|
push eax |
shr eax,16 |
3773,7 → 3866,7 |
align 4 |
ted_wnd_main_mouse_scroll: |
push eax ebx ecx |
mcall 37,7 |
mcall 37,7 ;¯à®ªàã⪠ª®«¥á ¬ëè¨ |
cmp ax,0 |
je .no_scroll |
mov ecx,ted_scr_w |