Subversion Repositories Kolibri OS

Rev

Rev 7488 | Rev 7570 | 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 strlen ;eax=strlen
  280.                 call but_no_msg_OpenFile
  281.         @@:
  282.  
  283.  
  284.  
  285. align 16
  286. red_win:
  287.         call draw_window
  288.  
  289. align 16
  290. still:
  291.         mcall SF_WAIT_EVENT
  292.         cmp dword[exit_code],1
  293.         je button.exit
  294.  
  295.         cmp al,1 ;¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
  296.         jz red_win
  297.         cmp al,2
  298.         jz key
  299.         cmp al,3
  300.         jz button
  301.         cmp al,6 ;¬ëèì
  302.         jne @f
  303.                 jmp mouse
  304.         @@:
  305.         jmp still
  306.  
  307. align 16
  308. draw_window:
  309.         mcall SF_REDRAW,SSF_BEGIN_DRAW
  310.  
  311.         mov edx,[sc.work]
  312.         or  edx,0x73000000
  313.         mcall SF_CREATE_WINDOW,dword[wnd_s_pos],dword[wnd_s_pos+4],,,hed
  314.  
  315.         mcall SF_THREAD_INFO,procinfo,-1
  316.         mov edi,tedit0 ;§­ ç¥­¨¥ edi ­ã¦­® ¤«ï EvSize ¨ ted_wnd_t
  317.         call EvSize
  318.  
  319.         movzx ebx,word[procinfo.client_box.width]
  320.         inc bx
  321.         mcall SF_DRAW_RECT,,ted_wnd_t ;¢¥àå­¨© ¯àאַ㣮«ì­¨ª, ¤«ï ®ç¨á⪨ ¢¥àå­¥© ¯ ­¥«¨
  322.         call draw_but_toolbar
  323.         stdcall [kmainmenu_draw], [main_menu]
  324.         stdcall [ted_draw], tedit0
  325.  
  326.         mcall SF_REDRAW,SSF_END_DRAW
  327.         ret
  328.  
  329. align 16
  330. mouse:
  331.         stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
  332.  
  333.         mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
  334.         cmp word[tedit0.wnd.top],ax
  335.         jg .no_edit
  336.         shr eax,16
  337.         cmp word[tedit0.wnd.left],ax
  338.         jg .no_edit
  339.         mcall SF_MOUSE_GET,SSF_BUTTON_EXT
  340.         bt eax,24 ;¤¢®©­®© 饫çñª «¥¢®© ª­®¯ª®©
  341.         jnc @f
  342.                 stdcall [ted_but_select_word], tedit0
  343.                 jmp still
  344.         @@:
  345.                 stdcall [ted_mouse], tedit0
  346.         .no_edit:
  347.  
  348.         cmp byte[tedit0.panel_id],TED_PANEL_FIND ;if not panel
  349.         jne @f
  350.                 stdcall [edit_box_mouse], edit2
  351.         @@:
  352.         cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX ;if not panel
  353.         jne @f
  354.                 stdcall [tl_mouse], tree1
  355.         @@:
  356.         jmp still
  357. ;---------------------------------------------------------------------
  358.  
  359. ;output:
  360. ; ah = symbol
  361. align 16
  362. proc KeyConvertToASCII uses ebx, table:dword
  363.         mov ebx,dword[table] ;convert scan to ascii
  364.         ror ax,8
  365.         xor ah,ah
  366.         add bx,ax
  367.         mov ah,byte[ebx]
  368.         ret
  369. endp
  370.  
  371. align 16
  372. key:
  373.         mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
  374.         xor esi,esi
  375.         mov ecx,1
  376.         test al,0x03 ;[Shift]
  377.         jz @f
  378.                 mov cl,2
  379.                 or esi,KM_SHIFT
  380.         @@:
  381.         test al,0x0c ;[Ctrl]
  382.         jz @f
  383.                 or esi,KM_CTRL
  384.         @@:
  385.         test al,0x30 ;[Alt]
  386.         jz @f
  387.                 mov cl,3
  388.                 or esi,KM_ALT
  389.         @@:
  390.         test al,0x80 ;[NumLock]
  391.         jz @f
  392.                 or esi,KM_NUMLOCK
  393.         @@:
  394.  
  395.         mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
  396.         mcall SF_GET_KEY
  397.         stdcall [tl_key], tree1
  398.  
  399.         test word [edit2.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
  400.         je @f
  401.                 cmp ah,0x80 ;if key up
  402.                 ja still
  403.                 cmp ah,42 ;[Shift] (left)
  404.                 je still
  405.                 cmp ah,54 ;[Shift] (right)
  406.                 je still
  407.                 cmp ah,56 ;[Alt]
  408.                 je still
  409.                 cmp ah,29 ;[Ctrl]
  410.                 je still
  411.                 cmp ah,69 ;[Pause Break]
  412.                 je still
  413.  
  414.                 stdcall KeyConvertToASCII, dword conv_tabl
  415.                 stdcall [edit_box_key], dword edit2
  416.                 jmp still
  417.         @@:
  418.  
  419.         stdcall [ted_key], tedit0, conv_tabl,esi
  420.         jmp still
  421.  
  422. align 16
  423. button:
  424.         mcall SF_GET_BUTTON
  425.         cmp ah,3
  426.         jne @f
  427.                 call ted_but_new_file
  428.                 jmp still
  429.         @@:
  430.         cmp ah,4
  431.         jne @f
  432.                 call ted_but_open_file
  433.                 jmp still
  434.         @@:
  435.         cmp ah,5
  436.         jne @f
  437.                 call ted_but_save_file
  438.                 jmp still
  439.         @@:
  440.         cmp ah,6
  441.         jne @f
  442.                 stdcall [ted_but_select_word], tedit0
  443.                 jmp still
  444.         @@:
  445.         cmp ah,7
  446.         jne @f
  447.                 stdcall [ted_but_cut], tedit0
  448.                 jmp still
  449.         @@:
  450.         cmp ah,8
  451.         jne @f
  452.                 stdcall [ted_but_copy], tedit0
  453.                 jmp still
  454.         @@:
  455.         cmp ah,9
  456.         jne @f
  457.                 stdcall [ted_but_paste], tedit0
  458.                 jmp still
  459.         @@:
  460.         cmp ah,10
  461.         jne @f
  462.                 call ted_but_find
  463.                 jmp still
  464.         @@:
  465.         cmp ah,11
  466.         jne @f
  467.                 call but_replace
  468.                 jmp still
  469.         @@:
  470.         cmp ah,12
  471.         jne @f
  472.                 call but_find_key_w
  473.                 jmp still
  474.         @@:
  475.         cmp ah,13
  476.         jne @f
  477.                 stdcall [ted_but_sumb_upper], tedit0
  478.                 jmp still
  479.         @@:
  480.         cmp ah,14
  481.         jne @f
  482.                 stdcall [ted_but_sumb_lover], tedit0
  483.                 jmp still
  484.         @@:
  485.         cmp ah,15
  486.         jne @f
  487.                 stdcall [ted_but_reverse], tedit0
  488.                 jmp still
  489.         @@:
  490.         cmp ah,16
  491.         jne @f
  492.                 stdcall [ted_but_undo], tedit0
  493.                 jmp still
  494.         @@:
  495.         cmp ah,17
  496.         jne @f
  497.                 stdcall [ted_but_redo], tedit0
  498.                 jmp still
  499.         @@:
  500.         cmp ah,18
  501.         jne @f
  502.                 stdcall but_sumb_invis, tedit0
  503.                 jmp still
  504.         @@:
  505.         cmp ah,19
  506.         jne @f
  507.                 stdcall but_k_words_show, tedit0
  508.                 jmp still
  509.         @@:
  510.         cmp ah,20
  511.         jne @f
  512.                 stdcall but_synt_show, tedit0
  513.                 jmp still
  514.         @@:
  515.         cmp ah,21
  516.         jne @f
  517.                 stdcall [ted_but_convert_by_table],tedit0,tbl_1251_866
  518.                 jmp still
  519.         @@:
  520.         cmp ah,22
  521.         jne @f
  522.                 stdcall [ted_but_convert_by_table],tedit0,tbl_866_1251
  523.                 jmp still
  524.         @@:
  525.  
  526.         cmp ah,200
  527.         jne @f
  528.                 stdcall ted_but_open_syntax, tedit0
  529.                 jmp still
  530.         @@:
  531.         cmp ah,201
  532.         jne @f
  533.                 stdcall [ted_but_find_next], tedit0
  534.                 jmp still
  535.         @@:
  536.  
  537.         cmp ah,1
  538.         je .exit
  539.  
  540.         cmp ah,199
  541.         je .exit
  542.  
  543.         jmp still
  544. .exit:
  545.         cmp dword[wnd_k_words_run],0
  546.         je @f
  547.                 push ebx ecx
  548.                 mcall SF_SYSTEM, SSF_TERMINATE_THREAD_ID,[wnd_k_words_run]
  549.                 pop ecx ebx
  550.                 test eax,eax
  551.                 jnz still
  552.         @@:
  553.         cmp dword[exit_code],1
  554.         je @f
  555.         stdcall [ted_can_save], tedit0
  556.         cmp al,1
  557.         jne @f
  558.                 stdcall [mb_create],msgbox_2,thread ;message: save buf in file?
  559.                 stdcall [mb_setfunctions],msgbox_2E_funct
  560.                 jmp still
  561.         @@:
  562.         stdcall mem.Free,[bmp_icon]
  563.         cmp dword[unpac_mem],0
  564.         je @f
  565.                 stdcall mem.Free,[unpac_mem]
  566.         @@:
  567.  
  568.         stdcall [ted_delete], tedit0
  569.         stdcall [tl_data_clear], tree1
  570.         mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
  571.  
  572. edit2 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
  573.  
  574. unpac_mem dd 0
  575.  
  576. if lang eq ru
  577.   head_f_i:
  578.   head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  579.   err_message_found_lib0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
  580.   err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib.obj',39,0
  581.   err_message_found_lib1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'msgbox.obj',39,0
  582.   err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox.obj',39,0
  583.   err_message_found_lib2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  584.   err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  585.   err_message_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  586.   err_message_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  587.   err_message_found_lib_4 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
  588.   err_message_import_4 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini.obj',39,0
  589.   err_message_found_lib_5 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libkmenu.obj',39,0
  590.   err_message_import_5 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libkmenu.obj',39,0
  591. else
  592.   head_f_i:
  593.   head_f_l db 'System error',0
  594.   err_message_found_lib0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,0
  595.   err_message_import0 db 'Error on load import library ',39,'box_lib.obj',39,0
  596.   err_message_found_lib1 db 'Sorry I cannot found library ',39,'msgbox.obj',39,0
  597.   err_message_import1 db 'Error on load import library ',39,'msgbox.obj',39,0
  598.   err_message_found_lib2 db 'Sorry I cannot found library ',39,'proc_lib.obj',39,0
  599.   err_message_import2 db 'Error on load import library ',39,'proc_lib.obj',39,0
  600.   err_message_found_lib_3 db 'Sorry I cannot found library ',39,'libimg.obj',39,0
  601.   err_message_import_3 db 'Error on load import library ',39,'libimg.obj',39,0
  602.   err_message_found_lib_4 db 'Sorry I cannot found library ',39,'libini.obj',39,0
  603.   err_message_import_4 db 'Error on load import library ',39,'libini.obj',39,0
  604.   err_message_found_lib_5 db 'Sorry I cannot found library ',39,'libkmenu.obj',39,0
  605.   err_message_import_5 db 'Error on load import library ',39,'libkmenu.obj',39,0
  606. end if
  607.  
  608. ;library structures
  609. l_libs_start:
  610.         lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  611.                 err_message_found_lib0, head_f_l, import_box_lib,err_message_import0, head_f_i
  612.         lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  613.                 err_message_found_lib1, head_f_l, import_msgbox_lib, err_message_import1, head_f_i
  614.         lib2 l_libs lib_name_2, sys_path, file_name, system_dir_2,\
  615.                 err_message_found_lib2, head_f_l, import_proclib, err_message_import2, head_f_i
  616.         lib3 l_libs lib_name_3, sys_path, file_name, system_dir_3,\
  617.                 err_message_found_lib_3, head_f_l, import_libimg, err_message_import_3, head_f_i
  618.         lib4 l_libs lib_name_4, sys_path, file_name, system_dir_4,\
  619.                 err_message_found_lib_4, head_f_l, import_libini, err_message_import_4, head_f_i
  620.         lib5 l_libs lib_name_5, sys_path, file_name, system_dir_5,\
  621.                 err_message_found_lib_5, head_f_l, import_libkmenu, err_message_import_5, head_f_i
  622. load_lib_end:
  623.  
  624. IncludeIGlobals
  625. hed db 'TextEdit '
  626. i_end:
  627.         openfile_path: ;¯®«­ë© ¯ãâì ª ä ©«ã á ª®â®àë¬ ¨¤¥â à ¡®â 
  628.                 rb 4096
  629.         dir_mem rb 32+304*count_of_dir_list_files
  630.         wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
  631.                 rq 1
  632.         last_open_synt_file rb 32 ;¨¬ï ¯®á«¥¤­¥£® ¯®¤ª«î祭­®£® ä ©«  ᨭ⠪á¨á 
  633.         buf rb BUF_SIZE ;¡ãä¥à ¤«ï ª®¯¨à®¢ ­¨ï ¨ ¢áâ ¢ª¨
  634.         buf_find rb 302 ;¡ãä¥à ¤«ï ¯®¨áª  ⥪áâ 
  635.         sc system_colors
  636. IncludeUGlobals
  637.         align 16
  638.         procinfo process_information
  639.                 rb 1024
  640.         thread:
  641.                 rb 4096
  642. align 16
  643.     thread_coords:
  644.         rb 4096
  645. align 16
  646. stacktop:
  647.         sys_path: ;¯ãâì ®âªã¤  § ¯ãá⨫áï ¨á¯®«­ï¥¬ë© ä ©«
  648.                 rb 4096
  649.         file_name: ;¯ à ¬¥âàë § ¯ã᪠
  650.                 rb 4096
  651.         syntax_path: ;¨¬ï ¯®¤ª«îç ¥¬®£® ä ©«  ᨭ⠪á¨á 
  652.                 rb 4096
  653.         plugin_path:
  654.                 rb 4096
  655.         text_work_area: ;¯ãâì ª ä ©«ã, ª®â®àë© ¯®ª §ë¢ ¥âáï ¢ ®ª­¥
  656.                 rb 4096
  657.         filename_area: ;¨¬ï ä ©«  ¤«ï ¤¨ «®£  ®âªàëâ¨ï/§ ªàëâ¨ï
  658.                 rb 256
  659.         file_info:
  660.                 rb 40
  661. mem:
  662.