Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
1698 IgorA 1
;
2
; в этом файле собраны функции создающие програмный код
3
;
4
u_object object ;временный объект для задания смещений
5
 
6
macro insert_coma
7
{
8
	stdcall [ted_text_add], tedit0,txt_coma,1,ted_opt_ed_move_cursor
9
}
10
macro insert_nl
11
{
12
	stdcall [ted_text_add], tedit0,txt_nl,1,ted_opt_ed_move_cursor
13
}
14
macro insert_com
15
{
16
	stdcall [ted_text_add], tedit0,txt_com,1,ted_opt_ed_move_cursor
17
}
18
macro insert_sp
19
{
20
	stdcall [ted_text_add], tedit0,txt_sp,1,ted_opt_ed_move_cursor
21
}
22
 
23
;функция вставляет текстовую строку в текстовый редактор
24
align 4
25
proc insert_text, txt:dword
26
	push eax
27
	stdcall str_len,dword[txt]
28
	cmp eax,1
29
	jl @f
30
		stdcall [ted_text_add], tedit0,dword[txt],eax,ted_opt_ed_move_cursor
31
	@@:
32
	pop eax
33
	ret
34
endp
35
 
36
;вставляет указанное свойство из объекта в текстовый редактор
37
align 4
38
proc insert_text_prop, p_obj:dword,index:dword
39
	push eax edx
40
		mov eax,[p_obj]
41
		mov edx,[index]
42
		stdcall get_obj_text_col,eax,edx
43
		stdcall str_len,edx
44
		stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor
45
	pop edx eax
46
	ret
47
endp
48
 
1720 IgorA 49
;функция вставляет 2 параметра по 16 бит в виде:
50
; (_p1_ shl 16 + _p2_)
51
align 4
52
proc insert_2_prop_16_bit, obj:dword, p_hi:dword, p_lo:dword
53
	stdcall insert_text, txt_skob_o
54
	stdcall insert_text_prop, [obj],[p_hi]
55
	stdcall insert_text, txt_shl_16
56
	stdcall insert_text, txt_skob_c
57
	stdcall insert_text, txt_plus
58
	stdcall insert_text_prop, [obj],[p_lo]
59
	ret
60
endp
61
 
62
;вставляем строку вида:
63
; txt_(n) db (s)
64
align 4
65
proc insert_text_label_data, obj:dword, col:dword
66
	push eax edx
67
	mov eax,[obj]
68
		stdcall insert_text, txt_txt
69
		mov edx,fp_icon
70
		stdcall get_obj_id_str, eax,edx ;edx = 'n'
71
		stdcall str_cat, edx,txt_db ;edx = 'n db '
72
		stdcall insert_text, edx
73
		stdcall insert_text_prop, eax,[col]
74
		insert_nl
75
	pop edx eax
76
	ret
77
endp
78
 
1698 IgorA 79
macro insert_tab
80
{
81
	stdcall [ted_text_add], tedit0,txt_tab,1,ted_opt_ed_move_cursor
82
}
83
macro insert_br
84
{
85
	stdcall [ted_text_add], tedit0,txt_br,3,ted_opt_ed_move_cursor
86
}
87
macro insert_a_met
88
{
89
	stdcall [ted_text_add], tedit0,txt_a_met,3,ted_opt_ed_move_cursor
90
}
91
macro insert_0
92
{
93
	stdcall [ted_text_add], tedit0,txt_0,1,ted_opt_ed_move_cursor
94
}
95
macro insert_plus
96
{
97
	stdcall [ted_text_add], tedit0,txt_plus,1,ted_opt_ed_move_cursor
98
}
99
macro insert_xor
100
{
101
	stdcall [ted_text_add], tedit0,txt_xor,4,ted_opt_ed_move_cursor
102
}
103
macro insert_cmp
104
{
105
	stdcall [ted_text_add], tedit0,txt_cmp,4,ted_opt_ed_move_cursor
106
}
107
macro insert_reg reg_name
108
{
109
	stdcall [ted_text_add], tedit0,reg_name,3,ted_opt_ed_move_cursor
110
}
111
macro insert_reg8 reg_name
112
{
113
	stdcall [ted_text_add], tedit0,reg_name,2,ted_opt_ed_move_cursor
114
}
115
 
116
;
117
macro insert_but_beg
118
{
119
	stdcall [ted_text_add], tedit0,txt_but_1,txt_but_2-txt_but_1,ted_opt_ed_move_cursor
120
}
121
macro insert_but_end
122
{
123
	stdcall [ted_text_add], tedit0,txt_but_2,txt_but_3-txt_but_2,ted_opt_ed_move_cursor
124
}
125
;
126
macro insert_key_beg
127
{
128
	stdcall [ted_text_add], tedit0,txt_key_1,txt_key_2-txt_key_1,ted_opt_ed_move_cursor
129
}
130
macro insert_key_end
131
{
132
	stdcall [ted_text_add], tedit0,txt_key_2,txt_key_3-txt_key_2,ted_opt_ed_move_cursor
133
}
134
 
135
macro insert_d_poi
136
{
137
	stdcall [ted_text_add], tedit0,txt_d_poi,1,ted_opt_ed_move_cursor
138
}
139
macro insert_ret
140
{
141
	stdcall [ted_text_add], tedit0,txt_ret,4,ted_opt_ed_move_cursor
142
}
143
 
144
 
145
align 4
1711 IgorA 146
but_update:
147
	call draw_constructor
148
	cmp byte[show_mode],0 ;условие видимости окна конструктора
149
	jne @f
150
		stdcall [buf2d_draw], buf_fon
151
	@@:
1698 IgorA 152
	call code_gen
153
	cmp byte[show_mode],1 ;условие видимости текстового окна
154
	jne @f
155
		stdcall [ted_draw], tedit0
156
	@@:
157
	ret
158
 
159
;функция создающая код всего файла
160
align 4
161
code_gen:
162
	stdcall [ted_clear], tedit0,1
163
pushad
164
	stdcall dword[tl_node_poi_get_info], 0,tree2
165
	pop esi
166
	xor bl,bl
167
	call code_gen_obj
168
	stdcall [ted_text_add], tedit0,\
169
		txt_nl,1,ted_opt_ed_move_cursor+ted_opt_ed_change_time ;добавляем символ новой строки с опцией ted_opt_ed_change_time для возможности сохранения файла
170
	stdcall [ted_init_scroll_bars], tedit0, 4 ;меняем размеры скроллингов
171
popad
172
	ret
173
 
174
;input:
175
; bl - уровень объекта
176
; esi - указатель на узел
177
align 4
178
code_gen_obj:
1720 IgorA 179
push ebx edx
1698 IgorA 180
	.beg_iterat:
181
		cmp esi,0
182
		je .find_no
183
 
184
		cmp byte[esi+2],bl ;lev
185
		jl .find_no
186
 
187
		stdcall dword[tl_node_poi_get_data], esi,tree2
188
		pop eax ;получаем данные узла
189
		cmp eax,0
190
		je .find_no
191
 
1717 IgorA 192
		cmp dword[eax],C_STR
1720 IgorA 193
		jne .no_struct
194
			stdcall get_obj_text_col, eax,1 ;edx - указатель на 1-е свойство структуры
195
			stdcall insert_text,txt_struc
196
			cmp byte[edx],0
197
			jne @f
198
				stdcall insert_text,txt_t
199
			@@:
200
			insert_sp
