Subversion Repositories Kolibri OS

Rev

Rev 7577 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1457 IgorA 1
struct symbol
2125 IgorA 2
	c db ?    ; +0 символ
3
	col db ?  ; +1 цвет
4
	perv dd ? ; +2
5
	next dd ? ; +6 указатели
6
	tc dd ?   ;+10 врем. создания
7
	td dd ?   ;+14 врем. удаления
1457 IgorA 8
ends
9
 
7573 IgorA 10
ID_BUT_0 equ 3 ;минимальный ID кнопки на панели
11
 
12
ID_BUT_NEW equ 3
13
ID_BUT_OPEN equ 4
14
ID_BUT_SAVE equ 5
15
ID_BUT_SAVE_AS equ 6
16
ID_BUT_SELECT equ 7
17
ID_BUT_CUT equ 8
18
ID_BUT_COPY equ 9
19
ID_BUT_PASTE equ 10
20
ID_BUT_FIND equ 11
21
ID_BUT_REPLACE equ 12
22
ID_BUT_KEY_WORDS equ 13
23
ID_BUT_UPPER equ 14
24
ID_BUT_LOWER equ 15
25
ID_BUT_REVERSE equ 16
26
ID_BUT_UNDO equ 17
27
ID_BUT_REDO equ 18
28
ID_BUT_INVISIBLE equ 19
29
ID_BUT_SYNTAX_LIST equ 20
30
ID_BUT_SYNTAX_MODE equ 21
31
ID_BUT_CONVERT_1251_866 equ 22
32
ID_BUT_CONVERT_866_1251 equ 23
33
 
34
macro ini_panel b_key,b_id
35
{
36
	stdcall [ini_get_int],file_name,ini_sec_window,b_key,1
37
	mov byte[panel_but+b_id-ID_BUT_0],al
38
}
39
 
1457 IgorA 40
bmp_icon dd 0
41
 
7573 IgorA 42
align 16
43
button:
44
	mcall SF_GET_BUTTON
45
	cmp ah,ID_BUT_NEW
46
	jne @f
47
		call ted_but_new_file
48
		jmp still
49
	@@:
50
	cmp ah,ID_BUT_OPEN
51
	jne @f
52
		call ted_but_open_file
53
		jmp still
54
	@@:
55
	cmp ah,ID_BUT_SAVE
56
	jne @f
57
		xor eax,eax
58
		call ted_but_save_file ;сохранение без диалога
59
		jmp still
60
	@@:
61
	cmp ah,ID_BUT_SAVE_AS
62
	jne @f
63
		xor eax,eax
64
		inc eax
65
		call ted_but_save_file ;сохранение с диалогом
66
		jmp still
67
	@@:
68
	cmp ah,ID_BUT_SELECT
69
	jne @f
70
		stdcall [ted_but_select_word], tedit0
71
		jmp still
72
	@@:
73
	cmp ah,ID_BUT_CUT
74
	jne @f
75
		stdcall [ted_but_cut], tedit0
76
		jmp still
77
	@@:
78
	cmp ah,ID_BUT_COPY
79
	jne @f
80
		stdcall [ted_but_copy], tedit0
81
		jmp still
82
	@@:
83
	cmp ah,ID_BUT_PASTE
84
	jne @f
85
		stdcall [ted_but_paste], tedit0
86
		jmp still
87
	@@:
88
	cmp ah,ID_BUT_FIND
89
	jne @f
7576 IgorA 90
		call but_panel_find
7573 IgorA 91
		jmp still
92
	@@:
93
	cmp ah,ID_BUT_REPLACE
94
	jne @f
7576 IgorA 95
		call but_panel_replace
7573 IgorA 96
		jmp still
97
	@@:
98
	cmp ah,ID_BUT_KEY_WORDS
99
	jne @f
100
		call but_find_key_w
101
		jmp still
102
	@@:
103
	cmp ah,ID_BUT_UPPER
104
	jne @f
105
		stdcall [ted_but_sumb_upper], tedit0
106
		jmp still
107
	@@:
108
	cmp ah,ID_BUT_LOWER
109
	jne @f
110
		stdcall [ted_but_sumb_lover], tedit0
111
		jmp still
112
	@@:
113
	cmp ah,ID_BUT_REVERSE
114
	jne @f
115
		stdcall [ted_but_reverse], tedit0
