Subversion Repositories Kolibri OS

Rev

Rev 7570 | Rev 7573 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7570 Rev 7571
1
struct symbol
1
struct symbol
2
	c db ?    ; +0 ᨬ¢®«
2
	c db ?    ; +0 ᨬ¢®«
3
	col db ?  ; +1 梥â
3
	col db ?  ; +1 梥â
4
	perv dd ? ; +2
4
	perv dd ? ; +2
5
	next dd ? ; +6 㪠§ â¥«¨
5
	next dd ? ; +6 㪠§ â¥«¨
6
	tc dd ?   ;+10 ¢à¥¬. ᮧ¤ ­¨ï
6
	tc dd ?   ;+10 ¢à¥¬. ᮧ¤ ­¨ï
7
	td dd ?   ;+14 ¢à¥¬. 㤠«¥­¨ï
7
	td dd ?   ;+14 ¢à¥¬. 㤠«¥­¨ï
8
ends
8
ends
9
 
9
 
10
bmp_icon dd 0
10
bmp_icon dd 0
11
 
11
 
12
 
12
 
13
;input:
13
;input:
14
; al = ª®¤ ®è¨¡ª¨
14
; al = ª®¤ ®è¨¡ª¨
15
align 4
15
align 4
16
ted_on_init_synt_err:
16
ted_on_init_synt_err:
17
	mov byte[msgbox_3.err],'0'
17
	mov byte[msgbox_3.err],'0'
18
	add byte[msgbox_3.err],al
18
	add byte[msgbox_3.err],al
19
	stdcall [mb_create],msgbox_3,thread ;message: Can-t open color options file!
19
	stdcall [mb_create],msgbox_3,thread ;message: Can-t open color options file!
20
	ret
20
	ret
21
 
21
 
22
 
22
 
23
align 4
23
align 4
24
ted_but_new_file:
24
ted_but_new_file:
25
	push eax ebx
25
	push eax ebx
26
	stdcall [ted_can_save], tedit0
26
	stdcall [ted_can_save], tedit0
27
	cmp al,1
27
	cmp al,1
28
	jne @f
28
	jne @f
29
		stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
29
		stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
30
		stdcall [mb_setfunctions],msgbox_2N_funct
30
		stdcall [mb_setfunctions],msgbox_2N_funct
31
		jmp .ret_f
31
		jmp .ret_f
32
	@@:
32
	@@:
33
	call On_NewFile
33
	call On_NewFile
34
	.ret_f:
34
	.ret_f:
35
		mov byte[openfile_path],0
35
		mov byte[openfile_path],0
36
		mcall SF_SET_CAPTION,1,hed
36
		mcall SF_SET_CAPTION,1,hed
37
	pop ebx eax
37
	pop ebx eax
38
	ret
38
	ret
39
 
39
 
40
align 4
40
align 4
41
On_NewFile:
41
On_NewFile:
42
	stdcall [ted_clear], tedit0,1
42
	stdcall [ted_clear], tedit0,1
43
	call draw_but_toolbar
43
	call draw_but_toolbar
44
	stdcall [ted_draw], tedit0
44
	stdcall [ted_draw], tedit0
45
	mov dword[openfile_path],0
45
	mov dword[openfile_path],0
46
	ret
46
	ret
47
 
47
 
48
align 4
48
align 4
49
On_SaveAndNewFile:
49
On_SaveAndNewFile:
50
	push edi
50
	push edi
51
	mov edi, tedit0
51
	mov edi, tedit0
52
 
52
 
53
	call ted_but_save_file
53
	call ted_but_save_file
54
	cmp ted_err_save,0
54
	cmp ted_err_save,0
55
	jne @f
55
	jne @f
56
		call On_NewFile
56
		call On_NewFile
57
	@@:
57
	@@:
58
	pop edi
58
	pop edi
59
	ret
59
	ret
60
 
60
 
61
align 4
61
align 4
62
On_SaveAndOpenFile:
62
On_SaveAndOpenFile:
63
	push edi
63
	push edi
64
	mov edi, tedit0
64
	mov edi, tedit0
65
 
65
 
66
	call ted_but_save_file
66
	call ted_but_save_file
67
	cmp ted_err_save,0
67
	cmp ted_err_save,0
68
	jne @f
68
	jne @f
69
		call ted_but_open_file.no_msg
69
		call ted_but_open_file.no_msg
70
	@@:
70
	@@:
71
	pop edi
71
	pop edi
72
	ret
72
	ret
73
 
73
 
74
align 4
74
align 4
75
On_SaveAndExit:
75
On_SaveAndExit:
76
	push edi
76
	push edi