1717 IgorA 201
			stdcall insert_text_prop, eax,0
1720 IgorA 202
 
203
			cmp byte[edx],0
204
			je @f
205
				;если структура задана макросом
206
				insert_sp
207
				stdcall insert_text_prop, eax,1
208
				insert_nl
209
				stdcall insert_text, txt_skob_fo
210
			@@:
1717 IgorA 211
			insert_nl
212
 
1698 IgorA 213
			stdcall dword[tl_node_poi_get_next_info], esi,tree2
1711 IgorA 214
			pop esi ;переходим к следущему узлу
215
			cmp esi,0
216
			je .end_st
217
			cmp byte[esi+2],bl ;lev
1698 IgorA 218
			jle .end_st
219
				push bx
220
					mov bl,byte[esi+2]
221
					call code_gen_obj ;рекурсивный вызов дочерних объектов
222
				pop bx
223
			.end_st:
1720 IgorA 224
			cmp byte[edx],0
225
			je @f
226
				;если структура задана макросом
227
				stdcall insert_text, txt_skob_fc
228
				insert_nl
229
				jmp .beg_iterat
230
			@@:
1717 IgorA 231
			stdcall insert_text,txt_ends
1698 IgorA 232
			jmp .beg_iterat
1720 IgorA 233
		.no_struct:
1717 IgorA 234
		cmp dword[eax],C_TXT
1698 IgorA 235
		jne @f
236
			stdcall get_code_text,eax ;обработка объекта
237
		@@:
1717 IgorA 238
		cmp dword[eax],C_INC
1698 IgorA 239
		jne @f
240
			stdcall get_code_incl,eax ;обработка объекта
241
		@@:
1717 IgorA 242
		cmp dword[eax],C_COM
1698 IgorA 243
		jne @f
244
			stdcall get_code_comment,eax ;обработка объекта
245
		@@:
1717 IgorA 246
		cmp dword[eax],C_VAR
1698 IgorA 247
		jne @f
248
			stdcall get_code_variable,eax,ebx ;обработка объекта
249
		@@:
1717 IgorA 250
		cmp dword[eax],C_WND
1698 IgorA 251
		jne @f
252
			stdcall get_code_window,eax ;обработка объекта
253
		@@:
1717 IgorA 254
		cmp dword[eax],C_ACO
1698 IgorA 255
		jne @f
256
			stdcall get_code_auto,eax ;обработка объекта
257
		@@:
1717 IgorA 258
		cmp dword[eax],C_KEY ;клавиатура
1698 IgorA 259
		jne @f
260
			stdcall get_code_key,eax ;обработка объекта
261
		@@:
262
 
263
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
264
		pop esi ;переходим к следущему узлу
265
 
266
		jmp .beg_iterat
267
	.find_no:
1720 IgorA 268
pop edx ebx
1698 IgorA 269
	ret
270
 
1717 IgorA 271
;добавление объекта с програмным кодом (текстом)
1698 IgorA 272
align 4
273
proc get_code_text, p_obj:dword
1717 IgorA 274
	;pushad
1698 IgorA 275
		insert_nl
1717 IgorA 276
		stdcall insert_text_prop, dword[p_obj],0
1698 IgorA 277
		insert_nl
1717 IgorA 278
	;popad
1698 IgorA 279
	ret
280
endp
281
 
1706 IgorA 282
;обработка объекта создающего автоматичексие коды
1698 IgorA 283
align 4
284
proc get_code_auto, p_obj:dword
285
	pushad
286
		insert_nl
287
		mov ebx,dword[p_obj]
1720 IgorA 288
		test_bool_prop ebx,BIT_MOD_ACI
289
		jae @f
290
			mov edx,C_CHB
291
			stdcall find_obj_in_file,edx ;eax - гЄ § вҐ«м ­  бвагЄвгаг check_box
292
			cmp eax,0
293
			je @f
294
				stdcall insert_text, txt_std_init_cb
295
		@@:
1717 IgorA 296
		test_bool_prop ebx,BIT_MOD_ACM
1698 IgorA 297
		jae @f
298
			;автоматические события от мыши
299
			call get_code_auto_m
300
		@@:
1717 IgorA 301
		test_bool_prop ebx,BIT_MOD_ABU
1698 IgorA 302
		jae @f
303
			;создание функции button
304
			insert_but_beg
305
			call get_code_auto_but ;коды вызова кнопок
306
			insert_but_end
307
			call get_code_a_but_fun ;коды функций, вызываемых при нажатии кнопок
308
		@@:
1717 IgorA 309
		test_bool_prop ebx,BIT_MOD_ACD
1698 IgorA 310
		jae @f
311
			call get_code_auto_data_el
1720 IgorA 312
 
313
			mov edx,C_CHB
314
			stdcall find_obj_in_file,edx ;eax - гЄ § вҐ«м ­  бвагЄвгаг check_box
315
			cmp eax,0
316
			je .no_check
317
				stdcall insert_text, txt_cb_b
318
				call get_code_auto_data_el_cbox
319
				stdcall insert_text, txt_cb_e
320
			.no_check:
321
 
1698 IgorA 322
			call get_code_auto_data_dop
1706 IgorA 323
 
1717 IgorA 324
			mov edx,C_LIB
1706 IgorA 325
			stdcall find_obj_in_file,edx ;eax - указатель на структуру библиотеки
326
			cmp eax,0
327
			je @f
1720 IgorA 328
				insert_nl
1706 IgorA 329
				stdcall insert_text, txt_head_i
330
				stdcall insert_text, txt_d_poi
331
				insert_nl
332
				stdcall insert_text, txt_head_l
333
				stdcall insert_text, txt_db
334
				stdcall insert_text, txt_str_beg
335
				stdcall insert_text, txt_sys_err
336
				stdcall insert_text, txt_str_end
337
				insert_nl
338
 
339
				call get_code_auto_data_libs_param
340
				stdcall insert_text, txt_ll_start
341
					call get_code_auto_data_libs_struc
342
				stdcall insert_text, txt_ll_end
343
				call get_code_auto_data_libs ;таблицы импорта библиотек
1698 IgorA 344
		@@:
345
		insert_nl
346
	popad
347
	ret
348
endp
349
 
350
align 4
351
proc get_code_auto_m
352
	pushad
353
	stdcall dword[tl_node_poi_get_info], 0,tree2
354
	pop esi
355
	.beg_iterat:
356
		cmp esi,0
357
		je .find_no
358
 
359
		stdcall dword[tl_node_poi_get_data], esi,tree2
360
		pop ebx ;получаем данные узла
361
		cmp ebx,0
362
		je .find_no
363
 
1717 IgorA 364
		cmp dword[ebx],C_EDB
1698 IgorA 365
		jne @f
366
			stdcall insert_text, txt_std_mouse_ed
1720 IgorA 367
			stdcall insert_text_prop, ebx,0
1698 IgorA 368
			insert_nl
369
		@@:
1717 IgorA 370
		cmp dword[ebx],C_CHB
1698 IgorA 371
		jne @f
372
			stdcall insert_text, txt_std_mouse_cb
1720 IgorA 373
			stdcall insert_text_prop, ebx,0
1698 IgorA 374
			insert_nl
375
		@@:
376
 
377
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
378
		pop esi ;переходим к следущему узлу
379
 
380
		jmp .beg_iterat
381
	.find_no:
382
	popad
383
	ret
384
endp
385
 
