Subversion Repositories Kolibri OS

Rev

Rev 7579 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. struct symbol
  2.         c db ?    ; +0 ᨬ¢®«
  3.         col db ?  ; +1 梥â
  4.         perv dd ? ; +2
  5.         next dd ? ; +6 㪠§ â¥«¨
  6.         tc dd ?   ;+10 ¢à¥¬. ᮧ¤ ­¨ï
  7.         td dd ?   ;+14 ¢à¥¬. 㤠«¥­¨ï
  8. ends
  9.  
  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.  
  40. bmp_icon dd 0
  41.  
  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
  90.                 call but_panel_find
  91.                 jmp still
  92.         @@:
  93.         cmp ah,ID_BUT_REPLACE
  94.         jne @f
  95.                 call but_panel_replace
  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
  140.                 call but_panel_choose_syntax
  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.         @@:
  153.  
  154.         cmp ah,200
  155.         jne @f
  156.                 stdcall ted_but_open_syntax, tedit0
  157.                 jmp still
  158.         @@:
  159.         cmp ah,201 ;­ ©â¨ ¤ «¥¥
  160.         jne .no_find
  161.                 call get_find_options
  162.                 stdcall [ted_but_find], tedit0, eax
  163.                 jmp still
  164.         .no_find:
  165.         cmp ah,202 ;§ ¬¥­¨âì
  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:
  174.         cmp ah,203 ;§ ¬¥­¨âì ¢á¥
  175.         jne @f
  176.                 call but_replace_all
  177.                 jmp still
  178.         @@:
  179.         cmp ah,204 ;¯¥à¥©â¨ ­  áâபã
  180.         jne @f
  181.                 call but_goto_line
  182.                 jmp still
  183.         @@:
  184.  
  185.         cmp ah,1
  186.         jne @f
  187.                 call ted_Exit
  188.                 jmp still
  189.         @@:
  190.  
  191.         cmp ah,199
  192.         jne still
  193.                 call ted_Exit
  194.         jmp still
  195.  
  196. align 4
  197. ted_Exit:
  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
  203.                 mov dword[wnd_k_words_run],0
  204.                 ;test eax,eax
  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
  213.                 ret
  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 ;¢ë室 ¨§ ¯à®£à ¬¬ë
  223.         ;ret
  224.  
  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.         bt dword[ch1.flags],1
  236.         jc @f
  237.                 bts eax,30
  238.         @@:
  239.         ret
  240.  
  241. align 4
  242. proc but_replace_all uses ebx ecx edx
  243.         call get_find_options
  244.         mov ebx,eax
  245.         stdcall [ted_but_replace], tedit0, buf_replace, ebx, 1
  246.         xor edx,edx
  247.         or eax,eax
  248.         jz @f
  249.         inc edx
  250.         mov ecx,0x1000
  251.         .cycle0:
  252.                 stdcall [ted_but_replace], tedit0, buf_replace, ebx, 0
  253.                 or eax,eax
  254.                 jz @f
  255.                 inc edx
  256.                 loop .cycle0
  257.         @@:
  258.         or edx,edx
  259.         jz @f
  260.                 stdcall [ted_draw], tedit0
  261.         @@:
  262.         mov eax,edx
  263.         mov edi,msgbox_1.z
  264.         stdcall convert_int_to_str, 8
  265.         stdcall str_cat, edi,txt_Info
  266.         notify_window_run msgbox_1
  267.         ret
  268. endp
  269.  
  270. align 4
  271. proc but_goto_line uses eax
  272.         stdcall conv_str_to_int, buf_goto
  273.         stdcall [ted_go_to_position], tedit0,eax,1
  274.         ret
  275. endp
  276.  
  277. ;input:
  278. ; al = ª®¤ ®è¨¡ª¨
  279. align 4
  280. ted_on_init_synt_err:
  281.         mov byte[msgbox_3.err],'0'
  282.         add byte[msgbox_3.err],al
  283.         stdcall [mb_create],msgbox_3,thread ;message: Can-t open color options file!
  284.         ret
  285.  
  286. align 4
  287. ted_but_new_file:
  288.         push eax ebx
  289.         stdcall [ted_can_save], tedit0
  290.         cmp al,1
  291.         jne @f
  292.                 stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
  293.                 stdcall [mb_setfunctions],msgbox_2N_funct
  294.                 jmp .ret_f
  295.         @@:
  296.         call On_NewFile
  297.         .ret_f:
  298.                 mov byte[openfile_path],0
  299.                 mcall SF_SET_CAPTION,1,hed
  300.         pop ebx eax
  301.         ret
  302.  
  303. align 4
  304. On_NewFile:
  305.         stdcall [ted_clear], tedit0,1
  306.         call draw_but_toolbar
  307.         stdcall [ted_draw], tedit0
  308.         mov dword[openfile_path],0
  309.         ret
  310.  
  311. align 4
  312. On_SaveAndNewFile:
  313.         push edi
  314.         mov edi, tedit0
  315.  
  316.         call ted_but_save_file
  317.         cmp ted_err_save,0
  318.         jne @f
  319.                 call On_NewFile
  320.         @@:
  321.         pop edi
  322.         ret
  323.  
  324. align 4
  325. On_SaveAndOpenFile:
  326.         push edi
  327.         mov edi, tedit0
  328.  
  329.         call ted_but_save_file
  330.         cmp ted_err_save,0
  331.         jne @f
  332.                 call ted_but_open_file.no_msg
  333.         @@:
  334.         pop edi
  335.         ret
  336.  
  337. align 4
  338. On_SaveAndExit:
  339.         push edi
  340.         mov edi, tedit0
  341.  
  342.         call ted_but_save_file
  343.         cmp ted_err_save,0
  344.         jne @f
  345.                 mov dword[exit_code],1
  346.         @@:
  347.         pop edi
  348.         ret
  349.  
  350. align 4
  351. On_Exit:
  352.         mov dword[exit_code],1
  353.         ret
  354.  
  355. ;description:
  356. ; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ¡¥§ ®ª­  á®®¡é¥­¨ï
  357. align 4
  358. proc but_no_msg_OpenFile uses eax ebx esi
  359.         stdcall [ted_open_file], tedit0,run_file_70,openfile_path
  360.         call ted_messages_after_open_file
  361.  
  362.         mov esi,openfile_path
  363.         stdcall str_len,esi
  364.         add esi,eax
  365.         @@: ;横« ¤«ï ¯®¨áª  ­ ç «  ¨¬¥­¨ ä ©« 
  366.                 dec esi
  367.                 cmp byte[esi],'/'
  368.                 je @f
  369.                 cmp byte[esi],0x5c ;'\'
  370.                 je @f
  371.                 cmp esi,openfile_path
  372.                 jg @b
  373.         @@:
  374.         inc esi
  375.         stdcall str_len,esi
  376.         cmp eax,255
  377.         jle @f
  378.                 mov eax,255
  379.         @@:
  380.         inc eax ;¤«ï 0 ¢ ª®­æ¥ áâப¨
  381.         stdcall mem_cpy, filename_area,esi,eax ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¤¨ «®£ á®åà ­¥­¨ï
  382.         ret
  383. endp
  384.  
  385. ;description:
  386. ; äã­ªæ¨ï ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,F,S,H,G
  387. align 4
  388. proc ted_but_ctrl_all uses eax, opt_key:dword
  389.         mov eax,[opt_key]
  390.         cmp al,'N' ;Ctrl+N
  391.         jne @f
  392.                 call ted_but_new_file
  393.                 jmp .end0
  394.         @@:
  395.         cmp al,'O' ;Ctrl+O
  396.         jne @f
  397.                 call ted_but_open_file
  398.                 jmp .end0
  399.         @@:
  400.         cmp al,'S' ;Ctrl+S
  401.         jne @f
  402.                 shr eax,8
  403.                 call ted_but_save_file
  404.                 jmp .end0
  405.         @@:
  406.         cmp al,'F' ;Ctrl+F
  407.         jne @f
  408.                 call but_panel_find
  409.                 jmp .end0
  410.         @@:
  411.         cmp al,'G' ;Ctrl+G
  412.         jne @f
  413.                 call but_panel_goto
  414.                 jmp .end0
  415.         @@:
  416.         cmp al,'H' ;Ctrl+H
  417.         jne .end0
  418.                 call but_panel_replace
  419.         .end0:
  420.         ret
  421. endp
  422.  
  423. ;description:
  424. ; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
  425. align 4
  426. ted_but_open_file:
  427.         pushad
  428.  
  429.         stdcall [ted_can_save], tedit0
  430.         cmp al,1
  431.         jne @f
  432.                 stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
  433.                 stdcall [mb_setfunctions],msgbox_2O_funct
  434.                 jmp .ret_f
  435.         .no_msg: ;¬¥âª  ¤«ï ¢ë§®¢  ä㭪樨 ç¥à¥§ ª­®¯ªã ¢ á®®¡é¥­¨¨ msgbox_5
  436.                 pushad
  437.         @@:
  438.  
  439.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  440.         mov [OpenDialog_data.type],0
  441.         stdcall [OpenDialog_Start],OpenDialog_data
  442.         cmp [OpenDialog_data.status],2
  443.         jne @f
  444.                 stdcall mem_spac, msgbox_9.fdp,100
  445.                 stdcall str_len,file_name
  446.                 cmp eax,100
  447.                 jle .no_crop
  448.                         mov eax,100
  449.                 .no_crop:
  450.                 stdcall mem_cpy, msgbox_9.fdp,esi,eax
  451.                 stdcall [mb_create],msgbox_9,thread ;message: error run 'open file dialog'
  452.                 jmp .ret_f
  453.         @@:
  454.         cmp [OpenDialog_data.status],1
  455.         jne .ret_f
  456.                 stdcall auto_open_syntax,[OpenDialog_data.openfile_path]
  457.                 stdcall [ted_open_file], tedit0,run_file_70,openfile_path
  458.                 call ted_messages_after_open_file
  459.         .ret_f:
  460.         popad
  461.         ret
  462.  
  463. proc auto_open_syntax, of_path:dword
  464. pushad
  465.         ;¨é¥¬ ¥áâì «¨ ä ©« ¯®¤á¢¥âª¨ ¤«ï ®âªà뢠¥¬®£® ⥪á⮢®£® ä ©« 
  466.         stdcall str_len,[of_path]
  467.         mov edx,[of_path]
  468.         add edx,eax
  469.         .f_beg:
  470.         cmp byte[edx],'.'
  471.         je .found
  472.                 dec edx
  473.                 cmp edx,[of_path]
  474.                 jg .f_beg
  475.         .found:
  476.         inc edx ;edx - 㪠§ â¥«ì ­  à áè¨à¥­¨¥ ®âªàë⮣® ä ©« 
  477.  
  478.         mov ebx,synt_auto_open
  479.         .cycle_0:
  480.                 add ebx,32
  481.                 stdcall strcmp,ebx,edx ;áà ¢­¨¢ ¥¬ à áè¨à¥­¨¥ ®âªàë⮣® ä ©«  á® §­ ç¥­¨ï¬¨ ®âªàëâ묨 á ini ä ©« 
  482.                 test eax,eax
  483.                 jz .ok
  484.                 add ebx,32
  485.                 cmp byte[ebx],0
  486.                 jne .cycle_0
  487.         jmp .end_0
  488.         .ok: ;®âªàë⨥ ä ©«  ¯®¤á¢¥âª¨ ¢ § ¢¨á¨¬®á⨠®â ­ ©¤¥­­®£® à áè¨à¥­¨ï
  489.                 sub ebx,32
  490.                 stdcall open_unpac_synt_file,ebx
  491.         .end_0:
  492. popad
  493.         ret
  494. endp
  495.  
  496. ;input:
  497. ; eax ¥á«¨ à ¢¥­: 0 - á®åà ­¥­¨¥ ¡¥§ ¤¨ «®£ , 1 - á®åà ­¥­¨¥ á ¤¨ «®£®¬
  498. ;description:
  499. ; äã­ªæ¨ï á®åà ­¥­¨ï ä ©« 
  500. align 4
  501. proc ted_but_save_file
  502.         or eax,eax
  503.         jnz .init_dlg
  504.                 ; á®å࠭塞 ¡¥§ ¢ë§®¢  ¤¨ «®£®¢®£® ®ª­ 
  505.                 cmp byte[openfile_path],0
  506.                 jne @f
  507.         .init_dlg:
  508.                 ; ¢ë§®¢ ¤¨ «®£®¢®£® ®ª­  ¤«ï á®åà ­¥­¨ï ä ©« 
  509.                 copy_path open_dialog_name,communication_area_default_path,file_name,0
  510.                 mov [OpenDialog_data.type],1
  511.                 stdcall [OpenDialog_Start],OpenDialog_data
  512.                 cmp [OpenDialog_data.status],1 ;if status==1 then save
  513.                 jne .end_save
  514.         @@:
  515.                 stdcall [ted_save_file],tedit0,run_file_70,openfile_path
  516.         .end_save:
  517.         ret
  518. endp
  519.  
  520. ;description:
  521. ; ª®¯¨à®¢ ­¨¥ ¯ ¬ïâ¨
  522. align 4
  523. proc mem_cpy uses ecx esi edi, destination:dword, source:dword, len:dword
  524.         cld
  525.         mov esi,[source]
  526.         mov edi,[destination]
  527.         mov ecx,[len]
  528.         rep movsb
  529.         ret
  530. endp
  531.  
  532. ;description:
  533. ; § ¯®«­¥­¨¥ ¯ ¬ï⨠¯à®¡¥« ¬¨
  534. align 4
  535. proc mem_spac uses eax ecx edi, mem:dword, len:dword
  536.         cld
  537.         mov al,' '
  538.         mov edi,[mem]
  539.         mov ecx,[len]
  540.         repne stosb
  541.         ret
  542. endp
  543.  
  544. ;input:
  545. ; eax = ª®¤ ®è¨¡ª¨
  546. ; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ­­ëå ¡ ©â
  547. align 4
  548. ted_messages_after_open_file:
  549.         push ecx edi
  550.         or eax,eax
  551.         jz @f
  552.                 cmp ax,10
  553.                 jl .zifra_0_9
  554.                         mov al,'?'
  555.                         sub ax,48
  556.                 .zifra_0_9:
  557.                 add ax,48
  558.  
  559.                 mov byte[msgbox_4.err],al
  560.                 stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
  561.         @@:
  562.         pop edi ecx
  563.         ret
  564.  
  565. align 4
  566. ted_save_err_msg:
  567.         mov byte[msgbox_6.err],al
  568.         stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
  569.         ret
  570.  
  571. ;description:
  572. ; äã­ªæ¨ï ­ ¦ â¨ï ­  ª­®¯ªã [à¨¬¥­¨âì] ¢ ¯ ­¥«¨ ᨭ⠪á¨á 
  573. align 4
  574. proc ted_but_open_syntax uses eax ebx ecx edi, edit:dword
  575.         mov edi,[edit]
  576.         cmp ted_panel_id,TED_PANEL_SYNTAX
  577.         jne @f
  578.                 stdcall [tl_node_get_data], tree1
  579.                 mov [fn_col_option],eax
  580.                 stdcall open_unpac_synt_file,eax
  581.                 cmp ebx,-1
  582.                 je @f
  583.  
  584.                 call [ted_text_colored]
  585.                 stdcall [ted_draw],edi
  586.         @@:
  587.         ret
  588. endp
  589.  
  590. ;®âªàë⨥ ¨ à á¯ ª®¢ª  ä ©«  ¯®¤á¢¥âª¨ ᨭ⠪á¨á 
  591. ;input:
  592. ; f_name - 㪠§ â¥«ì ­  ¨¬ï ®âªà뢠¥¬®£® ä ©«  ᨭ⠪á¨á  (¡¥§ ¯ã⨠¨ ¯ ¯ª¨ info)
  593. ;output:
  594. ; ebx - ç¨á«® ¯à®ç¨â ­­ëå ¡ ©â ¨§ ä ©« 
  595. ; ecx - à §àãè ¥âáï
  596. align 4
  597. proc open_unpac_synt_file uses eax edi esi, f_name:dword
  598.         mov ebx,[f_name]
  599.         cmp byte[ebx],0
  600.         je @f
  601.         mov edi,last_open_synt_file
  602.         stdcall strcmp,ebx,edi ;áà ¢­¨¢ ¥¬ ¨¬ï ¯®¤ª«î祭­®£® ä ©«  á ¯®¤ª«î祭­ë¬ à ­¥¥ ä ©«®¬
  603.         test eax,eax
  604.         jz @f
  605.  
  606.         ;ª®¯¨à㥬 ¨¬ï ¯®¤ª«î祭­®£® ä ©«  (¤«ï ¨§¡¥¦ ­¨ï ¯®¢â®à­ëå ¯®¤ª«î祭¨©)
  607.         mov esi,ebx
  608.         mov ecx,32/4
  609.         cld
  610.         rep movsd
  611.  
  612.         copy_path ebx,fn_syntax_dir,syntax_path,0
  613.         copy_path syntax_path,sys_path,file_name,0
  614.         mov edi, tedit0
  615.         mov [run_file_70.Function], SSF_READ_FILE
  616.         mov [run_file_70.Position], 0
  617.         mov [run_file_70.Flags], 0
  618.         mov ecx, ted_syntax_file_size
  619.         mov dword[run_file_70.Count], ecx
  620.         m2m dword[run_file_70.Buffer], ted_syntax_file
  621.         mov byte[run_file_70+20], 0
  622.         mov [run_file_70.FileName], file_name
  623.         mcall SF_FILE, run_file_70
  624.         cmp ebx,-1
  625.         jne .end_0
  626.                 call ted_on_init_synt_err
  627.                 jmp @f
  628.         .end_0:
  629.                 mov eax,ted_syntax_file
  630.                 cmp dword[eax],'KPCK'
  631.                 jne .end_unpack
  632.                 cmp dword[eax+4],ecx
  633.                 jg @f ;¥á«¨ ¤«ï à á¯ ª®¢ ­®£® ä ©«  ­¥ 墠⠥⠢뤥«¥­­®© ¯ ¬ïâ¨
  634.                 cmp dword[unpac_mem],0
  635.                 jne .end_1
  636.                         ;¢ë¤¥«¥­¨¥ ¯ ¬ï⨠¤«ï à á¯ ª®¢ª¨ ä ©« 
  637.                         stdcall mem.Alloc,ecx
  638.                         mov [unpac_mem],eax
  639.                 .end_1:
  640.                 stdcall unpack,ted_syntax_file,[unpac_mem]
  641.                 mov edi,ted_syntax_file
  642.                 mov esi,[unpac_mem]
  643.                 mov ecx,[edi+4]
  644.                 cld
  645.                 rep movsb
  646.                 .end_unpack:
  647.                 stdcall [ted_init_syntax_file], tedit0
  648.         @@:
  649.         ret
  650. endp
  651.  
  652. ;description:
  653. ; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
  654. align 4
  655. proc but_panel_find
  656.         stdcall on_panel_change, tedit0,TED_PANEL_FIND
  657.         ;or word[edit_find.flags],ed_focus
  658.         ret
  659. endp
  660.  
  661. ;description:
  662. ; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯¥à¥å®¤ 
  663. align 4
  664. proc but_panel_goto
  665.         stdcall on_panel_change, tedit0,TED_PANEL_GOTO
  666.         ;or word[edit_goto.flags],ed_focus
  667.         ret
  668. endp
  669.  
  670. ;description:
  671. ; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ § ¬¥­ë
  672. align 4
  673. proc but_panel_replace
  674.         stdcall on_panel_change, tedit0,TED_PANEL_REPLACE
  675.         ;or word[edit_find.flags],ed_focus
  676.         ret
  677. endp
  678.  
  679. ;description:
  680. ; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ á ä ©« ¬¨ ᨭ⠪á¨á 
  681. align 4
  682. proc but_panel_choose_syntax
  683.         stdcall on_panel_change, tedit0,TED_PANEL_SYNTAX
  684.         ret
  685. endp
  686.  
  687. align 4
  688. proc on_panel_change uses eax edi, edit:dword, new_id:dword
  689.         mov edi,[edit]
  690.         mov eax,[new_id]
  691.  
  692.         ;if(panel_id==new_id) panel_id=0, draw all
  693.         cmp ted_panel_id,al
  694.         jne @f
  695.                 mov ted_panel_id,TED_PANEL_NULL
  696.                 mov ted_wnd_l,0
  697.                 jmp .e_if
  698.         @@:
  699.         ;elseif(panel_id==0) panel_id=new_id, draw all
  700.         cmp ted_panel_id,TED_PANEL_NULL
  701.         jne @f
  702.                 mov ted_panel_id,al
  703.                 mov ted_wnd_l,TED_PANEL_WIDTH
  704.         .e_if:
  705.         call EvSize
  706.         stdcall [ted_draw],edi
  707.         jmp .end0
  708.         ;else panel_id=new_id, draw panel
  709.         @@:
  710.                 mov ted_panel_id,al
  711.                 stdcall draw_panels,edi
  712.         .end0:
  713.         ret
  714. endp
  715.  
  716. align 4
  717. tbl_1251_866:
  718. rb 128
  719. db   0,  0,  0,  0,  0,  0,  0,  0,  0,0,0,0,0,0,0,0 ;128
  720. db   0,  0,  0,  0,  0,  0,  0,  0,  0,0,0,0,0,0,0,0 ;144
  721. db   0,  0,  0,  0,  0,  0,  0,  0,240,0,0,0,0,0,0,0 ;160
  722. db   0,  0,  0,  0,  0,  0,  0,  0,241,0,0,0,0,0,0,0 ;176
  723. db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 ;192
  724. db 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159 ;208
  725. db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 ;224
  726. db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ;240
  727.  
  728. align 4
  729. tbl_866_1251:
  730. rb 128
  731. db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 ;128
  732. db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 ;144
  733. db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ;160
  734. db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;176
  735. db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;192
  736. db   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;208
  737. db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 ;224
  738. db 168,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;240
  739.  
  740. align 4
  741. ted_on_find_err:
  742.         notify_window_run msgbox_7 ;message: Can not find text
  743.         ret
  744.  
  745. ;description:
  746. ; äã­ªæ¨ï ¯®¨áª  ¨­ä®à¬ æ¨¨ ¢ ᯨ᪥ ª«î祢ëå á«®¢
  747. align 4
  748. but_find_key_w:
  749.         cmp dword[wnd_k_words_run],0
  750.         jne @f
  751.                 pushad
  752.                 mcall SF_CREATE_THREAD,1,prop_start,thread_coords
  753.                 mov [wnd_k_words_run],eax
  754.                 popad
  755.         @@:
  756.         ret
  757.  
  758. ;description:
  759. ; ¢ë¤¥«¥­¨¥/áªàë⨥ ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
  760. align 4
  761. proc but_sumb_invis uses edi, edit:dword
  762.         mov edi,[edit]
  763.  
  764.         xor ted_mode_invis,1
  765.         call draw_but_toolbar
  766.         stdcall [ted_draw],edi
  767.         ret
  768. endp
  769.  
  770. ;description:
  771. ; ¢ë¤¥«¥­¨¥/áªàë⨥ ª«î祢ëå á«®¢
  772. align 4
  773. proc but_use_syntax uses edi, edit:dword
  774.         mov edi,[edit]
  775.  
  776.         xor ted_mode_color,1
  777.         cmp ted_mode_color,0
  778.         je @f
  779.                 call [ted_text_colored]
  780.         @@:
  781.         call draw_but_toolbar
  782.         stdcall [ted_draw],edi
  783.         ret
  784. endp
  785.  
  786.