77
	mov edi, tedit0
77
	mov edi, tedit0
78
 
78
 
79
	call ted_but_save_file
79
	call ted_but_save_file
80
	cmp ted_err_save,0
80
	cmp ted_err_save,0
81
	jne @f
81
	jne @f
82
		mov dword[exit_code],1
82
		mov dword[exit_code],1
83
	@@:
83
	@@:
84
	pop edi
84
	pop edi
85
	ret
85
	ret
86
 
86
 
87
align 4
87
align 4
88
On_Exit:
88
On_Exit:
89
	mov dword[exit_code],1
89
	mov dword[exit_code],1
90
	ret
90
	ret
91
 
91
 
92
;description:
92
;description:
93
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ¡¥§ ®ª­  á®®¡é¥­¨ï
93
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ¡¥§ ®ª­  á®®¡é¥­¨ï
94
align 4
94
align 4
95
proc but_no_msg_OpenFile uses eax ebx esi
95
proc but_no_msg_OpenFile uses eax ebx esi
96
	stdcall [ted_open_file], tedit0,run_file_70,openfile_path
96
	stdcall [ted_open_file], tedit0,run_file_70,openfile_path
97
	call ted_messages_after_open_file
97
	call ted_messages_after_open_file
98
 
98
 
99
	mov esi,openfile_path
99
	mov esi,openfile_path
100
	call strlen
100
	call strlen
101
	add esi,eax
101
	add esi,eax
102
	@@: ;横« ¤«ï ¯®¨áª  ­ ç «  ¨¬¥­¨ ä ©« 
102
	@@: ;横« ¤«ï ¯®¨áª  ­ ç «  ¨¬¥­¨ ä ©« 
103
		dec esi
103
		dec esi
104
		cmp byte[esi],'/'
104
		cmp byte[esi],'/'
105
		je @f
105
		je @f
106
		cmp byte[esi],0x5c ;'\'
106
		cmp byte[esi],0x5c ;'\'
107
		je @f
107
		je @f
108
		cmp esi,openfile_path
108
		cmp esi,openfile_path
109
		jg @b
109
		jg @b
110
	@@:
110
	@@:
111
	inc esi
111
	inc esi
112
	call strlen
112
	call strlen
113
	cmp eax,255
113
	cmp eax,255
114
	jle @f
114
	jle @f
115
		mov eax,255
115
		mov eax,255
116
	@@:
116
	@@:
117
	inc eax ;¤«ï 0 ¢ ª®­æ¥ áâப¨
117
	inc eax ;¤«ï 0 ¢ ª®­æ¥ áâப¨
118
	stdcall mem_cpy, filename_area,esi,eax ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¤¨ «®£ á®åà ­¥­¨ï
118
	stdcall mem_cpy, filename_area,esi,eax ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¤¨ «®£ á®åà ­¥­¨ï
119
	ret
119
	ret
120
endp
120
endp
121
 
121
 
122
;description:
122
;description:
123
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
123
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
124
align 4
124
align 4
125
ted_but_open_file:
125
ted_but_open_file:
126
	pushad
126
	pushad
127
 
127
 
128
	stdcall [ted_can_save], tedit0
128
	stdcall [ted_can_save], tedit0
129
	cmp al,1
129
	cmp al,1
130
	jne @f
130
	jne @f
131
		stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
131
		stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
132
		stdcall [mb_setfunctions],msgbox_2O_funct
132
		stdcall [mb_setfunctions],msgbox_2O_funct
133
		jmp .ret_f
133
		jmp .ret_f
134
	.no_msg: ;¬¥âª  ¤«ï ¢ë§®¢  ä㭪樨 ç¥à¥§ ª­®¯ªã ¢ á®®¡é¥­¨¨ msgbox_5
134
	.no_msg: ;¬¥âª  ¤«ï ¢ë§®¢  ä㭪樨 ç¥à¥§ ª­®¯ªã ¢ á®®¡é¥­¨¨ msgbox_5
135
		pushad
135
		pushad
136
	@@:
136
	@@:
137
 
137
 
138
	copy_path open_dialog_name,communication_area_default_path,file_name,0
138
	copy_path open_dialog_name,communication_area_default_path,file_name,0
139
	mov [OpenDialog_data.type],0
139
	mov [OpenDialog_data.type],0
140
	stdcall [OpenDialog_Start],OpenDialog_data
140
	stdcall [OpenDialog_Start],OpenDialog_data
141
	cmp [OpenDialog_data.status],2
141
	cmp [OpenDialog_data.status],2
142
	jne @f
142
	jne @f
143
		stdcall mem_spac, msgbox_9.fdp,100