386
;создание данных (структур объектов)
387
align 4
388
proc get_code_auto_data_el
389
	pushad
390
	insert_nl ;отступ для форматирования
391
 
392
	stdcall dword[tl_node_poi_get_info], 0,tree2
393
	pop esi
394
	.beg_iterat:
395
		cmp esi,0
396
		je .find_no
397
 
398
		stdcall dword[tl_node_poi_get_data], esi,tree2
399
		pop ebx ;получаем данные узла
400
		cmp ebx,0
401
		je .find_no
402
 
1717 IgorA 403
		cmp dword[ebx],C_EDB
1698 IgorA 404
		jne @f
405
			;1,2,3,4,...,6,...8,...,10 - w,x,y,col_fon,...,col_frame,...,col_txt,...,txt
1705 IgorA 406
			stdcall insert_text_prop, ebx,0
1698 IgorA 407
			stdcall insert_text, txt_ebox
408
 
409
			mov ecx,1
410
			.prop:
411
				insert_sp
1705 IgorA 412
				stdcall insert_text_prop, ebx,ecx
1698 IgorA 413
				insert_coma
414
				inc ecx
415
				cmp ecx,10
416
			jl .prop
417
 
418
			insert_br
419
			stdcall insert_text, txt_txt
420
 
421
			mov edx,fp_icon
1714 IgorA 422
			stdcall get_obj_id_str, ebx,edx
1720 IgorA 423
			stdcall insert_text, edx
1698 IgorA 424
 
425
			stdcall insert_text, txt_mouse_dd
1711 IgorA 426
 
427
			stdcall insert_text, txt_0 ;тут будут свойства editbox а пока просто ставим 0
428
			xchg eax,edx ;сохраняем значение edx
429
			stdcall get_obj_text_col,ebx,10
430
			cmp byte[edx],0 ;проверяем пустая ли строка при запуске editbox
431
			je .null_string
432
				xchg eax,edx ;востанавливаем значение edx
433
				stdcall insert_text, txt_coma
434
 
435
				stdcall insert_text, txt_txt
436
				stdcall insert_text,edx
437
				stdcall insert_text,txt_met_end
438
				stdcall insert_text,txt_minus
439
				stdcall insert_text, txt_txt
440
				stdcall insert_text,edx
441
				stdcall insert_text,txt_minus
442
				stdcall insert_text, txt_1
443
				stdcall insert_text, txt_coma
444
 
445
				stdcall insert_text, txt_txt
446
				stdcall insert_text,edx
447
				stdcall insert_text,txt_met_end
448
				stdcall insert_text,txt_minus
449
				stdcall insert_text, txt_txt
450
				stdcall insert_text,edx
451
				stdcall insert_text,txt_minus
452
				stdcall insert_text, txt_1
453
			.null_string:
1698 IgorA 454
			insert_nl
455
		@@:
1717 IgorA 456
		cmp dword[ebx],C_DTT
1711 IgorA 457
		jne @f
1720 IgorA 458
			stdcall insert_text_label_data, ebx,0
459
		@@:
460
 
461
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
462
		pop esi ;переходим к следущему узлу
463
 
464
		jmp .beg_iterat
465
	.find_no:
466
	popad
467
	ret
468
endp
469
 
470
align 4
471
proc get_code_auto_data_el_cbox
472
	pushad
473
	insert_nl ;отступ для форматирования
474
 
475
	stdcall dword[tl_node_poi_get_info], 0,tree2
476
	pop esi
477
	.beg_iterat:
478
		cmp esi,0
479
		je .find_no
480
 
481
		stdcall dword[tl_node_poi_get_data], esi,tree2
482
		pop ebx ;получаем данные узла
483
		cmp ebx,0
484
		je .find_no
485
 
486
		cmp dword[ebx],C_CHB
487
		jne .no_check
488
			;1,2,3,4,5, 6,7,8, 9 - ot_x,ot_y,w,h,ot_w_txt, col_fon,col_frame,col_txt, txt
489
 
490
			stdcall insert_text_prop, ebx,0
491
			stdcall insert_text, txt_cbox
492
			insert_sp
493
 
494
			stdcall insert_2_prop_16_bit, ebx,1,3
495
			stdcall insert_text, txt_coma
496
			stdcall insert_2_prop_16_bit, ebx,2,4
497
			stdcall insert_text, txt_coma
498
 
499
			stdcall insert_text_prop, ebx,5
500
			stdcall insert_text, txt_coma
501
			insert_sp
502
 
503
			stdcall insert_text_prop, ebx,6
504
			stdcall insert_text, txt_coma
505
			stdcall insert_text_prop, ebx,7
506
			stdcall insert_text, txt_coma
507
			;stdcall insert_text, txt_bit_31
508
			;stdcall insert_text, txt_plus
509
			stdcall insert_text_prop, ebx,8
510
			stdcall insert_text, txt_coma
511
			stdcall insert_text, txt_br
512
 
1711 IgorA 513
			stdcall insert_text, txt_txt
514
			mov edx,fp_icon
1714 IgorA 515
			stdcall get_obj_id_str, ebx,edx
1720 IgorA 516
			stdcall insert_text, edx
517
			stdcall insert_text, txt_coma
518
 
519
			;флаги
520
			stdcall insert_text,txt_0
521
			test_bool_prop ebx,BIT_MOD_CHE
522
			jnc @f
523
				stdcall insert_text,txt_plus
524
				stdcall insert_text,txt_bit_che
525
			@@:
526
			test_bool_prop ebx,BIT_MOD_CHE_T
527
			jnc @f
528
				stdcall insert_text,txt_plus
529
				stdcall insert_text,txt_bit_che_t
530
			@@:
531
			test_bool_prop ebx,BIT_MOD_CHE_M
532
			jnc @f
533
				stdcall insert_text,txt_plus
534
				stdcall insert_text,txt_bit_che_m
535
			@@:
536
			test_bool_prop ebx,BIT_MOD_CHE_B
537
			jnc @f
538
				stdcall insert_text,txt_plus
539
				stdcall insert_text,txt_bit_che_b
540
			@@:
541
 
1711 IgorA 542
			insert_nl
1720 IgorA 543
		.no_check:
544
		cmp dword[ebx],C_DTT
545
		jne @f
546
			stdcall insert_text_label_data, ebx,0
1711 IgorA 547
		@@:
1698 IgorA 548
 
549
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
550
		pop esi ;переходим к следущему узлу
551
 
552
		jmp .beg_iterat
553
	.find_no:
554
	popad
555
	ret
556
endp
557
 
1705 IgorA 558
;данные для библиотек
559
align 4
1706 IgorA 560
proc get_code_auto_data_libs_param
561
	pushad
562
	insert_nl ;отступ для форматирования
563
 
564
	stdcall dword[tl_node_poi_get_info], 0,tree2
565
	pop esi
566
	.beg_iterat:
567
		cmp esi,0
568
		je .find_no
569
 
570
		stdcall dword[tl_node_poi_get_data], esi,tree2
571
		pop ebx ;получаем данные узла
572
		cmp ebx,0
573
		je .find_no
574
 
1717 IgorA 575
		cmp dword[ebx],C_LIB
1706 IgorA 576
		jne @f
577
			;0,1,2,3,4,5 - l_nam,s_dir,i_met,...
578
 
579
			stdcall insert_text, txt_sys_dir
580
			;object code
581
			mov edx,fp_icon