116
		jmp still
117
	@@:
118
	cmp ah,ID_BUT_UNDO
119
	jne @f
120
		stdcall [ted_but_undo], tedit0
121
		jmp still
122
	@@:
123
	cmp ah,ID_BUT_REDO
124
	jne @f
125
		stdcall [ted_but_redo], tedit0
126
		jmp still
127
	@@:
128
	cmp ah,ID_BUT_INVISIBLE
129
	jne @f
130
		stdcall but_sumb_invis, tedit0
131
		jmp still
132
	@@:
133
	cmp ah,ID_BUT_SYNTAX_LIST
134
	jne @f
135
		stdcall but_use_syntax, tedit0
136
		jmp still
137
	@@:
138
	cmp ah,ID_BUT_SYNTAX_MODE
139
	jne @f
7579 IgorA 140
		call but_panel_choose_syntax
7573 IgorA 141
		jmp still
142
	@@:
143
	cmp ah,ID_BUT_CONVERT_1251_866
144
	jne @f
145
		stdcall [ted_but_convert_by_table],tedit0,tbl_1251_866
146
		jmp still
147
	@@:
148
	cmp ah,ID_BUT_CONVERT_866_1251
149
	jne @f
150
		stdcall [ted_but_convert_by_table],tedit0,tbl_866_1251
151
		jmp still
152
	@@:
1457 IgorA 153
 
7573 IgorA 154
	cmp ah,200
155
	jne @f
156
		stdcall ted_but_open_syntax, tedit0
157
		jmp still
158
	@@:
7577 IgorA 159
	cmp ah,201 ;найти далее
7576 IgorA 160
	jne .no_find
161
		call get_find_options
162
		stdcall [ted_but_find], tedit0, eax
7573 IgorA 163
		jmp still
7576 IgorA 164
	.no_find:
7577 IgorA 165
	cmp ah,202 ;заменить
7576 IgorA 166
	jne .no_change
167
		call get_find_options
168
		stdcall [ted_but_replace], tedit0, buf_replace, eax, 1
169
		or eax,eax
170
		jz still
171
		stdcall [ted_draw], tedit0
172
		jmp still
173
	.no_change:
7577 IgorA 174
	cmp ah,203 ;заменить все
7579 IgorA 175
	jne @f
7576 IgorA 176
		call but_replace_all
177
		jmp still
7579 IgorA 178
	@@:
179
	cmp ah,204 ;перейти на строку
180
	jne @f
181
		call but_goto_line
182
		jmp still
183
	@@:
7573 IgorA 184
 
185
	cmp ah,1
7575 IgorA 186
	jne @f
187
		call ted_Exit
188
		jmp still
189
	@@:
7573 IgorA 190
 
191
	cmp ah,199
7575 IgorA 192
	jne still
193
		call ted_Exit
7573 IgorA 194
	jmp still
7575 IgorA 195
 
196
align 4
197
ted_Exit:
7573 IgorA 198
	cmp dword[wnd_k_words_run],0
199
	je @f
200
		push ebx ecx
201
		mcall SF_SYSTEM, SSF_TERMINATE_THREAD_ID,[wnd_k_words_run]
202
		pop ecx ebx
7575 IgorA 203
		mov dword[wnd_k_words_run],0
204
		;test eax,eax
7573 IgorA 205
	@@:
206
	cmp dword[exit_code],1
207
	je @f
208
	stdcall [ted_can_save], tedit0
209
	cmp al,1
210
	jne @f
211
		stdcall [mb_create],msgbox_2,thread ;message: save buf in file?
212
		stdcall [mb_setfunctions],msgbox_2E_funct
7575 IgorA 213
		ret
7573 IgorA 214
	@@:
215
	stdcall mem.Free,[bmp_icon]
216
	cmp dword[unpac_mem],0
217
	je @f
218
		stdcall mem.Free,[unpac_mem]
219
	@@:
220
	stdcall [ted_delete], tedit0
221
	stdcall [tl_data_clear], tree1
222
	mcall SF_TERMINATE_PROCESS ;выход из программы
7575 IgorA 223
	;ret
7573 IgorA 224
 
7576 IgorA 225
align 4
226
get_find_options:
227
	xor eax,eax
228
	cmp [opt_gr1],opt1
229
	je @f
230
		inc eax
231
	cmp [opt_gr1],opt2