143
		stdcall mem_spac, msgbox_9.fdp,100
144
		mov esi,file_name
144
		mov esi,file_name
145
		call strlen
145
		call strlen
146
		cmp eax,100
146
		cmp eax,100
147
		jle .no_crop
147
		jle .no_crop
148
			mov eax,100
148
			mov eax,100
149
		.no_crop:
149
		.no_crop:
150
		stdcall mem_cpy, msgbox_9.fdp,esi,eax
150
		stdcall mem_cpy, msgbox_9.fdp,esi,eax
151
		stdcall [mb_create],msgbox_9,thread ;message: error run 'open file dialog'
151
		stdcall [mb_create],msgbox_9,thread ;message: error run 'open file dialog'
152
		jmp .ret_f
152
		jmp .ret_f
153
	@@:
153
	@@:
154
	cmp [OpenDialog_data.status],1
154
	cmp [OpenDialog_data.status],1
155
	jne .ret_f
155
	jne .ret_f
156
		stdcall auto_open_syntax,[OpenDialog_data.openfile_path]
156
		stdcall auto_open_syntax,[OpenDialog_data.openfile_path]
157
		stdcall [ted_open_file], tedit0,run_file_70,openfile_path
157
		stdcall [ted_open_file], tedit0,run_file_70,openfile_path
158
		call ted_messages_after_open_file
158
		call ted_messages_after_open_file
159
	.ret_f:
159
	.ret_f:
160
	popad
160
	popad
161
	ret
161
	ret
162
 
162
 
163
proc auto_open_syntax, of_path:dword
163
proc auto_open_syntax, of_path:dword
164
pushad
164
pushad
165
	;¨é¥¬ ¥áâì «¨ ä ©« ¯®¤á¢¥âª¨ ¤«ï ®âªà뢠¥¬®£® ⥪á⮢®£® ä ©« 
165
	;¨é¥¬ ¥áâì «¨ ä ©« ¯®¤á¢¥âª¨ ¤«ï ®âªà뢠¥¬®£® ⥪á⮢®£® ä ©« 
166
	mov esi,[of_path]
166
	mov esi,[of_path]
167
	call strlen
167
	call strlen
168
	mov edx,[of_path]
168
	mov edx,[of_path]
169
	add edx,eax
169
	add edx,eax
170
	.f_beg:
170
	.f_beg:
171
	cmp byte[edx],'.'
171
	cmp byte[edx],'.'
172
	je .found
172
	je .found
173
		dec edx
173
		dec edx
174
		cmp edx,[of_path]
174
		cmp edx,[of_path]
175
		jg .f_beg
175
		jg .f_beg
176
	.found:
176
	.found:
177
	inc edx ;edx - 㪠§ â¥«ì ­  à áè¨à¥­¨¥ ®âªàë⮣® ä ©« 
177
	inc edx ;edx - 㪠§ â¥«ì ­  à áè¨à¥­¨¥ ®âªàë⮣® ä ©« 
178
 
178
 
179
	mov ebx,synt_auto_open
179
	mov ebx,synt_auto_open
180
	.cycle_0:
180
	.cycle_0:
181
		add ebx,32
181
		add ebx,32
182
		stdcall strcmp,ebx,edx ;áà ¢­¨¢ ¥¬ à áè¨à¥­¨¥ ®âªàë⮣® ä ©«  á® §­ ç¥­¨ï¬¨ ®âªàëâ묨 á ini ä ©« 
182
		stdcall strcmp,ebx,edx ;áà ¢­¨¢ ¥¬ à áè¨à¥­¨¥ ®âªàë⮣® ä ©«  á® §­ ç¥­¨ï¬¨ ®âªàëâ묨 á ini ä ©« 
183
		test eax,eax
183
		test eax,eax
184
		jz .ok
184
		jz .ok
185
		add ebx,32
185
		add ebx,32
186
		cmp byte[ebx],0
186
		cmp byte[ebx],0
187
		jne .cycle_0
187
		jne .cycle_0
188
	jmp .end_0
188
	jmp .end_0
189
	.ok: ;®âªàë⨥ ä ©«  ¯®¤á¢¥âª¨ ¢ § ¢¨á¨¬®á⨠®â ­ ©¤¥­­®£® à áè¨à¥­¨ï
189
	.ok: ;®âªàë⨥ ä ©«  ¯®¤á¢¥âª¨ ¢ § ¢¨á¨¬®á⨠®â ­ ©¤¥­­®£® à áè¨à¥­¨ï
190
		sub ebx,32
190
		sub ebx,32
191
		stdcall open_unpac_synt_file,ebx