1714 IgorA 582
			stdcall get_obj_id_str, ebx,edx
1706 IgorA 583
			stdcall insert_text,edx
584
			stdcall insert_text,txt_db
585
			;stdcall insert_text, txt_str_beg
586
			stdcall insert_text_prop, ebx,1
587
			;stdcall insert_text, txt_str_end
588
			insert_nl
589
 
590
			stdcall insert_text, txt_lib_name
591
			stdcall insert_text,edx
592
			stdcall insert_text,txt_db
593
			stdcall insert_text, txt_str_beg
594
			stdcall insert_text_prop, ebx,0
595
			stdcall insert_text, txt_str_end
596
			insert_nl
597
 
598
			stdcall insert_text,txt_err_m_f_lib
599
			stdcall insert_text,edx
600
			stdcall insert_text,txt_db
601
			stdcall insert_text, txt_str_beg
602
			stdcall insert_text_prop, ebx,4
603
			stdcall insert_text, txt_str_end
604
			insert_nl
605
 
606
			stdcall insert_text,txt_err_m_i_lib
607
			stdcall insert_text,edx
608
			stdcall insert_text,txt_db
609
			stdcall insert_text, txt_str_beg
610
			stdcall insert_text_prop, ebx,5
611
			stdcall insert_text, txt_str_end
612
			insert_nl
613
 
614
			insert_nl
615
		@@:
616
 
617
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
618
		pop esi ;переходим к следущему узлу
619
 
620
		jmp .beg_iterat
621
	.find_no:
622
	popad
623
	ret
624
endp
625
 
626
;данные для библиотек
627
align 4
628
proc get_code_auto_data_libs_struc
629
	pushad
630
	;insert_nl ;отступ для форматирования
631
 
632
	stdcall dword[tl_node_poi_get_info], 0,tree2
633
	pop esi
634
	.beg_iterat:
635
		cmp esi,0
636
		je .find_no
637
 
638
		stdcall dword[tl_node_poi_get_data], esi,tree2
639
		pop ebx ;получаем данные узла
640
		cmp ebx,0
641
		je .find_no
642
 
1717 IgorA 643
		cmp dword[ebx],C_LIB
1706 IgorA 644
		jne @f
645
			;0,1,2,3,4,5 - l_nam,s_dir,i_met,...
646
 
647
			stdcall insert_text, txt_lib
648
			;object code
649
			mov edx,fp_icon
1714 IgorA 650
			stdcall get_obj_id_str, ebx,edx
1706 IgorA 651
			stdcall insert_text,edx
652
			insert_sp
653
			stdcall insert_text, txt_ll
654
			stdcall insert_text, txt_lib_name
655
			stdcall insert_text,edx
656
			stdcall insert_text,txt_coma
657
 
658
			stdcall insert_text, txt_lib_path
659
 
660
			stdcall insert_text, txt_sys_dir
661
			stdcall insert_text,edx
662
			stdcall insert_text,txt_coma
663
			stdcall insert_text,txt_br
664
			stdcall insert_text,txt_tab
665
 
666
			stdcall insert_text,txt_err_m_f_lib
667
			stdcall insert_text,edx
668
			stdcall insert_text,txt_coma
669
			stdcall insert_text,txt_head_l
670
			stdcall insert_text,txt_coma
671
 
672
			stdcall insert_text_prop, ebx,2
673
			stdcall insert_text,txt_coma
674
 
675
			stdcall insert_text,txt_err_m_i_lib
676
			stdcall insert_text,edx
677
			stdcall insert_text,txt_coma
678
			stdcall insert_text,txt_head_i
679
 
680
			insert_nl
681
		@@:
682
 
683
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
684
		pop esi ;переходим к следущему узлу
685
 
686
		jmp .beg_iterat
687
	.find_no:
688
	popad
689
	ret
690
endp
691
 
692
;данные для библиотек
693
align 4
1705 IgorA 694
proc get_code_auto_data_libs
695
	pushad
696
	insert_nl ;отступ для форматирования
697
 
698
	stdcall dword[tl_node_poi_get_info], 0,tree2
699
	pop esi
700
	.beg_iterat:
701
		cmp esi,0
702
		je .find_no
703
 
704
		stdcall dword[tl_node_poi_get_data], esi,tree2
705
		pop ebx ;получаем данные узла
706
		cmp ebx,0
707
		je .find_no
708
 
1717 IgorA 709
		cmp dword[ebx],C_LIB
1705 IgorA 710
		jne @f
711
			;0,1,2,3,4,5 - l_nam,s_dir,i_met,...
712
			stdcall insert_text, txt_align_4
713
			stdcall insert_text_prop, ebx,2
714
			stdcall insert_text, txt_d_poi
715
			insert_nl
716
 
717
			call get_code_lib_table
718
		@@:
719
 
720
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
721
		pop esi ;переходим к следущему узлу
722
 
723
		jmp .beg_iterat
724
	.find_no:
725
	popad
726
	ret
727
endp
728
 
729
;input:
730
; esi
731
align 4
732
get_code_lib_table:
733
pushad
734
	mov bl,byte[esi+2]
735
	mov edi,esi
736
	stdcall dword[tl_node_poi_get_data], esi,tree2
737
	pop edx ;получение данных родительского объекта
738
	cmp edx,0
739
	je @f
740
	@@:
741
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
742
		pop esi ;переходим к следущему узлу
743
		cmp esi,0
744
		je @f
745
		cmp byte[esi+2],bl ;lev
746
		jle @f
747
			stdcall dword[tl_node_poi_get_data], esi,tree2
748
			pop ecx ;получаем данные узла
749
			cmp ecx,0
750
			je @f
1717 IgorA 751
			cmp dword[ecx],C_IFN
1705 IgorA 752
			jne @b
753
				;вставка указателя на функцию
1720 IgorA 754
				test_bool_prop ecx,BIT_MOD_IMPORT_FUNCT_COMMENT
755
				jae .no_com_0
756
					stdcall insert_text, txt_com
757
				.no_com_0:
1705 IgorA 758
				insert_tab
759
				stdcall insert_text_prop, ecx,0
760
				stdcall insert_text, txt_dd
761
				stdcall insert_text_prop, edx,3 ;приставка к функции
762
				stdcall insert_text_prop, ecx,0
763
				insert_nl
764
			jmp @b
765
	@@:
766
	stdcall insert_text, txt_dd_0_0
767
	mov esi,edi
768
	@@:
769
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
770
		pop esi ;переходим к следущему узлу
771
		cmp esi,0
772
		je @f
773
		cmp byte[esi+2],bl ;lev
774
		jle @f
775
			stdcall dword[tl_node_poi_get_data], esi,tree2
776
			pop ecx ;получаем данные узла
777
			cmp ecx,0
778
			je @f
1717 IgorA 779
			cmp dword[ecx],C_IFN
1705 IgorA 780
			jne @b
781
				;вставка имени импортированной функции
1720 IgorA 782
				test_bool_prop ecx,BIT_MOD_IMPORT_FUNCT_COMMENT
783
				jae .no_com_1
784
					stdcall insert_text, txt_com
785
				.no_com_1:
1705 IgorA 786
				insert_tab
787
				stdcall insert_text_prop, edx,3 ;приставка к функции
788
				stdcall insert_text_prop, ecx,0
789
				stdcall insert_text, txt_db
790
				stdcall insert_text, txt_str_beg