232
	je @f
233
		inc eax
234
	@@:
235
	ret
236
 
237
align 4
238
proc but_replace_all uses ebx ecx edx
239
	call get_find_options
240
	mov ebx,eax
241
	stdcall [ted_but_replace], tedit0, buf_replace, ebx, 1
242
	xor edx,edx
243
	or eax,eax
244
	jz @f
245
	inc edx
246
	mov ecx,0x1000
247
	.cycle0:
248
		stdcall [ted_but_replace], tedit0, buf_replace, ebx, 0
249
		or eax,eax
250
		jz @f
251
		inc edx
252
		loop .cycle0
253
	@@:
7577 IgorA 254
	or edx,edx
255
	jz @f
256
		stdcall [ted_draw], tedit0
257
	@@:
7576 IgorA 258
	mov eax,edx
7577 IgorA 259
	mov edi,msgbox_1.z
260
	stdcall convert_int_to_str, 8
261
	stdcall str_cat, edi,txt_Info
262
	notify_window_run msgbox_1
7576 IgorA 263
	ret
264
endp
265
 
7579 IgorA 266
align 4
267
proc but_goto_line uses eax
268
	stdcall conv_str_to_int, buf_goto
269
	stdcall [ted_go_to_position], tedit0,eax,1
270
	ret
271
endp
272
 
1457 IgorA 273
;input:
274
; al = код ошибки
1456 IgorA 275
align 4
1457 IgorA 276
ted_on_init_synt_err:
2855 IgorA 277
	mov byte[msgbox_3.err],'0'
278
	add byte[msgbox_3.err],al
1457 IgorA 279
	stdcall [mb_create],msgbox_3,thread ;message: Can-t open color options file!
280
	ret
281
 
282
align 4
283
ted_but_new_file:
4991 IgorA 284
	push eax ebx
285
	stdcall [ted_can_save], tedit0
286
	cmp al,1
287
	jne @f
288
		stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
289
		stdcall [mb_setfunctions],msgbox_2N_funct
290
		jmp .ret_f
291
	@@:
292
	call On_NewFile
293
	.ret_f:
5643 leency 294
		mov byte[openfile_path],0
6086 IgorA 295
		mcall SF_SET_CAPTION,1,hed
4991 IgorA 296
	pop ebx eax
297
	ret
1338 IgorA 298
 
1456 IgorA 299
align 4
1338 IgorA 300
On_NewFile:
4991 IgorA 301
	stdcall [ted_clear], tedit0,1
302
	call draw_but_toolbar
303
	stdcall [ted_draw], tedit0
7570 IgorA 304
	mov dword[openfile_path],0
4991 IgorA 305
	ret
1338 IgorA 306
 
1456 IgorA 307
align 4
1338 IgorA 308
On_SaveAndNewFile:
4991 IgorA 309
	push edi
310
	mov edi, tedit0
1456 IgorA 311
 
4991 IgorA 312
	call ted_but_save_file
313
	cmp ted_err_save,0
314
	jne @f
315
		call On_NewFile
316
	@@:
317
	pop edi
318
	ret
1338 IgorA 319
 
4991 IgorA 320
align 4
321
On_SaveAndOpenFile:
322
	push edi
323
	mov edi, tedit0
324
 
325
	call ted_but_save_file
326
	cmp ted_err_save,0
327
	jne @f
328
		call ted_but_open_file.no_msg
329
	@@:
330
	pop edi
331
	ret
332
 
333
align 4
334
On_SaveAndExit:
335
	push edi
336
	mov edi, tedit0
337
 
338
	call ted_but_save_file
339
	cmp ted_err_save,0
340
	jne @f
341
		mov dword[exit_code],1
342
	@@:
343
	pop edi
344
	ret
345
 
346
align 4
347
On_Exit:
348
	mov dword[exit_code],1
349
	ret
350
 
1457 IgorA 351
;description:
2102 IgorA 352
; функция открытия файла без окна сообщения
1456 IgorA 353
align 4
7570 IgorA 354
proc but_no_msg_OpenFile uses eax ebx esi
4308 IgorA 355
	stdcall [ted_open_file], tedit0,run_file_70,openfile_path
1457 IgorA 356
	call ted_messages_after_open_file
7570 IgorA 357
 
358
	mov esi,openfile_path
7577 IgorA 359
	stdcall str_len,esi