191
		stdcall open_unpac_synt_file,ebx
192
	.end_0:
192
	.end_0:
193
popad
193
popad
194
	ret
194
	ret
195
endp
195
endp
-
 
196
 
-
 
197
;input:
196
 
198
; eax ¥á«¨ à ¢¥­: 0 - á®åà ­¥­¨¥ ¡¥§ ¤¨ «®£ , 1 - á®åà ­¥­¨¥ á ¤¨ «®£®¬
197
;description:
199
;description:
198
; äã­ªæ¨ï á®åà ­¥­¨ï ä ©« 
200
; äã­ªæ¨ï á®åà ­¥­¨ï ä ©« 
199
align 4
201
align 4
200
proc ted_but_save_file
202
proc ted_but_save_file
-
 
203
	or eax,eax
-
 
204
	jnz .init_dlg
201
	;*** ¢ë§®¢ ¤¨ «®£®¢®£® ®ª­  ¤«ï á®åà ­¥­¨ï ä ©« 
205
		; á®å࠭塞 ¡¥§ ¢ë§®¢  ¤¨ «®£®¢®£® ®ª­ 
-
 
206
		cmp byte[openfile_path],0
-
 
207
		jne @f
202
	.init_dlg:
208
	.init_dlg:
-
 
209
		; ¢ë§®¢ ¤¨ «®£®¢®£® ®ª­  ¤«ï á®åà ­¥­¨ï ä ©« 
203
	copy_path open_dialog_name,communication_area_default_path,file_name,0
210
		copy_path open_dialog_name,communication_area_default_path,file_name,0
204
	mov [OpenDialog_data.type],1
211
		mov [OpenDialog_data.type],1
205
	stdcall [OpenDialog_Start],OpenDialog_data
212
		stdcall [OpenDialog_Start],OpenDialog_data
206
	cmp [OpenDialog_data.status],1 ;if status==1 then save
213
		cmp [OpenDialog_data.status],1 ;if status==1 then save
207
	jne .end_save
214
		jne .end_save
208
	jmp @f
-
 
209
	.no_dlg: ; á®å࠭塞 ¡¥§ ¢ë§®¢  ¤¨ «®£®¢®£® ®ª­ 
-
 
210
		cmp byte[openfile_path],0
-
 
211
		je .init_dlg ; ­® ¥á«¨ ¯ãâì ¯ãá⮩ â® ¢á¥-¦¥ ¢ë§ë¢ ¥¬
-
 
212
	@@:
215
	@@:
213
		stdcall [ted_save_file],tedit0,run_file_70,openfile_path
216
		stdcall [ted_save_file],tedit0,run_file_70,openfile_path
214
	.end_save:
217
	.end_save:
215
	ret
218
	ret
216
endp
219
endp
217
 
220
 
218
;description:
221
;description:
219
; ª®¯¨à®¢ ­¨¥ ¯ ¬ïâ¨
222
; ª®¯¨à®¢ ­¨¥ ¯ ¬ïâ¨
220
align 4
223
align 4
221
proc mem_cpy uses ecx esi edi, destination:dword, source:dword, len:dword
224
proc mem_cpy uses ecx esi edi, destination:dword, source:dword, len:dword
222
	cld
225
	cld
223
	mov esi, dword[source]
226
	mov esi,[source]
224
	mov edi, dword[destination]
227
	mov edi,[destination]
225
	mov ecx, dword[len]
228
	mov ecx,[len]
226
	rep movsb
229
	rep movsb
227
	ret
230
	ret
228
endp
231
endp
229
 
232
 
230
;description:
233
;description:
231
; § ¯®«­¥­¨¥ ¯ ¬ï⨠¯à®¡¥« ¬¨
234
; § ¯®«­¥­¨¥ ¯ ¬ï⨠¯à®¡¥« ¬¨
232
align 4
235
align 4
233
proc mem_spac uses eax ecx edi, mem:dword, len:dword
236
proc mem_spac uses eax ecx edi, mem:dword, len:dword
234
	cld
237
	cld
235
	mov al,' '
238
	mov al,' '
236
	mov edi, dword[mem]
239
	mov edi,[mem]
237
	mov ecx, dword[len]
240
	mov ecx,[len]
238
	repne stosb
241
	repne stosb
239
	ret
242
	ret
240
endp
243
endp
241
 
244
 
242
;input:
245
;input:
243
; eax = ª®¤ ®è¨¡ª¨
246
; eax = ª®¤ ®è¨¡ª¨
244
; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ­­ëå ¡ ©â
247
; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ­­ëå ¡ ©â
245
align 4
248
align 4
246
ted_messages_after_open_file:
249
ted_messages_after_open_file:
247
	push ecx edi