791
				stdcall insert_text_prop, ecx,1
792
				stdcall insert_text, txt_str_end
793
				insert_nl
794
			jmp @b
795
	@@:
796
popad
797
	ret
798
 
1698 IgorA 799
;
800
align 4
801
proc get_code_auto_data_dop
802
	pushad
803
	insert_nl ;отступ для форматирования
804
 
805
	stdcall dword[tl_node_poi_get_info], 0,tree2
806
	pop esi
807
	.beg_iterat:
808
		cmp esi,0
809
		je .find_no
810
 
811
		stdcall dword[tl_node_poi_get_data], esi,tree2
812
		pop ebx ;получаем данные узла
813
		cmp ebx,0
814
		je .find_no
815
 
1717 IgorA 816
		cmp dword[ebx],C_EDB
1698 IgorA 817
		jne @f
818
			;1,2,3,4,...,6,...8,...,10 - w,x,y,col_fon,...,col_frame,...,col_txt,...,txt
819
			stdcall insert_text, txt_txt
820
			mov edx,fp_icon
1714 IgorA 821
			stdcall get_obj_id_str, ebx,edx
1711 IgorA 822
			stdcall insert_text,edx
1698 IgorA 823
 
1711 IgorA 824
			stdcall get_obj_text_col,ebx,10
825
			cmp byte[edx],0
826
			je .no_text
827
				stdcall insert_text, txt_d_poi
828
				stdcall insert_text, txt_db
829
				stdcall insert_text, txt_str_beg
830
				stdcall str_len,edx
831
				stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor
832
				stdcall insert_text, txt_str_end
833
				insert_nl
1698 IgorA 834
 
1711 IgorA 835
				insert_tab
836
				stdcall insert_text, txt_met_end
837
				stdcall insert_text, txt_rb
838
				stdcall insert_text, txt_txt
839
				mov edx,fp_icon
1714 IgorA 840
				stdcall get_obj_id_str, ebx,edx
1711 IgorA 841
				stdcall insert_text,edx
842
 
843
				stdcall insert_text, txt_minus
844
				stdcall insert_text, txt_txt
845
				stdcall insert_text,edx
846
				stdcall insert_text, txt_met_end
847
 
848
				insert_plus
849
				stdcall insert_text_prop,ebx,9
850
				insert_plus
851
				stdcall insert_text, txt_3
852
 
853
				insert_nl
854
 
855
				jmp @f
856
 
857
			.no_text: ;первоначально текст не задан
858
				stdcall insert_text, txt_times
859
 
860
				stdcall insert_text_prop,ebx,9
861
				insert_plus
862
				stdcall insert_text, txt_2
863
				stdcall insert_text, txt_db
864
				insert_0
865
				insert_nl
1698 IgorA 866
		@@:
1720 IgorA 867
		cmp dword[ebx],C_CHB
868
		jne @f
869
			stdcall insert_text_label_data, ebx,9
870
		@@:
1698 IgorA 871
 
872
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
873
		pop esi ;переходим к следущему узлу
874
 
875
		jmp .beg_iterat
876
	.find_no:
877
	popad
878
	ret
879
endp
880
 
881
;связываем кнопки с функциями
882
align 4
883
proc get_code_auto_but
884
	pushad
885
	stdcall dword[tl_node_poi_get_info], 0,tree2
886
	pop esi
887
	.beg_iterat:
888
		cmp esi,0
889
		je .find_no
890
 
891
		stdcall dword[tl_node_poi_get_data], esi,tree2
892
		pop ebx ;получаем данные узла
893
		cmp ebx,0
894
		je .find_no
895
 
1717 IgorA 896
		cmp dword[ebx],C_BUT
1698 IgorA 897
		jne @f
898
			insert_tab
899
			insert_cmp
900
			insert_reg8 txt_ah
901
			insert_coma
902
			stdcall get_obj_text_col,ebx,0
903
			stdcall str_len,edx
904
			stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor
905
			insert_nl
906
			insert_tab
907
			stdcall insert_text, txt_jne_f
908
			insert_nl
909
			insert_tab
910
			insert_tab
911
			stdcall insert_text, txt_call
912
			stdcall get_obj_text_col,ebx,6
913
			stdcall str_len,edx
914
			cmp eax,1
915
			jl .c_fun
916
				stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor
917
			.c_fun:
918
			insert_nl
919
			insert_tab
920
			insert_a_met ;@@:
921
			insert_nl
922
		@@:
923
 
924
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
925
		pop esi ;переходим к следущему узлу
926
 
927
		jmp .beg_iterat
928
	.find_no:
929
	popad
930
	ret
931
endp
932
 
933
;берем коды для функций нажатий на кнопки
934
align 4
935
proc get_code_a_but_fun
936
	pushad
937
	stdcall dword[tl_node_poi_get_info], 0,tree2
938
	pop esi
939
	.beg_iterat:
940
		cmp esi,0
941
		je .find_no
942
 
943
		stdcall dword[tl_node_poi_get_data], esi,tree2
944
		pop ebx ;получаем данные узла
945
		cmp ebx,0
946
		je .find_no
947
 
1717 IgorA 948
		cmp dword[ebx],C_BUT
1698 IgorA 949
		jne @f
950
			stdcall get_obj_text_col,ebx,6
951
			stdcall str_len,edx
952
			cmp eax,1
953
			jl .c_fun
954
				insert_nl
955
				stdcall insert_text, txt_align_4
956
				stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor
957
				insert_d_poi
958
				insert_nl
959
				insert_tab
960
				insert_ret
961
			.c_fun:
962
		@@:
963
 
964
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
965
		pop esi ;переходим к следущему узлу
966
 
967
		jmp .beg_iterat
968
	.find_no:
969
	popad
970
	ret
971
endp
972
 
973
align 4
974
proc get_code_key, p_obj:dword
975
	pushad
976
		insert_nl
977
		mov ebx,dword[p_obj]
978
 
979
		insert_key_beg
980
		call get_code_funct_key ;коды вызова кнопок
981
		insert_key_end
982
 
983
		insert_nl
984
	popad
985
	ret
986
endp
987
 
988
align 4
989
proc get_code_funct_key
990
	pushad
991
	stdcall dword[tl_node_poi_get_info], 0,tree2
992
	pop esi
993
	.beg_iterat:
994
		cmp esi,0
995
		je .find_no
996
 
997
		stdcall dword[tl_node_poi_get_data], esi,tree2
998
		pop ebx ;получаем данные узла
999
		cmp ebx,0
1000
		je .find_no
1001
 
1717 IgorA 1002
		cmp dword[ebx],C_EDB
1698 IgorA 1003
		jne @f
1004
			stdcall insert_text, txt_std_key_ed
1005
			stdcall insert_text_prop,ebx,0
1006
			insert_nl
1007
		@@:
1008
 
1009
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
1010
		pop esi ;переходим к следущему узлу
1011
 
1012
		jmp .beg_iterat
1013
	.find_no:
1014
	popad
1015
	ret
1016
endp
1017
 
1018
;объекты подключения файлов 'include ...'
1019
align 4
1020
proc get_code_incl, p_obj:dword
1021
	pushad
1022
		stdcall insert_text, txt_incl
1023
		mov ebx,dword[p_obj]
1024
		stdcall insert_text_prop,ebx,0
1025
 
1026
		stdcall get_obj_text_col,ebx,1
1027
		stdcall str_len,edx