7570 IgorA 360
	add esi,eax
361
	@@: ;цикл для поиска начала имени файла
362
		dec esi
363
		cmp byte[esi],'/'
364
		je @f
365
		cmp byte[esi],0x5c ;'\'
366
		je @f
367
		cmp esi,openfile_path
368
		jg @b
369
	@@:
370
	inc esi
7577 IgorA 371
	stdcall str_len,esi
7570 IgorA 372
	cmp eax,255
373
	jle @f
374
		mov eax,255
375
	@@:
376
	inc eax ;для 0 в конце строки
377
	stdcall mem_cpy, filename_area,esi,eax ;копируем имя файла в диалог сохранения
1457 IgorA 378
	ret
7570 IgorA 379
endp
1456 IgorA 380
 
1457 IgorA 381
;description:
7579 IgorA 382
; функция вызываемую при нажатии Ctrl+N,O,F,S,H,G
383
align 4
384
proc ted_but_ctrl_all uses eax, opt_key:dword
385
	mov eax,[opt_key]
386
	cmp al,'N' ;Ctrl+N
387
	jne @f
388
		call ted_but_new_file
389
		jmp .end0
390
	@@:
391
	cmp al,'O' ;Ctrl+O
392
	jne @f
393
		call ted_but_open_file
394
		jmp .end0
395
	@@:
396
	cmp al,'S' ;Ctrl+S
397
	jne @f
398
		shr eax,8
399
		call ted_but_save_file
400
		jmp .end0
401
	@@:
402
	cmp al,'F' ;Ctrl+F
403
	jne @f
404
		call but_panel_find
405
		jmp .end0
406
	@@:
407
	cmp al,'G' ;Ctrl+G
408
	jne @f
409
		call but_panel_goto
410
		jmp .end0
411
	@@:
412
	cmp al,'H' ;Ctrl+H
413
	jne .end0
414
		call but_panel_replace
415
	.end0:
416
	ret
417
endp
418
 
419
;description:
1457 IgorA 420
; функция открытия файла с возможным окном сообщения (о возможности отменить открытие)
1456 IgorA 421
align 4
1457 IgorA 422
ted_but_open_file:
1467 IgorA 423
	pushad
424
 
1457 IgorA 425
	stdcall [ted_can_save], tedit0
426
	cmp al,1
427
	jne @f
4991 IgorA 428
		stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
429
		stdcall [mb_setfunctions],msgbox_2O_funct
1457 IgorA 430
		jmp .ret_f
3366 IgorA 431
	.no_msg: ;метка для вызова функции через кнопку в сообщении msgbox_5
432
		pushad
1457 IgorA 433
	@@:
1467 IgorA 434
 
1468 IgorA 435
	copy_path open_dialog_name,communication_area_default_path,file_name,0
1467 IgorA 436
	mov [OpenDialog_data.type],0
1592 IgorA 437
	stdcall [OpenDialog_Start],OpenDialog_data
1467 IgorA 438
	cmp [OpenDialog_data.status],2
439
	jne @f
1468 IgorA 440
		stdcall mem_spac, msgbox_9.fdp,100
7577 IgorA 441
		stdcall str_len,file_name
1468 IgorA 442
		cmp eax,100
443
		jle .no_crop
444
			mov eax,100
445
		.no_crop:
7570 IgorA 446
		stdcall mem_cpy, msgbox_9.fdp,esi,eax
1467 IgorA 447
		stdcall [mb_create],msgbox_9,thread ;message: error run 'open file dialog'
448
		jmp .ret_f
449
	@@:
2817 IgorA 450
	cmp [OpenDialog_data.status],1
2632 IgorA 451
	jne .ret_f
6086 IgorA 452
		stdcall auto_open_syntax,[OpenDialog_data.openfile_path]
4308 IgorA 453
		stdcall [ted_open_file], tedit0,run_file_70,openfile_path
2817 IgorA 454
		call ted_messages_after_open_file
1457 IgorA 455
	.ret_f:
1467 IgorA 456
	popad
1457 IgorA 457
	ret
1338 IgorA 458
 
6086 IgorA 459
proc auto_open_syntax, of_path:dword
460
pushad
461
	;ищем есть ли файл подсветки для открываемого текстового файла
7577 IgorA 462
	stdcall str_len,[of_path]