250
	push ecx edi
248
	cmp eax,0
251
	cmp eax,0
249
	je @f
252
	je @f
250
	cmp eax,6
253
	cmp eax,6
251
	je @f
254
	je @f
252
		cmp ax,10
255
		cmp ax,10
253
		jl .zifra_0_9
256
		jl .zifra_0_9
254
			mov al,'?'
257
			mov al,'?'
255
			sub ax,48
258
			sub ax,48
256
		.zifra_0_9:
259
		.zifra_0_9:
257
		add ax,48
260
		add ax,48
258
 
261
 
259
		mov byte[msgbox_4.err],al
262
		mov byte[msgbox_4.err],al
260
		stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
263
		stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
261
		jmp .ret_f
264
		jmp .ret_f
262
	@@:
265
	@@:
263
	cmp ebx,-1
266
	cmp ebx,-1
264
	je .ret_f
267
	je .ret_f
265
		;if open file
268
		;if open file
266
		mov edi,tedit0
269
		mov edi,tedit0
267
		mov ecx,ted_max_chars
270
		mov ecx,ted_max_chars
268
		sub ecx,2 ;ecx = ¬ ªá¨¬ «ì­®¥ ç¨á«® ¡ ©â, ¤«ï ª®â®àëå ¡ë«  ¢ë¤¥«¥­  ¯ ¬ïâì
271
		sub ecx,2 ;ecx = ¬ ªá¨¬ «ì­®¥ ç¨á«® ¡ ©â, ¤«ï ª®â®àëå ¡ë«  ¢ë¤¥«¥­  ¯ ¬ïâì
269
		cmp ebx,ecx
272
		cmp ebx,ecx
270
		jl .ret_f
273
		jl .ret_f
271
			stdcall [mb_create],msgbox_1,thread
274
			stdcall [mb_create],msgbox_1,thread
272
	.ret_f:
275
	.ret_f:
273
	pop edi ecx
276
	pop edi ecx
274
	ret
277
	ret
275
 
278
 
276
align 4
279
align 4
277
ted_save_err_msg:
280
ted_save_err_msg:
278
	mov byte[msgbox_6.err],al
281
	mov byte[msgbox_6.err],al
279
	stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
282
	stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
280
	ret
283
	ret
281
 
284
 
282
;description:
285
;description:
283
; äã­ªæ¨ï ­ ¦ â¨ï ­  ª­®¯ªã [à¨¬¥­¨âì] ¢ ¯ ­¥«¨ ᨭ⠪á¨á 
286
; äã­ªæ¨ï ­ ¦ â¨ï ­  ª­®¯ªã [à¨¬¥­¨âì] ¢ ¯ ­¥«¨ ᨭ⠪á¨á 
284
align 4
287
align 4
285
proc ted_but_open_syntax uses eax ebx ecx edi, edit:dword
288
proc ted_but_open_syntax uses eax ebx ecx edi, edit:dword
286
	mov edi,dword[edit]
289
	mov edi,dword[edit]
287
	cmp ted_panel_id,TED_PANEL_SYNTAX
290
	cmp ted_panel_id,TED_PANEL_SYNTAX
288
	jne @f
291
	jne @f
289
		stdcall dword[tl_node_get_data], tree1
292
		stdcall dword[tl_node_get_data], tree1
290
		mov [fn_col_option],eax
293
		mov [fn_col_option],eax
291
		stdcall open_unpac_synt_file,eax
294
		stdcall open_unpac_synt_file,eax
292
		cmp ebx,-1
295
		cmp ebx,-1
293
		je @f
296
		je @f
294
 
297
 
295
		call [ted_text_colored]
298
		call [ted_text_colored]
296
		stdcall [ted_draw],edi
299
		stdcall [ted_draw],edi
297
	@@:
300
	@@:
298
	ret
301
	ret
299
endp
302
endp
300
 
303
 
