Subversion Repositories Kolibri OS

Rev

Rev 7508 | Rev 7571 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;Ž£à®¬­ ï ¡« £®¤ à­®áâì ¢á¥¬, ªâ® ¯®¬®£ «: ª®¤®¬/ᮢ¥â®¬/¤¨§ ©­®¬ ...
  2.  
  3. use32
  4.   org 0
  5.   db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
  6.   dd 1, start, i_end, mem, stacktop, file_name, sys_path
  7.  
  8. MAX_COLOR_WORD_LEN equ 40
  9. maxChars equ 100002 ;(ª®««¨ç¥á⢮ ᨬ¢®«®¢ ¢ ­®¢®¬ ¤®ªã¬¥­â¥ + 2)
  10. BUF_SIZE equ 4096 ;buffer for copy|paste
  11. maxSyntaxFileSize equ 410000
  12. TOOLBAR_ICONS_SIZE equ 1200*20
  13.  
  14. include '../../proc32.inc'
  15. include '../../macros.inc'
  16. include '../../KOSfuncs.inc'
  17. include '../../load_img.inc'
  18. include '../../develop/libraries/box_lib/trunk/box_lib.mac'
  19. include '../../system/skincfg/trunk/kglobals.inc'
  20. include '../../system/skincfg/trunk/unpacker.inc'
  21. include 'lang.inc'
  22.  
  23. include 't_data.inc'
  24. include 't_menu.inc'
  25. include 'strlen.inc'
  26. include 't_draw.inc' ;draw main window functions
  27. include 't_button.inc' ;text work functions
  28. include 'wnd_k_words.inc'
  29.  
  30. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  31.  
  32. align 4
  33. icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
  34. run_file_70 FileInfoBlock
  35.  
  36. align 4
  37. start:
  38.         mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
  39.  
  40.         mcall SF_SYS_MISC,SSF_HEAP_INIT
  41.         or eax,eax
  42.         jz button.exit
  43.  
  44.         mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
  45.         mcall SF_SET_EVENTS_MASK,0xC0000027
  46.  
  47.         mov esi,file_name
  48.         call strlen
  49.         mov ecx,eax
  50.         mov edi,openfile_path
  51.         cld
  52.         rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¡ãä¥à openfile_path
  53.  
  54. load_libraries l_libs_start,load_lib_end
  55.  
  56. ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
  57. mov     ebp,lib0
  58. .test_lib_open:
  59.         cmp     dword [ebp+ll_struc_size-4],0
  60.         jz      @f
  61.         mcall SF_TERMINATE_PROCESS ;exit not correct
  62. @@:
  63.         add ebp,ll_struc_size
  64.         cmp ebp,load_lib_end
  65.         jl .test_lib_open
  66.  
  67. ;---------------------------------------------------------------------
  68.         stdcall [ted_init], tedit0
  69.         stdcall [tl_data_init], tree1
  70.  
  71. ; OpenDialog initialisation
  72.         stdcall [OpenDialog_Init],OpenDialog_data
  73.  
  74. ; kmenu initialisation 
  75.         stdcall [kmenu_init], sc
  76.        
  77.         stdcall [ksubmenu_new]
  78.         mov [main_menu], eax
  79.        
  80.         stdcall [ksubmenu_new]
  81.         mov [main_menu_file], eax
  82.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_File_New, 3
  83.         stdcall [ksubmenu_add], [main_menu_file], eax
  84.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_File_Open, 4
  85.         stdcall [ksubmenu_add], [main_menu_file], eax
  86.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_File_Save, 5
  87.         stdcall [ksubmenu_add], [main_menu_file], eax
  88.         stdcall [kmenuitem_new], KMENUITEM_SEPARATOR, 0, 0
  89.         stdcall [ksubmenu_add], [main_menu_file], eax
  90.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_File_Exit, 199
  91.         stdcall [ksubmenu_add], [main_menu_file], eax  
  92.         stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_File, [main_menu_file]
  93.         stdcall [ksubmenu_add], [main_menu], eax
  94.  
  95.         stdcall [ksubmenu_new]
  96.         mov [main_menu_changes], eax
  97.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Changes_Undo, 16
  98.         stdcall [ksubmenu_add], [main_menu_changes], eax
  99.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Changes_Redo, 17
  100.         stdcall [ksubmenu_add], [main_menu_changes], eax
  101.         stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_Changes, [main_menu_changes]
  102.         stdcall [ksubmenu_add], [main_menu], eax
  103.        
  104.         stdcall [ksubmenu_new]
  105.         mov [main_menu_buf], eax
  106.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Buf_Cut, 7
  107.         stdcall [ksubmenu_add], [main_menu_buf], eax
  108.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Buf_Copy, 8
  109.         stdcall [ksubmenu_add], [main_menu_buf], eax
  110.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Buf_Paste, 9
  111.         stdcall [ksubmenu_add], [main_menu_buf], eax   
  112.         stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_Buf, [main_menu_buf]
  113.         stdcall [ksubmenu_add], [main_menu], eax
  114.  
  115.         stdcall [ksubmenu_new]
  116.         mov [main_menu_search], eax
  117.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Search_Text, 10
  118.         stdcall [ksubmenu_add], [main_menu_search], eax
  119.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Search_Keywords, 12
  120.         stdcall [ksubmenu_add], [main_menu_search], eax
  121.         stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_Search, [main_menu_search]
  122.         stdcall [ksubmenu_add], [main_menu], eax
  123.  
  124.         stdcall [ksubmenu_new]
  125.         mov [main_menu_view], eax
  126.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_UseSyntax, 19
  127.         stdcall [ksubmenu_add], [main_menu_view], eax
  128.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_ChooseSyntax, 20
  129.         stdcall [ksubmenu_add], [main_menu_view], eax
  130.         stdcall [kmenuitem_new], KMENUITEM_SEPARATOR, 0, 0
  131.         stdcall [ksubmenu_add], [main_menu_view], eax
  132.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_LineBreak, 18
  133.         stdcall [ksubmenu_add], [main_menu_view], eax  
  134.         stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_View, [main_menu_view]
  135.         stdcall [ksubmenu_add], [main_menu], eax
  136.  
  137.         stdcall [ksubmenu_new]
  138.         mov [main_menu_encoding], eax
  139.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Encoding_1251to866, 21
  140.         stdcall [ksubmenu_add], [main_menu_encoding], eax
  141.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Encoding_866to1251, 22
  142.         stdcall [ksubmenu_add], [main_menu_encoding], eax      
  143.         stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_Encoding, [main_menu_encoding]
  144.         stdcall [ksubmenu_add], [main_menu], eax
  145.        
  146. ; init toolbar file
  147.         include_image_file 'te_icon.png', bmp_icon,,,6 ;6 ¤«ï á¥àëå ª­®¯®ª
  148.         mov eax,[bmp_icon]
  149.         add eax,TOOLBAR_ICONS_SIZE
  150.         stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
  151. ;---------------------------------------------------------------------
  152. ; ¢­¥¤à塞 ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
  153.         include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
  154.         mov eax,dword[icon_tl_sys]
  155.         mov dword[tree1.data_img_sys],eax
  156. ;---------------------------------------------------------------------
  157. ; ¢­¥¤à塞 ä ©« á ¨ª®­ª ¬¨ 㧫®¢
  158.         include_image_file 'tl_nod_16.png', icon_tl_sys
  159.         mov eax,dword[icon_tl_sys]
  160.         mov dword[tree1.data_img],eax
  161. ;------------------------------------------------------------------------------
  162.         copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
  163.         mcall SF_FILE,tree_file_struct
  164.  
  165.         cmp ebx,-1
  166.         je .end_dir_init
  167.                 mov eax,dir_mem
  168.                 add eax,32+4+1+3+4*6+8
  169.                 mov ecx,ebx
  170.                 @@:
  171.                         cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
  172.                         je .filter
  173.                         ;0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
  174.                         stdcall [tl_node_add], tree1,0x10000,eax
  175.                         stdcall [tl_cur_next], tree1
  176.                         .filter:
  177.                         add eax,304
  178.                         loop @b
  179.                 stdcall [tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
  180.                 or dword[tree1.style], tl_cursor_pos_limited ;®£à ­¨ç¨¢ ¥¬ ¤¢¨¦¥­¨¥ ªãàá®à  ¢ ¯à¥¤¥« å ᯨ᪠
  181.         .end_dir_init:
  182.  
  183. ;--- load ini file ---
  184.         copy_path ini_name,sys_path,file_name,0
  185.         ;window startup pozition
  186.         stdcall [ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
  187.         mov word[wnd_s_pos+2],ax
  188.         stdcall [ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
  189.         mov word[wnd_s_pos],ax
  190.         stdcall [ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
  191.         mov word[wnd_s_pos+6],ax
  192.         stdcall [ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
  193.         mov word[wnd_s_pos+4],ax
  194.         ;scrool type
  195.         stdcall [ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
  196.         mov [wScr.type],eax
  197.         mov [hScr.type],eax
  198.         mov [ws_dir_lbox.type],eax
  199.     mov [w_scr_t3.type],eax
  200.         ;symbol size
  201.         stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
  202.         mov dword[tedit0.rec.width],eax
  203.         stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
  204.         mov dword[tedit0.rec.height],eax
  205.         ;lea eax,[eax+eax*2]
  206.         ;mov dword[tedit0.rec.top],eax
  207.         ;font size
  208.         stdcall [ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
  209.         shl eax,24
  210.         mov dword[tedit0.font_size],eax
  211.         ;ª­®¯ª¨ ­  ¯ ­¥«¨
  212.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_new,1
  213.         mov byte[panel_but],al
  214.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_open,1
  215.         mov byte[panel_but+1],al
  216.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_save,1
  217.         mov byte[panel_but+2],al
  218.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_select,1
  219.         mov byte[panel_but+3],al
  220.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_cut,1
  221.         mov byte[panel_but+4],al
  222.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_copy,1
  223.         mov byte[panel_but+5],al
  224.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_paste,1
  225.         mov byte[panel_but+6],al
  226.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_find,1
  227.         mov byte[panel_but+7],al
  228.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_replace,1
  229.         mov byte[panel_but+8],al
  230.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_key_words,1
  231.         mov byte[panel_but+9],al
  232.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_upper,1
  233.         mov byte[panel_but+10],al
  234.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_lower,1
  235.         mov byte[panel_but+11],al
  236.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_reverse,1
  237.         mov byte[panel_but+12],al
  238.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_undo,1
  239.         mov byte[panel_but+13],al
  240.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_redo,1
  241.         mov byte[panel_but+14],al
  242.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_invisible,1
  243.         mov byte[panel_but+15],al
  244.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_syntax_list,1
  245.         mov byte[panel_but+16],al
  246.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_syntax_mode,1
  247.         mov byte[panel_but+17],al
  248.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_convert_1251_866,1
  249.         mov byte[panel_but+18],al
  250.         stdcall [ini_get_int],file_name,ini_sec_window,key_but_convert_866_1251,1
  251.         mov byte[panel_but+19],al
  252.         ;ä ©«®¢ë¥ à áè¨à¥­¨ï
  253.         xor edx,edx
  254.         mov ebx,synt_auto_open
  255.         @@:
  256.                 ;¡¥à¥¬ ¨¬ï ä ©« 
  257.                 stdcall [ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
  258.                 cmp byte[ebx],0
  259.                 je @f
  260.                 inc byte[key_synt_file.numb]
  261.                 add ebx,32
  262.                 ;¡¥à¥¬ à áè¨à¥­¨ï
  263.                 stdcall [ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
  264.                 inc byte[key_synt_ext.numb]
  265.                 add ebx,32
  266.                 inc edx
  267.                 cmp edx,max_synt_auto_open
  268.                 jl @b
  269.         @@:
  270.  
  271. ;--- load color option file ---
  272.         stdcall open_unpac_synt_file,[fn_col_option]
  273.  
  274. ;--- get cmd line ---
  275.         cmp byte[openfile_path+3],0 ;openfile_path
  276.         je @f ;if file names exist
  277.                 mov esi,openfile_path
  278.                 stdcall auto_open_syntax,esi
  279.                 call but_no_msg_OpenFile
  280.         @@:
  281.  
  282.  
  283.  
  284. align 16
  285. red_win:
  286.         call draw_window
  287.  
  288. align 16
  289. still:
  290.         mcall SF_WAIT_EVENT
  291.         cmp dword[exit_code],1
  292.         je button.exit
  293.  
  294.         cmp al,1 ;¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
  295.         jz red_win
  296.         cmp al,2
  297.         jz key
  298.         cmp al,3
  299.         jz button
  300.         cmp al,6 ;¬ëèì
  301.         jne @f
  302.                 jmp mouse
  303.         @@:
  304.         jmp still
  305.  
  306. align 16
  307. draw_window:
  308.         mcall SF_REDRAW,SSF_BEGIN_DRAW
  309.  
  310.         mov edx,[sc.work]
  311.         or  edx,0x73000000
  312.         mcall SF_CREATE_WINDOW,dword[wnd_s_pos],dword[wnd_s_pos+4],,,hed
  313.  
  314.         mcall SF_THREAD_INFO,procinfo,-1
  315.         mov edi,tedit0 ;§­ ç¥­¨¥ edi ­ã¦­® ¤«ï EvSize ¨ ted_wnd_t
  316.         call EvSize
  317.  
  318.         movzx ebx,word[procinfo.client_box.width]
  319.         inc bx
  320.         mcall SF_DRAW_RECT,,ted_wnd_t ;¢¥àå­¨© ¯àאַ㣮«ì­¨ª, ¤«ï ®ç¨á⪨ ¢¥àå­¥© ¯ ­¥«¨
  321.         call draw_but_toolbar
  322.         stdcall [kmainmenu_draw], [main_menu]
  323.         stdcall [ted_draw], tedit0
  324.  
  325.         mcall SF_REDRAW,SSF_END_DRAW
  326.         ret
  327.  
  328. align 16
  329. mouse:
  330.         stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
  331.  
  332.         mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
  333.         cmp word[tedit0.wnd.top],ax
  334.         jg .no_edit
  335.         shr eax,16
  336.         cmp word[tedit0.wnd.left],ax
  337.         jg .no_edit
  338.         mcall SF_MOUSE_GET,SSF_BUTTON_EXT
  339.         bt eax,24 ;¤¢®©­®© 饫çñª «¥¢®© ª­®¯ª®©
  340.         jnc @f
  341.                 stdcall [ted_but_select_word], tedit0
  342.                 jmp still
  343.         @@:
  344.                 stdcall [ted_mouse], tedit0
  345.         .no_edit:
  346.  
  347.         cmp byte[tedit0.panel_id],TED_PANEL_FIND ;if not panel
  348.         jne @f
  349.                 stdcall [edit_box_mouse], edit2
  350.         @@:
  351.         cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX ;if not panel
  352.         jne @f
  353.                 stdcall [tl_mouse], tree1
  354.         @@:
  355.         jmp still
  356. ;---------------------------------------------------------------------
  357.  
  358. ;output:
  359. ; ah = symbol
  360. align 16
  361. proc KeyConvertToASCII uses ebx, table:dword
  362.         mov ebx,dword[table] ;convert scan to ascii
  363.         ror ax,8
  364.         xor ah,ah
  365.         add bx,ax
  366.         mov ah,byte[ebx]
  367.         ret
  368. endp
  369.  
  370. align 16
  371. key:
  372.         mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
  373.         xor esi,esi
  374.         mov ecx,1
  375.         test al,0x03 ;[Shift]
  376.         jz @f
  377.                 mov cl,2
  378.                 or esi,KM_SHIFT
  379.         @@:
  380.         test al,0x0c ;[Ctrl]
  381.         jz @f
  382.                 or esi,KM_CTRL
  383.         @@:
  384.         test al,0x30 ;[Alt]
  385.         jz @f
  386.                 mov cl,3
  387.                 or esi,KM_ALT
  388.         @@:
  389.         test al,0x80 ;[NumLock]
  390.         jz @f
  391.                 or esi,KM_NUMLOCK
  392.         @@:
  393.  
  394.         mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
  395.         mcall SF_GET_KEY
  396.         stdcall [tl_key], tree1
  397.  
  398.         test word [edit2.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
  399.         je @f
  400.                 cmp ah,0x80 ;if key up
  401.                 ja still
  402.                 cmp ah,42 ;[Shift] (left)
  403.                 je still
  404.                 cmp ah,54 ;[Shift] (right)
  405.                 je still
  406.                 cmp ah,56 ;[Alt]
  407.                 je still
  408.                 cmp ah,29 ;[Ctrl]
  409.                 je still
  410.                 cmp ah,69 ;[Pause Break]
  411.                 je still
  412.  
  413.                 stdcall KeyConvertToASCII, dword conv_tabl
  414.                 stdcall [edit_box_key], dword edit2
  415.                 jmp still
  416.         @@:
  417.  
  418.         stdcall [ted_key], tedit0, conv_tabl,esi
  419.         jmp still
  420.  
  421. align 16
  422. button:
  423.         mcall SF_GET_BUTTON
  424.         cmp ah,3
  425.         jne @f
  426.                 call ted_but_new_file
  427.                 jmp still
  428.         @@:
  429.         cmp ah,4
  430.         jne @f
  431.                 call ted_but_open_file
  432.                 jmp still
  433.         @@:
  434.         cmp ah,5
  435.         jne @f
  436.                 call ted_but_save_file
  437.                 jmp still
  438.         @@:
  439.         cmp ah,6
  440.         jne @f
  441.                 stdcall [ted_but_select_word], tedit0
  442.                 jmp still
  443.         @@:
  444.         cmp ah,7
  445.         jne @f
  446.                 stdcall [ted_but_cut], tedit0
  447.                 jmp still
  448.         @@:
  449.         cmp ah,8
  450.         jne @f
  451.                 stdcall [ted_but_copy], tedit0
  452.                 jmp still
  453.         @@:
  454.         cmp ah,9
  455.         jne @f
  456.                 stdcall [ted_but_paste], tedit0
  457.                 jmp still
  458.         @@:
  459.         cmp ah,10
  460.         jne @f
  461.                 call ted_but_find
  462.                 jmp still
  463.         @@:
  464.         cmp ah,11
  465.         jne @f
  466.                 call but_replace
  467.                 jmp still
  468.         @@:
  469.         cmp ah,12
  470.         jne @f
  471.                 call but_find_key_w
  472.                 jmp still
  473.         @@:
  474.         cmp ah,13
  475.         jne @f
  476.                 stdcall [ted_but_sumb_upper], tedit0
  477.                 jmp still
  478.         @@:
  479.         cmp ah,14
  480.         jne @f
  481.                 stdcall [ted_but_sumb_lover], tedit0
  482.                 jmp still
  483.         @@:
  484.         cmp ah,15
  485.         jne @f
  486.                 stdcall [ted_but_reverse], tedit0
  487.                 jmp still
  488.         @@:
  489.         cmp ah,16
  490.         jne @f
  491.                 stdcall [ted_but_undo], tedit0
  492.                 jmp still
  493.         @@:
  494.         cmp ah,17
  495.         jne @f
  496.                 stdcall [ted_but_redo], tedit0
  497.                 jmp still
  498.         @@:
  499.         cmp ah,18
  500.         jne @f
  501.                 stdcall but_sumb_invis, tedit0
  502.                 jmp still
  503.         @@:
  504.         cmp ah,19
  505.         jne @f
  506.                 stdcall but_k_words_show, tedit0
  507.                 jmp still
  508.         @@:
  509.         cmp ah,20
  510.         jne @f
  511.                 stdcall but_synt_show, tedit0
  512.                 jmp still
  513.         @@:
  514.         cmp ah,21
  515.         jne @f
  516.                 stdcall [ted_but_convert_by_table],tedit0,tbl_1251_866
  517.                 jmp still
  518.         @@:
  519.         cmp ah,22
  520.         jne @f
  521.                 stdcall [ted_but_convert_by_table],tedit0,tbl_866_1251
  522.                 jmp still
  523.         @@:
  524.  
  525.         cmp ah,200
  526.         jne @f
  527.                 stdcall ted_but_open_syntax, tedit0
  528.                 jmp still
  529.         @@:
  530.         cmp ah,201
  531.         jne @f
  532.                 stdcall [ted_but_find_next], tedit0
  533.                 jmp still
  534.         @@:
  535.  
  536.         cmp ah,1
  537.         je .exit
  538.  
  539.         cmp ah,199
  540.         je .exit
  541.  
  542.         jmp still
  543. .exit:
  544.         cmp dword[wnd_k_words_run],0
  545.         je @f
  546.                 push ebx ecx
  547.                 mcall SF_SYSTEM, SSF_TERMINATE_THREAD_ID,[wnd_k_words_run]
  548.                 pop ecx ebx
  549.                 test eax,eax
  550.                 jnz still
  551.         @@:
  552.         cmp dword[exit_code],1
  553.         je @f
  554.         stdcall [ted_can_save], tedit0
  555.         cmp al,1
  556.         jne @f
  557.                 stdcall [mb_create],msgbox_2,thread ;message: save buf in file?
  558.                 stdcall [mb_setfunctions],msgbox_2E_funct
  559.                 jmp still
  560.         @@:
  561.         stdcall mem.Free,[bmp_icon]
  562.         cmp dword[unpac_mem],0
  563.         je @f
  564.                 stdcall mem.Free,[unpac_mem]
  565.         @@:
  566.  
  567.         stdcall [ted_delete], tedit0
  568.         stdcall [tl_data_clear], tree1
  569.         mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
  570.  
  571. edit2 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
  572.  
  573. unpac_mem dd 0
  574.  
  575. if lang eq ru
  576.   head_f_i:
  577.   head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  578.   err_message_found_lib0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
  579.   err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib.obj',39,0
  580.   err_message_found_lib1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'msgbox.obj',39,0
  581.   err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox.obj',39,0
  582.   err_message_found_lib2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  583.   err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  584.   err_message_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  585.   err_message_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  586.   err_message_found_lib_4 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
  587.   err_message_import_4 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini.obj',39,0
  588.   err_message_found_lib_5 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libkmenu.obj',39,0
  589.   err_message_import_5 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libkmenu.obj',39,0
  590. else
  591.   head_f_i:
  592.   head_f_l db 'System error',0
  593.   err_message_found_lib0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,0
  594.   err_message_import0 db 'Error on load import library ',39,'box_lib.obj',39,0
  595.   err_message_found_lib1 db 'Sorry I cannot found library ',39,'msgbox.obj',39,0
  596.   err_message_import1 db 'Error on load import library ',39,'msgbox.obj',39,0
  597.   err_message_found_lib2 db 'Sorry I cannot found library ',39,'proc_lib.obj',39,0
  598.   err_message_import2 db 'Error on load import library ',39,'proc_lib.obj',39,0
  599.   err_message_found_lib_3 db 'Sorry I cannot found library ',39,'libimg.obj',39,0
  600.   err_message_import_3 db 'Error on load import library ',39,'libimg.obj',39,0
  601.   err_message_found_lib_4 db 'Sorry I cannot found library ',39,'libini.obj',39,0
  602.   err_message_import_4 db 'Error on load import library ',39,'libini.obj',39,0
  603.   err_message_found_lib_5 db 'Sorry I cannot found library ',39,'libkmenu.obj',39,0
  604.   err_message_import_5 db 'Error on load import library ',39,'libkmenu.obj',39,0
  605. end if
  606.  
  607. ;library structures
  608. l_libs_start:
  609.         lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  610.                 err_message_found_lib0, head_f_l, import_box_lib,err_message_import0, head_f_i
  611.         lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  612.                 err_message_found_lib1, head_f_l, import_msgbox_lib, err_message_import1, head_f_i
  613.         lib2 l_libs lib_name_2, sys_path, file_name, system_dir_2,\
  614.                 err_message_found_lib2, head_f_l, import_proclib, err_message_import2, head_f_i
  615.         lib3 l_libs lib_name_3, sys_path, file_name, system_dir_3,\
  616.                 err_message_found_lib_3, head_f_l, import_libimg, err_message_import_3, head_f_i
  617.         lib4 l_libs lib_name_4, sys_path, file_name, system_dir_4,\
  618.                 err_message_found_lib_4, head_f_l, import_libini, err_message_import_4, head_f_i
  619.         lib5 l_libs lib_name_5, sys_path, file_name, system_dir_5,\
  620.                 err_message_found_lib_5, head_f_l, import_libkmenu, err_message_import_5, head_f_i
  621. load_lib_end:
  622.  
  623. IncludeIGlobals
  624. hed db 'TextEdit '
  625. i_end:
  626.         openfile_path: ;¯®«­ë© ¯ãâì ª ä ©«ã á ª®â®àë¬ ¨¤¥â à ¡®â 
  627.                 rb 4096
  628.         dir_mem rb 32+304*count_of_dir_list_files
  629.         wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
  630.                 rq 1
  631.         last_open_synt_file rb 32 ;¨¬ï ¯®á«¥¤­¥£® ¯®¤ª«î祭­®£® ä ©«  ᨭ⠪á¨á 
  632.         buf rb BUF_SIZE ;¡ãä¥à ¤«ï ª®¯¨à®¢ ­¨ï ¨ ¢áâ ¢ª¨
  633.         buf_find rb 302 ;¡ãä¥à ¤«ï ¯®¨áª  ⥪áâ 
  634.         sc system_colors
  635. IncludeUGlobals
  636.         align 16
  637.         procinfo process_information
  638.                 rb 1024
  639.         thread:
  640.                 rb 4096
  641. align 16
  642.     thread_coords:
  643.         rb 4096
  644. align 16
  645. stacktop:
  646.         sys_path: ;¯ãâì ®âªã¤  § ¯ãá⨫áï ¨á¯®«­ï¥¬ë© ä ©«
  647.                 rb 4096
  648.         file_name: ;¯ à ¬¥âàë § ¯ã᪠
  649.                 rb 4096
  650.         syntax_path: ;¨¬ï ¯®¤ª«îç ¥¬®£® ä ©«  ᨭ⠪á¨á 
  651.                 rb 4096
  652.         plugin_path:
  653.                 rb 4096
  654.         text_work_area: ;¯ãâì ª ä ©«ã, ª®â®àë© ¯®ª §ë¢ ¥âáï ¢ ®ª­¥
  655.                 rb 4096
  656.         filename_area: ;¨¬ï ä ©«  ¤«ï ¤¨ «®£  ®âªàëâ¨ï/§ ªàëâ¨ï
  657.                 rb 256
  658.         file_info:
  659.                 rb 40
  660. mem:
  661.