6086 IgorA 463
	mov edx,[of_path]
464
	add edx,eax
465
	.f_beg:
466
	cmp byte[edx],'.'
467
	je .found
468
		dec edx
469
		cmp edx,[of_path]
470
		jg .f_beg
471
	.found:
472
	inc edx ;edx - указатель на расширение открытого файла
473
 
474
	mov ebx,synt_auto_open
475
	.cycle_0:
476
		add ebx,32
477
		stdcall strcmp,ebx,edx ;сравниваем расширение открытого файла со значениями открытыми с ini файла
478
		test eax,eax
479
		jz .ok
480
		add ebx,32
481
		cmp byte[ebx],0
482
		jne .cycle_0
483
	jmp .end_0
484
	.ok: ;открытие файла подсветки в зависимости от найденного расширения
485
		sub ebx,32
486
		stdcall open_unpac_synt_file,ebx
487
	.end_0:
488
popad
489
	ret
490
endp
491
 
7571 IgorA 492
;input:
493
; eax если равен: 0 - сохранение без диалога, 1 - сохранение с диалогом
2102 IgorA 494
;description:
7570 IgorA 495
; функция сохранения файла
4308 IgorA 496
align 4
497
proc ted_but_save_file
7571 IgorA 498
	or eax,eax
499
	jnz .init_dlg
500
		; сохраняем без вызова диалогового окна
501
		cmp byte[openfile_path],0
502
		jne @f
7570 IgorA 503
	.init_dlg:
7571 IgorA 504
		; вызов диалогового окна для сохранения файла
505
		copy_path open_dialog_name,communication_area_default_path,file_name,0
506
		mov [OpenDialog_data.type],1
507
		stdcall [OpenDialog_Start],OpenDialog_data
508
		cmp [OpenDialog_data.status],1 ;if status==1 then save
509
		jne .end_save
7570 IgorA 510
	@@:
5918 IgorA 511
		stdcall [ted_save_file],tedit0,run_file_70,openfile_path
7570 IgorA 512
	.end_save:
4308 IgorA 513
	ret
514
endp
515
 
516
;description:
2102 IgorA 517
; копирование памяти
1468 IgorA 518
align 4
7570 IgorA 519
proc mem_cpy uses ecx esi edi, destination:dword, source:dword, len:dword
5918 IgorA 520
	cld
7571 IgorA 521
	mov esi,[source]
522
	mov edi,[destination]
523
	mov ecx,[len]
5918 IgorA 524
	rep movsb
525
	ret
1468 IgorA 526
endp
527
 
2102 IgorA 528
;description:
529
; заполнение памяти пробелами
1468 IgorA 530
align 4
5918 IgorA 531
proc mem_spac uses eax ecx edi, mem:dword, len:dword
532
	cld
533
	mov al,' '
7571 IgorA 534
	mov edi,[mem]
535
	mov ecx,[len]
5918 IgorA 536
	repne stosb
537
	ret
1468 IgorA 538
endp
539
 
1457 IgorA 540
;input:
541
; eax = код ошибки
542
; ebx = колличество прочитанных байт
1456 IgorA 543
align 4
1457 IgorA 544
ted_messages_after_open_file:
2847 IgorA 545
	push ecx edi
7577 IgorA 546
	or eax,eax
547
	jz @f
1457 IgorA 548
		cmp ax,10
549
		jl .zifra_0_9
550
			mov al,'?'
551
			sub ax,48
552
		.zifra_0_9:
553
		add ax,48
1456 IgorA 554
 
1457 IgorA 555
		mov byte[msgbox_4.err],al
556
		stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
557
	@@:
2847 IgorA 558
	pop edi ecx
1457 IgorA 559
	ret
1338 IgorA 560
 
1456 IgorA 561
align 4
1457 IgorA 562
ted_save_err_msg:
563
	mov byte[msgbox_6.err],al
564
	stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
565
	ret
1456 IgorA 566
 
2102 IgorA 567
;description:
568
; функция нажатия на кнопку [Применить] в панели синтаксиса
1456 IgorA 569
align 4
2707 IgorA 570
proc ted_but_open_syntax uses eax ebx ecx edi, edit:dword
7577 IgorA 571
	mov edi,[edit]
2707 IgorA 572
	cmp ted_panel_id,TED_PANEL_SYNTAX
573
	jne @f