301
;®âªàë⨥ ¨ à á¯ ª®¢ª  ä ©«  ¯®¤á¢¥âª¨ ᨭ⠪á¨á 
304
;®âªàë⨥ ¨ à á¯ ª®¢ª  ä ©«  ¯®¤á¢¥âª¨ ᨭ⠪á¨á 
302
;input:
305
;input:
303
; f_name - 㪠§ â¥«ì ­  ¨¬ï ®âªà뢠¥¬®£® ä ©«  ᨭ⠪á¨á  (¡¥§ ¯ã⨠¨ ¯ ¯ª¨ info)
306
; f_name - 㪠§ â¥«ì ­  ¨¬ï ®âªà뢠¥¬®£® ä ©«  ᨭ⠪á¨á  (¡¥§ ¯ã⨠¨ ¯ ¯ª¨ info)
304
;output:
307
;output:
305
; ebx - ç¨á«® ¯à®ç¨â ­­ëå ¡ ©â ¨§ ä ©« 
308
; ebx - ç¨á«® ¯à®ç¨â ­­ëå ¡ ©â ¨§ ä ©« 
306
; ecx - à §àãè ¥âáï
309
; ecx - à §àãè ¥âáï
307
align 4
310
align 4
308
proc open_unpac_synt_file uses eax edi esi, f_name:dword
311
proc open_unpac_synt_file uses eax edi esi, f_name:dword
309
	mov ebx,[f_name]
312
	mov ebx,[f_name]
310
	mov edi,last_open_synt_file
313
	mov edi,last_open_synt_file
311
	stdcall strcmp,ebx,edi ;áà ¢­¨¢ ¥¬ ¨¬ï ¯®¤ª«î祭­®£® ä ©«  á ¯®¤ª«î祭­ë¬ à ­¥¥ ä ©«®¬
314
	stdcall strcmp,ebx,edi ;áà ¢­¨¢ ¥¬ ¨¬ï ¯®¤ª«î祭­®£® ä ©«  á ¯®¤ª«î祭­ë¬ à ­¥¥ ä ©«®¬
312
	test eax,eax
315
	test eax,eax
313
	jz @f
316
	jz @f
314
 
317
 
315
	;ª®¯¨à㥬 ¨¬ï ¯®¤ª«î祭­®£® ä ©«  (¤«ï ¨§¡¥¦ ­¨ï ¯®¢â®à­ëå ¯®¤ª«î祭¨©)
318
	;ª®¯¨à㥬 ¨¬ï ¯®¤ª«î祭­®£® ä ©«  (¤«ï ¨§¡¥¦ ­¨ï ¯®¢â®à­ëå ¯®¤ª«î祭¨©)
316
	mov esi,ebx
319
	mov esi,ebx
317
	mov ecx,32/4
320
	mov ecx,32/4
318
	cld
321
	cld
319
	rep movsd
322
	rep movsd
320
 
323
 
321
	copy_path ebx,fn_syntax_dir,syntax_path,0
324
	copy_path ebx,fn_syntax_dir,syntax_path,0
322
	copy_path syntax_path,sys_path,file_name,0
325
	copy_path syntax_path,sys_path,file_name,0
323
	mov edi, tedit0
326
	mov edi, tedit0
324
	mov [run_file_70.Function], SSF_READ_FILE
327
	mov [run_file_70.Function], SSF_READ_FILE
325
	mov [run_file_70.Position], 0
328
	mov [run_file_70.Position], 0
326
	mov [run_file_70.Flags], 0
329
	mov [run_file_70.Flags], 0
327
	mov ecx, ted_syntax_file_size
330
	mov ecx, ted_syntax_file_size
328
	mov dword[run_file_70.Count], ecx
331
	mov dword[run_file_70.Count], ecx
329
	m2m dword[run_file_70.Buffer], ted_syntax_file
332
	m2m dword[run_file_70.Buffer], ted_syntax_file
330
	mov byte[run_file_70+20], 0
333
	mov byte[run_file_70+20], 0
331
	mov [run_file_70.FileName], file_name
334
	mov [run_file_70.FileName], file_name
332
	mcall SF_FILE, run_file_70
335
	mcall SF_FILE, run_file_70
333
	cmp ebx,-1
336
	cmp ebx,-1
334
	jne .end_0
337
	jne .end_0
335
		call ted_on_init_synt_err
338
		call ted_on_init_synt_err
336
		jmp @f
339
		jmp @f
337
	.end_0:
340
	.end_0:
338
		mov eax,ted_syntax_file
341
		mov eax,ted_syntax_file
339
		cmp dword[eax],'KPCK'
342
		cmp dword[eax],'KPCK'
340
		jne .end_unpack
343
		jne .end_unpack
341
		cmp dword[eax+4],ecx
344
		cmp dword[eax+4],ecx
342
		jg @f ;¥á«¨ ¤«ï à á¯ ª®¢ ­®£® ä ©«  ­¥ 墠⠥⠢뤥«¥­­®© ¯ ¬ïâ¨
345
		jg @f ;¥á«¨ ¤«ï à á¯ ª®¢ ­®£® ä ©«  ­¥ 墠⠥⠢뤥«¥­­®© ¯ ¬ïâ¨
343
		cmp dword[unpac_mem],0
346
		cmp dword[unpac_mem],0
344
		jne .end_1
