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