7577 IgorA 574
		stdcall [tl_node_get_data], tree1
5911 IgorA 575
		mov [fn_col_option],eax
6086 IgorA 576
		stdcall open_unpac_synt_file,eax
2708 IgorA 577
		cmp ebx,-1
578
		je @f
579
 
2707 IgorA 580
		call [ted_text_colored]
581
		stdcall [ted_draw],edi
582
	@@:
583
	ret
1456 IgorA 584
endp
1338 IgorA 585
 
2708 IgorA 586
;открытие и распаковка файла подсветки синтаксиса
2855 IgorA 587
;input:
6086 IgorA 588
; f_name - указатель на имя открываемого файла синтаксиса (без пути и папки info)
2708 IgorA 589
;output:
590
; ebx - число прочитанных байт из файла
2855 IgorA 591
; ecx - разрушается
2708 IgorA 592
align 4
6086 IgorA 593
proc open_unpac_synt_file uses eax edi esi, f_name:dword
594
	mov ebx,[f_name]
7577 IgorA 595
	cmp byte[ebx],0
596
	je @f
2855 IgorA 597
	mov edi,last_open_synt_file
598
	stdcall strcmp,ebx,edi ;сравниваем имя подключенного файла с подключенным ранее файлом
599
	test eax,eax
600
	jz @f
601
 
602
	;копируем имя подключенного файла (для избежания повторных подключений)
603
	mov esi,ebx
6086 IgorA 604
	mov ecx,32/4
2855 IgorA 605
	cld
6086 IgorA 606
	rep movsd
2855 IgorA 607
 
4308 IgorA 608
	copy_path ebx,fn_syntax_dir,syntax_path,0
609
	copy_path syntax_path,sys_path,file_name,0
2708 IgorA 610
	mov edi, tedit0
6086 IgorA 611
	mov [run_file_70.Function], SSF_READ_FILE
2708 IgorA 612
	mov [run_file_70.Position], 0
613
	mov [run_file_70.Flags], 0
614
	mov ecx, ted_syntax_file_size
615
	mov dword[run_file_70.Count], ecx
616
	m2m dword[run_file_70.Buffer], ted_syntax_file
617
	mov byte[run_file_70+20], 0
618
	mov [run_file_70.FileName], file_name
6086 IgorA 619
	mcall SF_FILE, run_file_70
2708 IgorA 620
	cmp ebx,-1
621
	jne .end_0
622
		call ted_on_init_synt_err
623
		jmp @f
624
	.end_0:
625
		mov eax,ted_syntax_file
626
		cmp dword[eax],'KPCK'
627
		jne .end_unpack
628
		cmp dword[eax+4],ecx
629
		jg @f ;если для распакованого файла не хватает выделенной памяти
630
		cmp dword[unpac_mem],0
631
		jne .end_1
632
			;выделение памяти для распаковки файла
633
			stdcall mem.Alloc,ecx
634
			mov [unpac_mem],eax
635
		.end_1:
636
		stdcall unpack,ted_syntax_file,[unpac_mem]
637
		mov edi,ted_syntax_file
638
		mov esi,[unpac_mem]
639
		mov ecx,[edi+4]
640
		cld
641
		rep movsb
642
		.end_unpack:
643
		stdcall [ted_init_syntax_file], tedit0
644
	@@:
645
	ret
6086 IgorA 646
endp
2708 IgorA 647
 
2102 IgorA 648
;description:
649
; вызов/скрытие панели поиска
1456 IgorA 650
align 4
7579 IgorA 651
proc but_panel_find
652
	stdcall on_panel_change, tedit0,TED_PANEL_FIND
653
	;or word[edit_find.flags],ed_focus
654
	ret
655
endp
1456 IgorA 656
 
7579 IgorA 657
;description:
658
; вызов/скрытие панели перехода
659
align 4
660
proc but_panel_goto
661
	stdcall on_panel_change, tedit0,TED_PANEL_GOTO
662
	;or word[edit_goto.flags],ed_focus
4308 IgorA 663
	ret
1449 IgorA 664
endp
1338 IgorA 665
 
7576 IgorA 666
;description:
667
; вызов/скрытие панели замены
1456 IgorA 668
align 4
7579 IgorA 669
proc but_panel_replace
670
	stdcall on_panel_change, tedit0,TED_PANEL_REPLACE
671
	;or word[edit_find.flags],ed_focus