347
		jne .end_1
345
			;¢ë¤¥«¥­¨¥ ¯ ¬ï⨠¤«ï à á¯ ª®¢ª¨ ä ©« 
348
			;¢ë¤¥«¥­¨¥ ¯ ¬ï⨠¤«ï à á¯ ª®¢ª¨ ä ©« 
346
			stdcall mem.Alloc,ecx
349
			stdcall mem.Alloc,ecx
347
			mov [unpac_mem],eax
350
			mov [unpac_mem],eax
348
		.end_1:
351
		.end_1:
349
		stdcall unpack,ted_syntax_file,[unpac_mem]
352
		stdcall unpack,ted_syntax_file,[unpac_mem]
350
		mov edi,ted_syntax_file
353
		mov edi,ted_syntax_file
351
		mov esi,[unpac_mem]
354
		mov esi,[unpac_mem]
352
		mov ecx,[edi+4]
355
		mov ecx,[edi+4]
353
		cld
356
		cld
354
		rep movsb
357
		rep movsb
355
		.end_unpack:
358
		.end_unpack:
356
		stdcall [ted_init_syntax_file], tedit0
359
		stdcall [ted_init_syntax_file], tedit0
357
	@@:
360
	@@:
358
	ret
361
	ret
359
endp
362
endp
360
 
363
 
361
;description:
364
;description:
362
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
365
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
363
align 4
366
align 4
364
proc ted_but_find uses edi
367
proc ted_but_find uses edi
365
	mov edi,tedit0
368
	mov edi,tedit0
366
 
369
 
367
	cmp ted_panel_id,TED_PANEL_NULL
370
	cmp ted_panel_id,TED_PANEL_NULL
368
	je @f
371
	je @f
369
		mov ted_panel_id,TED_PANEL_NULL
372
		mov ted_panel_id,TED_PANEL_NULL
370
		mov ted_wnd_l,0
373
		mov ted_wnd_l,0
371
		jmp .e_if
374
		jmp .e_if
372
	@@:
375
	@@:
373
		mov ted_panel_id,TED_PANEL_FIND
376
		mov ted_panel_id,TED_PANEL_FIND
374
		mov ted_wnd_l,TED_PANEL_WIDTH
377
		mov ted_wnd_l,TED_PANEL_WIDTH
375
	.e_if:
378
	.e_if:
376
	call EvSize
379
	call EvSize
377
	stdcall [ted_draw],edi
380
	stdcall [ted_draw],edi
378
	ret
381
	ret
379
endp
382
endp
380
 
383
 
381
align 4
384
align 4
382
tbl_1251_866:
385
tbl_1251_866:
383
rb 128
386
rb 128
384
db   0,  0,  0,  0,  0,  0,  0,  0,  0,0,0,0,0,0,0,0 ;128
387
db   0,  0,  0,  0,  0,  0,  0,  0,  0,0,0,0,0,0,0,0 ;128
385
db   0,  0,  0,  0,  0,  0,  0,  0,  0,0,0,0,0,0,0,0 ;144
388
db   0,  0,  0,  0,  0,  0,  0,  0,  0,0,0,0,0,0,0,0 ;144
386
db   0,  0,  0,  0,  0,  0,  0,  0,240,0,0,0,0,0,0,0 ;160
389
db   0,  0,  0,  0,  0,  0,  0,  0,240,0,0,0,0,0,0,0 ;160
387
db   0,  0,  0,  0,  0,  0,  0,  0,241,0,0,0,0,0,0,0 ;176
390
db   0,  0,  0,  0,  0,  0,  0,  0,241,0,0,0,0,0,0,0 ;176
388
db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 ;192
391
db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 ;192
389
db 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159 ;208
392
db 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159 ;208
390
db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 ;224
393
db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 ;224
391
db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ;240
394
db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ;240
392
 
395
 
393
align 4
396
align 4
394
tbl_866_1251:
397
tbl_866_1251:
395
rb 128
398
rb 128
396
db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 ;128
399
db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 ;128
397
db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 ;144
400
db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 ;144
398
db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ;160
401
db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ;160
399
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;176
402
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;176
400
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;192
403
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;192
401
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;208
404
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;208
402
db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 ;224
405
db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 ;224
403
db 168,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;240
406
db 168,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;240
404
 
407
 
405
align 4
408
align 4
406
ted_on_find_err:
409
ted_on_find_err:
407
	stdcall [mb_create],msgbox_7,thread ;message: Can not find text
410
	stdcall [mb_create],msgbox_7,thread ;message: Can not find text
408
	ret
411
	ret
409
 
412
 
