Subversion Repositories Kolibri OS

Rev

Rev 7576 | Rev 7579 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7576 Rev 7577
Line 232... Line 232...
232
		stdcall ted_show_help_f1,edi
232
		stdcall ted_show_help_f1,edi
233
		jmp .end_key_fun
233
		jmp .end_key_fun
234
	@@:
234
	@@:
235
	cmp ah,KEY_F3 ;[F3]
235
	cmp ah,KEY_F3 ;[F3]
236
	jne @f
236
	jne @f
237
		stdcall ted_but_find_next,edi
237
		stdcall ted_but_find,edi,0
238
		jmp .end_key_fun
238
		jmp .end_key_fun
239
	@@:
239
	@@:
Line 240... Line 240...
240
 
240
 
241
	test esi,KM_CTRL ;Ctrl+...
241
	test esi,KM_CTRL ;Ctrl+...
Line 1849... Line 1849...
1849
; ted_gp_opt = 1 if found text line
1849
; ted_gp_opt = 1 if found text line
1850
; ted_gp_opt = 2 if found text line and column
1850
; ted_gp_opt = 2 if found text line and column
1851
; edx = tex[1] if error
1851
; edx = tex[1] if error
1852
; ted_gp_opt = 0 if text no found
1852
; ted_gp_opt = 0 if text no found
1853
align 16
1853
align 16
1854
ted_get_pos_by_coords:
1854
proc ted_get_pos_by_coords uses eax ebx 
1855
  push eax ;Row
-
 
1856
  push ebx ;Col
-
 
1857
 
-
 
1858
  xor eax,eax
1855
	xor eax,eax ;Row
1859
  xor ebx,ebx
1856
	xor ebx,ebx ;Col
1860
  mov ted_gp_opt,0
1857
  mov ted_gp_opt,0
1861
  mov edx,ted_tex
1858
  mov edx,ted_tex
1862
  @@:
1859
  @@:
1863
    call ted_iterat_next
1860
    call ted_iterat_next
1864
    cmp edx,ted_tex_1
1861
    cmp edx,ted_tex_1
Line 1886... Line 1883...
1886
  cmp ted_gp_opt,0
1883
  cmp ted_gp_opt,0
1887
  jne @f
1884
  jne @f
1888
    mov edx,ted_tex_1
1885
    mov edx,ted_tex_1
1889
    ;call ted_get_text_perv_pos
1886
    ;call ted_get_text_perv_pos
1890
  @@:
1887
  @@:
1891
  pop ebx eax
-
 
1892
  ret
1888
  ret
1893
 
1889
endp
Line 1894... Line 1890...
1894
 
1890
 
1895
;input:
1891
;input:
1896
; eax = Row
1892
; eax = Row
1897
; edi = pointer to tedit struct
1893
; edi = pointer to tedit struct
Line 2060... Line 2056...
2060
align 16
2056
align 16
2061
ted_go_to_pos:
2057
ted_go_to_pos:
2062
	push eax ebx
2058
	push eax ebx
2063
	mov eax,ted_scr_h
2059
	mov eax,ted_scr_h
2064
	sub ecx,[eax+sb_offs_position]
2060
	sub ecx,[eax+sb_offs_position]
2065
	cmp ecx,0 ;ted_cur_y < 0
2061
	cmp ecx,0 ;ted_cur_x < 0
2066
	jge @f
2062
	jge @f
2067
		add [eax+sb_offs_position],ecx ;¯à®ªàã⪠ áªà®««¨­£  ¢«¥¢®
2063
		add [eax+sb_offs_position],ecx ;¯à®ªàã⪠ áªà®««¨­£  ¢«¥¢®
2068
		xor ecx,ecx
2064
		xor ecx,ecx
2069
	@@:
2065
	@@:
2070
	mov ebx,5 ;5 - ¦¥« ¥¬ë© ®âáâ㯠᫥¢ 
2066
	mov ebx,5 ;5 - ¦¥« ¥¬ë© ®âáâ㯠᫥¢ 