7576 IgorA 672
	ret
673
endp
674
 
675
;description:
676
; вызов/скрытие панели с файлами синтаксиса
677
align 4
7579 IgorA 678
proc but_panel_choose_syntax
679
	stdcall on_panel_change, tedit0,TED_PANEL_SYNTAX
680
	ret
681
endp
682
 
683
align 4
684
proc on_panel_change uses eax edi, edit:dword, new_id:dword
7576 IgorA 685
	mov edi,[edit]
7579 IgorA 686
	mov eax,[new_id]
7576 IgorA 687
 
7579 IgorA 688
	;if(panel_id==new_id) panel_id=0, draw all
689
	cmp ted_panel_id,al
690
	jne @f
7576 IgorA 691
		mov ted_panel_id,TED_PANEL_NULL
692
		mov ted_wnd_l,0
693
		jmp .e_if
694
	@@:
7579 IgorA 695
	;elseif(panel_id==0) panel_id=new_id, draw all
696
	cmp ted_panel_id,TED_PANEL_NULL
697
	jne @f
698
		mov ted_panel_id,al
7576 IgorA 699
		mov ted_wnd_l,TED_PANEL_WIDTH
700
	.e_if:
701
	call EvSize
702
	stdcall [ted_draw],edi
7579 IgorA 703
	jmp .end0
704
	;else panel_id=new_id, draw panel
705
	@@:
706
		mov ted_panel_id,al
707
		stdcall draw_panels,edi
708
	.end0:
7576 IgorA 709
	ret
710
endp
711
 
712
align 4
4308 IgorA 713
tbl_1251_866:
714
rb 128
715
db   0,  0,  0,  0,  0,  0,  0,  0,  0,0,0,0,0,0,0,0 ;128
716
db   0,  0,  0,  0,  0,  0,  0,  0,  0,0,0,0,0,0,0,0 ;144
717
db   0,  0,  0,  0,  0,  0,  0,  0,240,0,0,0,0,0,0,0 ;160
718
db   0,  0,  0,  0,  0,  0,  0,  0,241,0,0,0,0,0,0,0 ;176
719
db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 ;192
720
db 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159 ;208
721
db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 ;224
722
db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ;240
723
 
724
align 4
725
tbl_866_1251:
726
rb 128
727
db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 ;128
728
db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 ;144
729
db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ;160
730
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;176
731
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;192
732
db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;208
733
db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 ;224
734
db 168,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;240
735
 
736
align 4
1457 IgorA 737
ted_on_find_err:
7577 IgorA 738
	notify_window_run msgbox_7 ;message: Can not find text
1457 IgorA 739
	ret
740
 
2102 IgorA 741
;description:
742
; функция поиска информации в списке ключевых слов
1456 IgorA 743
align 4
1338 IgorA 744
but_find_key_w:
7035 IgorA 745
	cmp dword[wnd_k_words_run],0
3244 IgorA 746
	jne @f
747
		pushad
6086 IgorA 748
		mcall SF_CREATE_THREAD,1,prop_start,thread_coords
7579 IgorA 749
		mov [wnd_k_words_run],eax
3244 IgorA 750
		popad
751
	@@:
2102 IgorA 752
	ret
1338 IgorA 753
 
2102 IgorA 754
;description:
755
; выделение/скрытие непечатаемых символов
1456 IgorA 756
align 4
6239 IgorA 757
proc but_sumb_invis uses edi, edit:dword
7579 IgorA 758
	mov edi,[edit]
1338 IgorA 759
 
6239 IgorA 760
	xor ted_mode_invis,1
761
	call draw_but_toolbar
762
	stdcall [ted_draw],edi
763
	ret
1456 IgorA 764
endp
1338 IgorA 765
 
2102 IgorA 766
;description:
767
; выделение/скрытие ключевых слов
1456 IgorA 768
align 4
7573 IgorA 769
proc but_use_syntax uses edi, edit:dword
7579 IgorA 770
	mov edi,[edit]
1338 IgorA 771
 
6239 IgorA 772
	xor ted_mode_color,1
773
	cmp ted_mode_color,0
774
	je @f
775
		call [ted_text_colored]
776
	@@:
777
	call draw_but_toolbar
778
	stdcall [ted_draw],edi
779
	ret
1456 IgorA 780
endp
1338 IgorA 781