1028
		cmp eax,1
1029
		jl @f
1030
			insert_sp
1031
			insert_com
1032
			stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor
1033
		@@:
1034
 
1035
		insert_nl
1036
	popad
1037
	ret
1038
endp
1039
 
1040
align 4
1041
proc get_code_comment, p_obj:dword
1042
	insert_com
1043
	stdcall insert_text_prop, dword[p_obj],0
1044
	insert_nl
1045
	ret
1046
endp
1047
 
1048
;создаем код задания окна
1049
align 4
1050
proc get_code_window, p_obj:dword
1051
	pushad
1052
		mov ebx,dword[p_obj]
1053
		;2,3,4,5,6 - x,y,w,h,col_bkg
1054
 
1055
		stdcall insert_text, txt_draw_wb
1056
 
1057
		insert_tab
1058
		insert_xor
1059
		insert_reg txt_eax
1060
		insert_coma
1061
		insert_reg txt_eax
1062
		insert_nl
1063
 
1064
		;mov ebx,...
1065
		insert_tab
1066
		stdcall insert_text, txt_mov
1067
		insert_reg txt_ebx
1068
		insert_coma
1720 IgorA 1069
		stdcall insert_2_prop_16_bit, ebx,2,4
1698 IgorA 1070
		insert_nl
1071
 
1072
		;mov ecx,...
1073
		insert_tab
1074
		stdcall insert_text, txt_mov
1075
		insert_reg txt_ecx
1076
		insert_coma
1720 IgorA 1077
		stdcall insert_2_prop_16_bit, ebx,3,5
1698 IgorA 1078
		insert_nl
1079
 
1080
		;mov edx,...
1081
		insert_tab
1082
		stdcall insert_text, txt_mov
1083
		insert_reg txt_edx
1084
		insert_coma
1085
		stdcall insert_text_prop, ebx,6
1086
		insert_nl
1087
 
1088
		;or edx,0x33000000
1705 IgorA 1089
		insert_tab
1698 IgorA 1090
		stdcall insert_text, txt_or
1091
		insert_reg txt_edx
1092
		insert_coma
1093
		stdcall insert_text, txt_0x33000000
1094
		insert_nl
1095
 
1096
		;mov edi,...
1097
		insert_tab
1098
		stdcall insert_text, txt_mov
1099
		insert_reg txt_edi
1100
		insert_coma
1101
		stdcall insert_text_prop, ebx,0
1102
		insert_nl
1103
 
1104
		insert_tab
1105
		stdcall insert_text, txt_i_40
1705 IgorA 1106
		insert_nl
1698 IgorA 1107
 
1108
		call get_code_draw_obj
1109
 
1705 IgorA 1110
		stdcall insert_text, txt_draw_we ;код завершающий функцию рисования
1698 IgorA 1111
	popad
1112
	ret
1113
endp
1114
 
1115
 
1116
;формируем вызов функций для рисования объектов
1117
align 4
1118
proc get_code_draw_obj
1119
	pushad
1120
	stdcall dword[tl_node_poi_get_info], 0,tree2
1121
	pop esi
1122
	.beg_iterat:
1123
		cmp esi,0
1124
		je .find_no
1125
 
1126
		stdcall dword[tl_node_poi_get_data], esi,tree2
1127
		pop ebx ;получаем данные узла
1128
		cmp ebx,0
1129
		je .find_no
1130
 
1717 IgorA 1131
		cmp dword[ebx],C_EDB
1698 IgorA 1132
		jne @f
1133
			stdcall insert_text, txt_editb_draw
1134
			stdcall insert_text_prop, ebx,0
1135
			insert_nl
1136
		@@:
1717 IgorA 1137
		cmp dword[ebx],C_CHB
1698 IgorA 1138
		jne @f
1139
			stdcall insert_text, txt_cbox_draw
1140
			stdcall insert_text_prop, ebx,0
1141
			insert_nl
1142
		@@:
1717 IgorA 1143
		cmp dword[ebx],C_BUT
1144
		jne .ob_draw_but
1698 IgorA 1145
			insert_tab
1146
			stdcall insert_text, txt_mov
1147
			insert_reg txt_eax
1148
			insert_coma
1149
			stdcall insert_text, txt_8
1150
			insert_nl
1151
 
1152
			insert_tab
1153
			stdcall insert_text, txt_mov
1154
			insert_reg txt_ebx
1155
			insert_coma
1720 IgorA 1156
			stdcall insert_2_prop_16_bit, ebx,1,3
1698 IgorA 1157
			insert_nl
1158
 
1159
			insert_tab
1160
			stdcall insert_text, txt_mov
1161
			insert_reg txt_ecx
1162
			insert_coma
1720 IgorA 1163
			stdcall insert_2_prop_16_bit, ebx,2,4
1698 IgorA 1164
			insert_nl
1165
 
1166
			insert_tab
1167
			stdcall insert_text, txt_mov
1168
			insert_reg txt_edx
1169
			insert_coma
1170
			stdcall insert_text_prop, ebx,0
1717 IgorA 1171
			test_bool_prop ebx,BIT_MOD_BUT_NFON
1172
			jnc @f
1173
				stdcall insert_text, txt_plus
1174
				stdcall insert_text, txt_bit_30
1175
			@@:
1176
			test_bool_prop ebx,BIT_MOD_BUT_NBORD
1177
			jnc @f
1178
				stdcall insert_text, txt_plus
1179
				stdcall insert_text, txt_bit_29
1180
			@@:
1698 IgorA 1181
			insert_nl
1182
 
1183
			insert_tab
1184
			stdcall insert_text, txt_mov
1185
			insert_reg txt_esi
1186
			insert_coma
1187
			stdcall insert_text_prop, ebx,5 ;button color
1188
			insert_nl
1189
 
1190
			insert_tab
1191
			stdcall insert_text, txt_i_40
1192
			insert_nl
1717 IgorA 1193
		.ob_draw_but:
1194
		cmp dword[ebx],C_REC
1698 IgorA 1195
		jne @f
1196
			insert_tab
1197
			stdcall insert_text, txt_mov
1198
			insert_reg txt_eax
1199
			insert_coma
1200
			stdcall insert_text, txt_1
1201
			stdcall insert_text, txt_3
1202
			insert_nl
1203
 
1204
			insert_tab
1205
			stdcall insert_text, txt_mov
1206
			insert_reg txt_ebx
1207
			insert_coma
1720 IgorA 1208
			stdcall insert_2_prop_16_bit, ebx,1,3
1698 IgorA 1209
			insert_nl
1210
 
1211
			insert_tab
1212
			stdcall insert_text, txt_mov
1213
			insert_reg txt_ecx
1214
			insert_coma
1720 IgorA 1215
			stdcall insert_2_prop_16_bit, ebx,2,4
1698 IgorA 1216
			insert_nl
1217
 
1218
			insert_tab
1219
			stdcall insert_text, txt_mov
1220
			insert_reg txt_edx
1221
			insert_coma
1222
			stdcall insert_text_prop, ebx,0 ;rect color
1223
			insert_nl
1224
 
1225
			insert_tab
1226
			stdcall insert_text, txt_i_40
1227
			insert_nl
1228
		@@:
1717 IgorA 1229
		cmp dword[ebx],C_DTT ;рисование текста через сист. ф. 4
1230
		jne .ob_draw_text
1711 IgorA 1231
			insert_tab
1232
			stdcall insert_text, txt_mov