Line 2837... Line 2833...
2837
 
2833
 
2838
;description:
2834
;description:
2839
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
2835
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
2840
;input:
2836
;input:
2841
; f_opt = ¯ à ¬¥âàë ¯®¨áª :
2837
; f_opt = ¯ à ¬¥âàë ¯®¨áª :
-
 
2838
;   (0 - ¨áª âì ­¨¦¥ ªãàá®à , 1 - ¨áª âì ¢ëè¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
-
 
2839
;   ¥á«¨ ãáâ ­®¢«¥­ 31-© ¡¨â, â® ­¥ ®¡­®¢«ï¥âáï ®ª­®
-
 
2840
;output:
2842
;   (0 - ¨áª âì ¢ëè¥ ªãàá®à , 1 - ¨áª âì ­¨¦¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
2841
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2843
align 16
2842
align 16
2844
proc ted_but_find, edit:dword, f_opt:dword
2843
proc ted_but_find uses ebx ecx edx edi esi, edit:dword, f_opt:dword
2845
	push [edit]
2844
	push [edit]
2846
	cmp dword[f_opt],2
2845
	cmp word[f_opt],2
2847
	jne @f
2846
	jne @f
2848
		call ted_but_find_first
2847
		call _but_find_first
2849
		jmp .end_f
2848
		jmp .end0
2850
	@@:
2849
	@@:
2851
	cmp dword[f_opt],0
2850
	cmp word[f_opt],0
2852
	jne @f
2851
	jne @f
2853
		call ted_but_find_next
2852
		call _but_find_next
2854
		jmp .end_f
2853
		jmp .end0
2855
	@@:
2854
	@@:
2856
	cmp dword[f_opt],1
2855
	cmp word[f_opt],1
2857
	jne .end_f
2856
	jne .end0
-
 
2857
		call _but_find_perv
-
 
2858
	.end0:
-
 
2859
 
-
 
2860
	bt dword[f_opt],31
-
 
2861
	jc .end1
-
 
2862
	or eax,eax
-
 
2863
	jz @f
-
 
2864
		;⥪áâ ­ ©¤¥­, ®¡­®¢«ï¥¬ ®ª­®
-
 
2865
		stdcall ted_draw,edi
-
 
2866
		jmp .end1
-
 
2867
	@@:
-
 
2868
		;⥪áâ ­¥ ­ ©¤¥­, ¯à®¡ã¥¬ ¢ë§¢ âì á®®¡é¥­¨¥
-
 
2869
		cmp ted_fun_find_err,0
-
 
2870
		je .end1
2858
		call ted_but_find_perv
2871
			call ted_fun_find_err ;¯®«ì§®¢ â¥«ì᪠ï äã­ªæ¨ï
2859
	.end_f:
2872
	.end1:
2860
	ret
2873
	ret
Line 2861... Line 2874...
2861
endp
2874
endp
2862
 
2875
 
-
 
2876
;description:
2863
;description:
2877
; äã­ªæ¨ï ­ å®¤¨â ⥪á⠮⠭ ç «  ä ©« , ¨«¨ ®â ª®­æ  ⥪ã饣® ¢ë¤¥«¥­¨ï
-
 
2878
;output:
2864
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
2879
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2865
; ¨é¥â ®â ­ ç «  ä ©« , ¨«¨ ®â ª®­æ  ⥪ã饣® ¢ë¤¥«¥­¨ï
2880
; ebx, ecx, edx, edi, edi - ¯®àâïâáï
2866
align 16
-
 
2867
proc ted_but_find_first, edit:dword
2881
align 16
Line 2868... Line 2882...
2868
	pushad
2882
proc _but_find_first, edit:dword
2869
	mov edi,[edit]
2883
	mov edi,[edit]
2870
 
2884
 
Line 2890... Line 2904...
2890
			call ted_iterat_next
2904
			call ted_iterat_next
2891
			cmp edx,ted_tex_1
2905
			cmp edx,ted_tex_1
2892
			jle @f
2906
			jle @f
2893
			jmp @b
2907
			jmp @b
2894
	@@:
2908
	@@:
2895
	call but_find
2909
	call _but_find_select
2896
	popad
-
 
2897
	ret
2910
	ret
2898
endp
2911
endp
Line 2899... Line 2912...
2899
 
2912
 
2900
;description:
2913
;description:
-
 
2914
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ¢ëè¥ ªãàá®à 
-
 
2915
;output:
2901
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
2916
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2902
; ¨é¥â ¢ëè¥ ªãàá®à 
2917
; ebx, ecx, edx, edi, edi - ¯®àâïâáï
2903
align 16
2918
align 16
2904
proc ted_but_find_perv, edit:dword
-
 
2905
	pushad
2919
proc _but_find_perv, edit:dword
2906
	mov edi,[edit]
2920
	mov edi,[edit]
2907
	call ted_is_select
2921
	call ted_is_select
2908
	or al,al
2922
	or al,al
2909
	jz @f
2923
	jz @f
Line 2926... Line 2940...
2926
			call ted_iterat_perv
2940
			call ted_iterat_perv
2927
			cmp edx,ted_tex_1
2941
			cmp edx,ted_tex_1
2928
			jle @f
2942
			jle @f
2929
			jmp @b
2943
			jmp @b
2930
	@@:
2944
	@@:
2931
	call but_find
2945
	call _but_find_select
2932
	popad
-
 
2933
	ret
2946
	ret
2934
endp
2947
endp
Line 2935... Line 2948...
2935
 
2948
 
2936
;description:
2949
;description:
-
 
2950
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­¨¦¥ ªãàá®à 
-
 
2951
;output:
2937
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
2952
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2938
; ¨é¥â ­¨¦¥ ªãàá®à 
2953
; ebx, edx, edi, esi - ¯®àâïâáï
2939
align 16
2954
align 16
2940
proc ted_but_find_next, edit:dword
-
 
2941
	pushad
2955
proc _but_find_next, edit:dword
Line 2942... Line 2956...
2942
	mov edi,[edit]
2956
	mov edi,[edit]
2943
 
2957
 
2944
	call ted_get_pos_by_cursor
2958
	call ted_get_pos_by_cursor
Line 2951... Line 2965...
2951
			call ted_iterat_next
2965
			call ted_iterat_next
2952
			cmp edx,ted_tex_1
2966
			cmp edx,ted_tex_1
2953
			jle @f
2967
			jle @f
2954
			jmp @b
2968
			jmp @b
2955
	@@:
2969
	@@:
2956
	call but_find
2970
	call _but_find_select
2957
	popad
-
 
2958
	ret
2971
	ret
2959
endp
2972
endp
Line -... Line 2973...
-
 
2973
 
-
 
2974
;description:
2960
 
2975
; ¢á¯®¬®£ â¥«ì­ ï äã­ªæ¨ï, ¢ë¤¥«ï¥â ­ ©¤¥­­ë© ⥪áâ
2961
;input:
2976
;input:
2962
; bh = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2977
; bh = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2963
; esi = first symbol pointer
2978
; esi = first symbol pointer
2964
align 16
2979
align 16
2965
but_find:
2980
_but_find_select:
2966
	or bh,bh
2981
	or bh,bh
2967
	jz @f
2982
	jz @f
2968
		call ted_get_text_coords
2983
		call ted_get_text_coords
2969
		inc ebx ;move cursor right
2984
		inc ebx ;move cursor right
Line 2974... Line 2989...
2974
		call ted_go_to_pos
2989
		call ted_go_to_pos
2975
		mov edx,esi
2990
		mov edx,esi
2976
		call ted_get_text_coords
2991
		call ted_get_text_coords
2977
		mov ted_sel_x0,ebx
2992
		mov ted_sel_x0,ebx
2978
		mov ted_sel_y0,eax
2993
		mov ted_sel_y0,eax
2979
		stdcall ted_draw,edi
2994
		xor eax,eax
-
 
2995
		inc eax
2980
		jmp .end_find
2996
		jmp .end0
2981
	@@:
2997
	@@:
2982
		;¯®¯ ¤ ¥¬ á ¥á«¨ ⥪áâ ­¥ ­ ©¤¥­
2998
		xor eax,eax ;⥪áâ ­¥ ­ ©¤¥­
2983
		cmp ted_fun_find_err,0
-
 
2984
		je .end_find
-
 
2985
			call ted_fun_find_err ;¯®«ì§®¢ â¥«ì᪠ï äã­ªæ¨ï
-
 
2986
	.end_find:
2999
	.end0:
2987
	ret
3000
	ret
Line 2988... Line 3001...
2988
 
3001
 
2989
;input:
3002
;input:
2990
; rpl_text = ⥪áâ ¤«ï § ¬¥­ë
3003
; rpl_text = ⥪áâ ¤«ï § ¬¥­ë
2991
; r_opt = ¯ à ¬¥âàë ¯®¨áª :
3004
; r_opt = ¯ à ¬¥âàë ¯®¨áª :
2992
;   (0 - ¨áª âì ¢ëè¥ ªãàá®à , 1 - ¨áª âì ­¨¦¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
3005
;   (0 - ¨áª âì ­¨¦¥ ªãàá®à , 1 - ¨áª âì ¢ëè¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
2993
; n_tim = 䨪á¨à®¢ âì § ¬¥­ã ¢ ¨§¬¥­¥­¨ïå (0 - ­¥â, 1 - ¤ )
3006
; n_tim = 䨪á¨à®¢ âì § ¬¥­ã ¢ ¨§¬¥­¥­¨ïå (0 - ­¥â, 1 - ¤ )
2994
;output:
3007
;output:
2995
; eax = 0 - ­¥ 㤠筮, 1 - 㤠筮
3008
; eax = 0 - ­¥ 㤠筮, 1 - 㤠筮
2996
align 16
3009
align 16
2997
proc ted_but_replace uses edx edi esi, edit:dword, rpl_text:dword, r_opt:dword, n_tim:dword
3010
proc ted_but_replace uses edx edi esi, edit:dword, rpl_text:dword, r_opt:dword, n_tim:dword
-
 
3011
	mov edi,[edit]
-
 
3012
	mov eax,[r_opt]
2998
	mov edi,[edit]
3013
	bts eax,31
-
 
3014
	stdcall ted_but_find, edi,eax
-
 
3015
	or eax,eax
Line 2999... Line 3016...
2999
	stdcall ted_but_find, edi,[r_opt]
3016
	jz .end0
3000
 
3017
 
3001
	xor edx,edx
3018
	xor edx,edx
-
 
3019
	cmp dword[n_tim],0
3002
	cmp dword[n_tim],0
3020
	je @f
3003
	je @f
3021
		call ted_set_undo
3004
		mov edx,ted_opt_ed_change_time
3022
		mov edx,ted_opt_ed_change_time
3005
	@@:
3023
	@@:
3006
	stdcall ted_sel_text_del, edx
3024
	stdcall ted_sel_text_del, edx
3007
	or eax,0xff
3025
	or eax,0xff
3008
	jz @f
3026
	jz .end0
3009
		mov esi,[rpl_text]
3027
		mov esi,[rpl_text]
3010
		stdcall tl_strlen
3028
		stdcall tl_strlen
3011
		or eax,eax
3029
		or eax,eax
3012
		jz @f
3030
		jz .end0
3013
		stdcall ted_text_add, edi,esi,eax,ted_opt_ed_move_cursor
3031
		stdcall ted_text_add, edi,esi,eax,ted_opt_ed_move_cursor
3014
		xor eax,eax
3032
		xor eax,eax
3015
		inc eax
3033
		inc eax
3016
	@@:
3034
	.end0:
Line 3017... Line 3035...
3017
	ret
3035
	ret
-
 
3036
endp
-
 
3037
 
-
 
3038
;input:
-
 
3039
; eax - text need find
-
 
3040
; bl - first symbol to find
-
 
3041
; edx - first symbol pointer
-
 
3042
; edi - pointer to tedit struct
-
 
3043
;output:
-
 
3044
; bh - rezult
-
 
3045
; edx - last text position (if find sucess)
-
 
3046
; esi - first symbol pointer
-
 
3047
;description:
-
 
3048
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax
-
 
3049
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
-
 
3050
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
-
 
3051
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
-
 
3052
align 16
-
 
3053
ted_get_find_rezult:
-
 
3054
push eax
-
 
3055
	mov bh,1
-
 
3056
	mov esi,edx ;copy edx
-
 
3057
	@@:
-
 
3058
		cmp byte[edx],bl
-
 
3059
		jne .no_text
-
 
3060
 
-
 
3061
		inc eax ;*** get next symbol (in find text) ***
-
 
3062
		mov bl,byte[eax]
-
 
3063
		or bl,bl
-
 
3064
		jz @f ;end of find text
-
 
3065
 
-
 
3066
		call ted_iterat_next ;*** get next symbol (in editor text) ***
-
 
3067
		cmp edx,ted_tex_1
-
 
3068
		jg @b
-
 
3069
align 4
-
 
3070
		.no_text:
-
 
3071
	xor bh,bh
-
 
3072
	mov edx,esi ;restore edx
-
 
3073
	@@:
-
 
3074
pop eax
-
 
3075
	mov bl,byte[eax] ;restore bl
3018
endp
3076
	ret
3019
 
3077
 
3020
;input:
3078
;input:
3021
; edi = pointer to tedit struct
3079
; edi = pointer to tedit struct
3022
align 16
3080
align 16
Line 3833... Line 3891...
3833
popad
3891
popad
3834
	ret
3892
	ret
3835
endp
3893
endp
Line 3836... Line 3894...
3836
 
3894
 
3837
;input:
-
 
3838
; eax - text need find
-
 
3839
; bl - first symbol to find
-
 
3840
; edx - first symbol pointer
-
 
3841
; edi - pointer to tedit struct
-
 
3842
;output:
-
 
3843
; bh - rezult
-
 
3844
; edx - last text position (if find sucess)
-
 
3845
; esi - first symbol pointer
-
 
3846
;description:
-
 
3847
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax
-
 
3848
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
-
 
3849
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
-
 
3850
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
-
 
3851
align 16
-
 
3852
ted_get_find_rezult:
-
 
3853
push eax
-
 
3854
	mov bh,1
-
 
3855
	mov esi,edx ;copy edx
-
 
3856
	@@:
-
 
3857
		cmp byte[edx],bl
-
 
3858
		jne .no_text
-
 
3859
 
-
 
3860
		inc eax ;*** get next symbol (in find text) ***
-
 
3861
		mov bl,byte[eax]
-
 
3862
		or bl,bl
-
 
3863
		jz @f ;end of find text
-
 
3864
 
-
 
3865
		call ted_iterat_next ;*** get next symbol (in editor text) ***
-
 
3866
		cmp edx,ted_tex_1
-
 
3867
		jle @f ;end of editor text
-
 
3868
 
-
 
3869
		jmp @b
-
 
3870
align 4
-
 
3871
		.no_text:
-
 
3872
	xor bh,bh
-
 
3873
	mov edx,esi ;restore edx
-
 
3874
	@@:
-
 
3875
pop eax
-
 
3876
	mov bl,byte[eax] ;restore bl
-
 
3877
	ret
-
 
3878
 
-
 
3879
;input:
3895
;input:
3880
;  clear_o - ¥á«¨ =1 ®ç¨áâ¨âì ®¤­ã áâபã, =0 ®ç¨áâ¨âì ¢á¥ áâப¨ ®ª­  ¤® ­¨§ã
3896
;  clear_o - ¥á«¨ =1 ®ç¨áâ¨âì ®¤­ã áâபã, =0 ®ç¨áâ¨âì ¢á¥ áâப¨ ®ª­  ¤® ­¨§ã
3881
align 16
3897
align 16
3882
proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
3898
proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
3883
	pushad
3899
	pushad