410
;description:
413
;description:
411
; ª­®¯ª  [‡ ¬¥­¨âì] ­  ¯ ­¥«¨
414
; ª­®¯ª  [‡ ¬¥­¨âì] ­  ¯ ­¥«¨
412
align 4
415
align 4
413
but_replace:
416
but_replace:
414
	; ¯®ª  ­¥ ᤥ« ­®
417
	; ¯®ª  ­¥ ᤥ« ­®
415
	ret
418
	ret
416
 
419
 
417
;description:
420
;description:
418
; äã­ªæ¨ï ¯®¨áª  ¨­ä®à¬ æ¨¨ ¢ ᯨ᪥ ª«î祢ëå á«®¢
421
; äã­ªæ¨ï ¯®¨áª  ¨­ä®à¬ æ¨¨ ¢ ᯨ᪥ ª«î祢ëå á«®¢
419
align 4
422
align 4
420
but_find_key_w:
423
but_find_key_w:
421
	cmp dword[wnd_k_words_run],0
424
	cmp dword[wnd_k_words_run],0
422
	jne @f
425
	jne @f
423
		pushad
426
		pushad
424
		mcall SF_CREATE_THREAD,1,prop_start,thread_coords
427
		mcall SF_CREATE_THREAD,1,prop_start,thread_coords
425
		mov dword[wnd_k_words_run],eax
428
		mov dword[wnd_k_words_run],eax
426
		popad
429
		popad
427
	@@:
430
	@@:
428
	ret
431
	ret
429
 
432
 
430
;description:
433
;description:
431
; ¢ë¤¥«¥­¨¥/áªàë⨥ ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
434
; ¢ë¤¥«¥­¨¥/áªàë⨥ ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
432
align 4
435
align 4
433
proc but_sumb_invis uses edi, edit:dword
436
proc but_sumb_invis uses edi, edit:dword
434
	mov edi,dword[edit]
437
	mov edi,dword[edit]
435
 
438
 
436
	xor ted_mode_invis,1
439
	xor ted_mode_invis,1
437
	call draw_but_toolbar
440
	call draw_but_toolbar
438
	stdcall [ted_draw],edi
441
	stdcall [ted_draw],edi
439
	ret
442
	ret
440
endp
443
endp
441
 
444
 
442
;description:
445
;description:
443
; ¢ë¤¥«¥­¨¥/áªàë⨥ ª«î祢ëå á«®¢
446
; ¢ë¤¥«¥­¨¥/áªàë⨥ ª«î祢ëå á«®¢
444
align 4
447
align 4
445
proc but_k_words_show uses edi, edit:dword
448
proc but_k_words_show uses edi, edit:dword
446
	mov edi,dword[edit]
449
	mov edi,dword[edit]
447
 
450
 
448
	xor ted_mode_color,1
451
	xor ted_mode_color,1
449
	cmp ted_mode_color,0
452
	cmp ted_mode_color,0
450
	je @f
453
	je @f
451
		call [ted_text_colored]
454
		call [ted_text_colored]
452
	@@:
455
	@@:
453
	call draw_but_toolbar
456
	call draw_but_toolbar
454
	stdcall [ted_draw],edi
457
	stdcall [ted_draw],edi
455
	ret
458
	ret
456
endp
459
endp
457
 
460
 
458
;description:
461
;description:
459
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ á ä ©« ¬¨ ᨭ⠪á¨á 
462
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ á ä ©« ¬¨ ᨭ⠪á¨á 
460
align 4
463
align 4
461
proc but_synt_show uses edi, edit:dword
464
proc but_synt_show uses edi, edit:dword
462
	mov edi,[edit]
465
	mov edi,[edit]
463
 
466
 
464
	cmp ted_panel_id,TED_PANEL_NULL
467
	cmp ted_panel_id,TED_PANEL_NULL
465
	je @f
468
	je @f
466
		mov ted_panel_id,TED_PANEL_NULL
469
		mov ted_panel_id,TED_PANEL_NULL
467
		mov ted_wnd_l,0
470
		mov ted_wnd_l,0
468
		jmp .e_if
471
		jmp .e_if
469
	@@:
472
	@@:
470
		mov ted_panel_id,TED_PANEL_SYNTAX
473
		mov ted_panel_id,TED_PANEL_SYNTAX
471
		mov ted_wnd_l,TED_PANEL_WIDTH
474
		mov ted_wnd_l,TED_PANEL_WIDTH
472
	.e_if:
475
	.e_if:
473
	call EvSize
476
	call EvSize
474
	stdcall [ted_draw],edi
477
	stdcall [ted_draw],edi
475
	ret
478
	ret
476
endp
479
endp