1233
			insert_reg txt_eax
1234
			insert_coma
1235
			stdcall insert_text, txt_4
1236
			insert_nl
1698 IgorA 1237
 
1711 IgorA 1238
			insert_tab
1239
			stdcall insert_text, txt_mov
1240
			insert_reg txt_ebx
1241
			insert_coma
1720 IgorA 1242
			stdcall insert_2_prop_16_bit, ebx,1,2
1711 IgorA 1243
			insert_nl
1244
 
1245
			insert_tab
1246
			stdcall insert_text, txt_mov
1247
			insert_reg txt_ecx
1248
			insert_coma
1249
			stdcall insert_text_prop, ebx,3
1717 IgorA 1250
			test_bool_prop ebx,BIT_MOD_TXT_ASCII_0
1251
			jnc @f
1252
				;or ecx,0x80000000 - бит для строки ASCIIZ
1253
				stdcall insert_text,txt_plus
1254
				stdcall insert_text,txt_bit_31
1255
			@@:
1256
			test_bool_prop ebx,BIT_MOD_TXT_NO_TRAN
1257
			jnc @f
1258
				;or ecx,0x40000000 - бит для не прозрачного текста
1259
				stdcall insert_text,txt_plus
1260
				stdcall insert_text,txt_bit_30
1261
			@@:
1262
			test_bool_prop ebx,BIT_MOD_TXT_CHAR2
1263
			jnc @f
1264
				;or ecx,0x40000000 - бит для 2-го сист. шрифта
1265
				stdcall insert_text,txt_plus
1266
				stdcall insert_text,txt_bit_28
1267
			@@:
1711 IgorA 1268
			insert_nl
1269
 
1270
			insert_tab
1271
			stdcall insert_text, txt_mov
1272
			insert_reg txt_edx
1273
			insert_coma
1274
			stdcall insert_text, txt_txt
1275
			mov edx,fp_icon
1714 IgorA 1276
			stdcall get_obj_id_str, ebx,edx
1711 IgorA 1277
			stdcall insert_text,edx
1278
			insert_nl
1279
 
1280
;mov esi,...
1717 IgorA 1281
			test_bool_prop ebx,BIT_MOD_TXT_NO_TRAN
1282
			jnc @f
1283
				insert_tab
1284
				stdcall insert_text, txt_mov
1285
				insert_reg txt_edi
1286
				insert_coma
1287
				stdcall insert_text_prop, ebx,4 ;цвет фона
1288
				insert_nl
1289
			@@:
1711 IgorA 1290
 
1291
			insert_tab
1292
			stdcall insert_text, txt_i_40
1293
			insert_nl
1717 IgorA 1294
		.ob_draw_text:
1711 IgorA 1295
 
1698 IgorA 1296
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
1297
		pop esi ;переходим к следущему узлу
1298
 
1299
		jmp .beg_iterat
1300
	.find_no:
1301
	popad
1302
	ret
1303
endp
1304
 
1305
;создать код объявления переменной
1306
align 4
1307
proc get_code_variable, p_obj:dword,o_lev:dword
1308
	pushad
1309
		mov ebx,dword[p_obj]
1310
		;0,1,2 - name,value,comment
1311
 
1312
		mov ecx,dword[o_lev]
1313
		cmp cl,0
1314
		je .no_tab ;избегаем зацикливания (0-1 = 2^32-1)
1717 IgorA 1315
		and ecx,0xff
1698 IgorA 1316
		cld
1317
		@@:
1318
			insert_tab ;формирование отступа перед переменной
1319
		loop @b
1320
		.no_tab:
1321
 
1705 IgorA 1322
		stdcall insert_text_prop, ebx,0 ;имя переменной
1698 IgorA 1323
		insert_sp
1324
 
1325
		mov ecx,dword[ebx+u_object.typid-u_object] ;ecx - относительный индекс родительского объекта (в памяти)
1326
		xor eax,eax
1327
		mov ax,[tree2.info_size]
1328
		imul ecx,eax ;умножаем индекс на размер структуры
1329
		add ecx,[tree2.data_info] ;ecx - указатель данные родительского узла
1330
 
1331
		;проверку на правильность ecx ???
1332
 
1705 IgorA 1333
		stdcall insert_text_prop, ecx,0 ;тип переменной
1698 IgorA 1334
		insert_sp
1705 IgorA 1335
		stdcall insert_text_prop, ebx,1 ;значение
1698 IgorA 1336
 
1705 IgorA 1337
		stdcall get_obj_text_col,ebx,2 ;комментарий
1698 IgorA 1338
		stdcall str_len,edx
1339
		cmp eax,1
1340
		jl @f
1341
			insert_sp
1342
			insert_com
1343
			stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor
1344
		@@:
1345
		insert_nl
1346
 
1347
	popad
1348
	ret
1349
endp
1350
 
1351
 
1352
 
1353
;--- текстовые константы ---
1705 IgorA 1354
txt_str_beg db 39,0
1355
txt_str_end db 39,',0',0
1698 IgorA 1356
txt_coma db ',',0
1720 IgorA 1357
txt_skob_o db '(',0
1358
txt_skob_c db ')',0
1359
txt_skob_fo db '{',0 ;скобка фигурная открывающая
1360
txt_skob_fc db '}',0 ;скобка фигурная закрывающая
1698 IgorA 1361
txt_i_40 db 'int 0x40',13,0
1362
txt_0 db '0',0
1363
txt_1 db '1',0
1364
txt_2 db '2',0
1365
txt_3 db '3',0
1366
txt_4 db '4',0
1367
txt_8 db '8',0
1368
txt_plus db '+',0
1711 IgorA 1369
txt_minus db '-',0
1370
;txt_dol db '$',0
1698 IgorA 1371
txt_nl db 13,0
1372
txt_com db ';',0
1373
txt_sp db ' ',0
1374
txt_tab db 9,0
1375
txt_br db '\',13,9,0
1705 IgorA 1376
txt_txt db 'txt_',0
1377
txt_db db ' db ',0
1378
txt_dd db ' dd ',0
1711 IgorA 1379
txt_rb db ' rb ',0
1705 IgorA 1380
txt_dd_0_0 db 9,'dd 0,0',13,0
1381
txt_mouse_dd db ', mouse_dd, ',0
1382
txt_times db ':',13,9,'times ',0
1698 IgorA 1383
txt_draw_wb:
1384
	db 13,'align 4',13,'draw_window:',13,'pushad',13,9,'mcall 12,1',13,0
1385
txt_draw_we:
1386
	db 9,'mcall 12,2',13,'popad',13,9,'ret',13,0
1706 IgorA 1387
txt_sys_dir db 'system_dir_',0
1388
txt_lib_name db 'lib_name_',0
1389
txt_lib_path db ' sys_path, library_path, ',0
1390
txt_sys_err db '‘Ёб⥬­ п ®иЁЎЄ ',0
1391
txt_ll_start db 'l_libs_start:',13,0
1392
txt_lib db 9,'lib_',0
1393
txt_ll db 'l_libs ',0
1394
txt_err_m_f_lib db 'err_msg_found_lib_',0
1395
txt_head_l db 'head_f_l',0
1396
txt_err_m_i_lib db 'err_msg_import_',0
1397
txt_head_i db 'head_f_i',0
1398
txt_ll_end db 'l_libs_end:',13,0
1717 IgorA 1399
txt_bit_28 db '0x10000000',0
1400
txt_bit_29 db '0x20000000',0
1401
txt_bit_30 db '0x40000000',0
1402
txt_bit_31 db '0x80000000',0
1720 IgorA 1403
txt_bit_che db 'ch_flag_en',0
1404
txt_bit_che_t db 'ch_flag_top',0
1405
txt_bit_che_m db 'ch_flag_middle',0
1406
txt_bit_che_b db 'ch_flag_bottom',0
1698 IgorA 1407
txt_0x33000000 db '0x33000000',0 ;tmp
1720 IgorA 1408
txt_struc db 'struc',0
1409
txt_t db 't',0
1711 IgorA 1410
txt_met_end db '.end',0
1698 IgorA 1411
txt_ends db 'ends',13,13,0
1412
txt_mov db 'mov ',0
1413
txt_xor db 'xor ',0
1414
txt_or db 'or  ',0
1415
txt_cmp db 'cmp ',0
1416
txt_call db 'call ',0
1417
txt_jne_f db 'jne @f',0
1418
txt_a_met db '@@:',0
1419
txt_ah db 'ah',0
1420
txt_eax db 'eax',0
1421
txt_ebx db 'ebx',0
1422
txt_ecx db 'ecx',0
1423
txt_edx db 'edx',0
1424
txt_edi db 'edi',0
1425
txt_esi db 'esi',0
1426
txt_align_4 db 'align 4',13,0
1427
txt_d_poi db ':',0
1428
txt_ret db 'ret',13,0
1720 IgorA 1429
txt_shl_16 db ' shl 16',0
1698 IgorA 1430
txt_std_mouse_ed:
1431
	db 9,'stdcall [edit_box_mouse], ',0
1720 IgorA 1432
txt_std_init_cb:
1433
	db 9,'init_checkboxes2 check_boxes,check_boxes_end',13,0
1698 IgorA 1434
txt_std_mouse_cb:
1435
	db 9,'stdcall [check_box_mouse], ',0
1436
txt_std_key_ed:
1437
	db 9,'stdcall [edit_box_key], ',0
1438
txt_incl:
1439
	db 'include ',0
1720 IgorA 1440
 
1441
txt_cbox db ' check_box2',0
1442
txt_cb_b db 13,'check_boxes:',0
1443
txt_cb_e db 'check_boxes_end:',13,0
1444
 
1706 IgorA 1445
txt_ebox db ' edit_box',0
1698 IgorA 1446
txt_editb_draw:
1447
	db 9,'stdcall [edit_box_draw], ',0
1448
txt_cbox_draw:
1449
	db 9,'stdcall [check_box_draw], ',0
1450
 
1451
txt_but_1:
1452
db 'align 4',13,'button:',13,9,'mcall 17',13
1453
txt_but_2:
1454
db 9,'cmp ah,1',13,9,'jne still',13,'.exit:',13,9,'mcall -1',13
1455
txt_but_3:
1456
 
1457
txt_key_1:
1458
db 'align 4',13,'key:',13,9,'mcall 2',13
1459
txt_key_2:
1460
db 9,'jmp still',13
1461
txt_key_3:
1462
 
1714 IgorA 1463
;получаем порядковый номер объекта относительно памяти элемента tree2
1464
;output:
1465
; txt_buf - строка с номером объекта
1698 IgorA 1466
align 4
1714 IgorA 1467
proc get_obj_id_str, p_obj:dword, txt_buf:dword
1698 IgorA 1468
	push eax ecx edx
1469
	mov eax,dword[p_obj]
1470
	sub eax,[tree2.data_info]
1471
	xor edx,edx
1472
	xor ecx,ecx
1473
	mov cx,word[tree2.info_size]
1474
	div ecx
1475
 
1476
	mov edx,dword[txt_buf]
1477
	mov byte[edx],0
1478
	stdcall str_cat_value,edx,eax
1479
	pop edx ecx eax
1480
	ret
1481
endp
1482
 
1714 IgorA 1483
;получаем порядковый номер объекта относительно памяти элемента tree2
1484
;output:
1485
; eax - номер объекта
1486
align 4
1487
proc get_obj_id, p_obj:dword
1488
	push ecx edx
1489
	mov eax,dword[p_obj]
1490
	sub eax,[tree2.data_info]
1491
	xor edx,edx
1492
	xor ecx,ecx
1493
	mov cx,word[tree2.info_size]
1494
	div ecx
1495
	pop edx ecx
1496
	ret
1497
endp
1498
 
1698 IgorA 1499
;--- текстовые функции ---
1500
 
1501
align 4
1502
proc mem_clear, mem:dword, len:dword
1503
	push eax ecx edi
1504
	cld
1505
	xor al,al
1506
	mov edi, dword[mem]
1507
	mov ecx, dword[len]
1508
	repne stosb
1509
	pop edi ecx eax
1510
	ret
1511
endp
1512
 
1513
align 4
1514
proc str_cat, str1:dword, str2:dword
1515
	push eax ecx edi esi
1516
	mov esi,dword[str2]
1517
	stdcall str_len,esi
1518
	mov ecx,eax
1519
	inc ecx
1520
	mov edi,dword[str1]
1521
	stdcall str_len,edi
1522
	add edi,eax
1523
	cld
1524
	repne movsb
1525
	pop esi edi ecx eax
1526
	ret
1527
endp
1528
 
1529
align 4
1530
proc str_cat_value, str1:dword, value:dword
1531
	pushad
1532
	mov edi,[str1]
1533
	stdcall str_len,edi
1534
	add edi,eax
1535
	mov eax,[value]
1536
	call tl_convert_to_str
1537
	popad
1538
	ret
1539
endp
1540
 
1541
;output:
1542
; eax = strlen
1543
align 4
1544
proc str_len, str1:dword
1545
	mov eax,[str1]
1546
	@@:
1547
		cmp byte[eax],0
1548
		je @f
1549
		inc eax
1550
		jmp @b
1551
	@@:
1552
	sub eax,[str1]
1553
	ret
1554
endp
1555
 
1556
;input:
1557
; eax = value
1558
; edi = string buffer
1559
align 4
1560
tl_convert_to_str:
1561
	pushad
1562
	stdcall mem_clear,edi,12
1563
	call .str
1564
	popad
1565
	ret
1566
 
1567
align 4
1568
.str:
1569
	mov ecx,0x0a ;задается система счисления изменяются регистры ebx,eax,ecx,edx входные параметры eax - число
1570
		;преревод числа в ASCII строку входные данные ecx=система счисленя edi адрес куда записывать, будем строку, причем конец переменной
1571
	cmp eax,ecx  ;сравнить если в eax меньше чем в ecx то перейти на @@-1 т.е. на pop eax
1572
	jb @f
1573
		xor edx,edx ;очистить edx
1574
		div ecx     ;разделить - остаток в edx
1575
		push edx    ;положить в стек
1576
		;dec edi    ;смещение необходимое для записи с конца строки
1577
		call .str   ;перейти на саму себя т.е. вызвать саму себя и так до того момента пока в eax не станет меньше чем в ecx
1578
		pop eax
1579
	@@: ;cmp al,10 ;проверить не меньше ли значение в al чем 10 (для системы счисленя 10 данная команда - лишная))
1580
	or al,0x30  ;данная команда короче  чем две выше
1581
	stosb	    ;записать элемент из регистра al в ячеку памяти es:edi
1582
	ret