Subversion Repositories Kolibri OS

Rev

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

  1. struct f70
  2.   func_n dd ?
  3.   param1 dd ?
  4.   param2 dd ?
  5.   param3 dd ?
  6.   param4 dd ?
  7.   rezerv db ?
  8.   name dd ?
  9. ends
  10.  
  11. struct TexColViv
  12.   Text rb MAX_COLOR_WORD_LEN ; á«®¢® ¤«ï ¯®¤á¢¥âª¨
  13.   f1 dd 0 ; á¯à ¢ª  ¯® á«®¢ã
  14.   wwo db ? ; whole words only
  15.   endc db ? ; ᨬ¢®« ª®­æ  ¢ë¤¥«¥­¨ï (wwo&4)
  16.   color db ? ; ­®¬¥à 梥â 
  17. ends
  18.  
  19. struct symbol
  20.   c db ?    ;  +0 ᨬ¢®«
  21.   col db ?  ;  +1 梥â
  22.   perv dd ? ;  +2
  23.   next dd ? ;  +6 㪠§ â¥«¨
  24.   tc dd ?   ; +10 ¢à¥¬. ᮧ¤ ­¨ï
  25.   td dd ?   ; +14 ¢à¥¬. 㤠«¥­¨ï
  26. ends
  27.  
  28.  
  29. hed db 'TextEditor 29.04.10',0 ;¯®¤¯¨áì ®ª­ 
  30. sc system_colors
  31.  
  32. fn_icon db 'te_icon.bmp',0
  33. bmp_icon dd 0
  34. run_file_70 f70          
  35.  
  36.  
  37. ;input:
  38. ; al = ª®¤ ®è¨¡ª¨
  39. align 4
  40. ted_on_init_synt_err:
  41.         mov byte[msgbox_3.err],al
  42.         stdcall [mb_create],msgbox_3,thread ;message: Can-t open color options file!
  43.         ret
  44.  
  45.  
  46. ;-----------------------------------------------------------------------------
  47. ;äã­ªæ¨ï ¤«ï ¢ë¤¥«¥­¨ï ¯ ¬ïâ¨
  48. ;input:
  49. ; ecx = size data
  50. ;otput:
  51. ; eax = pointer to memory
  52. align 4
  53. mem_Alloc:
  54.   push ebx
  55.   mov eax,68
  56.   mov ebx,12
  57.   int 0x40
  58.   pop ebx
  59.   ret
  60. ;-----------------------------------------------------------------------------
  61. ;äã­ªæ¨ï ¤«ï ®á¢®¡®¦¤¥­¨ï ¯ ¬ïâ¨
  62. ;input:
  63. ; ecx = pointer to memory
  64. align 4
  65. mem_Free:
  66.   push eax ebx
  67.   cmp ecx,0
  68.   jz @f
  69.     mov eax,68
  70.     mov ebx,13
  71.     int 0x40
  72.   @@:
  73.   pop ebx eax
  74.   ret
  75.  
  76.  
  77. align 4
  78. ted_but_new_file:
  79.   push eax ebx
  80.   stdcall [ted_can_save], tedit0
  81.   cmp al,1
  82.   jne @f
  83.     stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
  84.     ;mov eax,5
  85.     ;mov ebx,50
  86.     ;int 0x40
  87.     stdcall [mb_setfunctions],msgbox_2_funct
  88.     jmp .ret_f
  89.   @@:
  90.   call On_NewFile
  91.   .ret_f:
  92.   pop ebx eax
  93.   ret
  94.  
  95. align 4
  96. On_NewFile:
  97.   stdcall [ted_clear], tedit0,1
  98.   call draw_but_toolbar
  99.   stdcall [ted_draw], tedit0
  100.   ret
  101.  
  102. align 4
  103. On_SaveAndNewFile:
  104.   push edi
  105.   mov edi, tedit0
  106.  
  107.   stdcall [ted_but_save_file],edi,run_file_70,[edit1.text]
  108.   cmp ted_err_save,0
  109.   jne @f
  110.     call On_NewFile
  111.   @@:
  112.   pop edi
  113.   ret
  114.  
  115. ;description:
  116. ; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ¡¥§ ®ª®­  á®®¡é¥­¨ï
  117. align 4
  118. but_no_msg_OpenFile:
  119.         push eax ebx
  120.         stdcall [ted_open_file], tedit0,run_file_70,[edit1.text]
  121.         call ted_messages_after_open_file
  122.         pop ebx eax
  123.         ret
  124.  
  125. ;description:
  126. ; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
  127. align 4
  128. ted_but_open_file:
  129.         push eax ebx
  130.         stdcall [ted_can_save], tedit0
  131.         cmp al,1
  132.         jne @f
  133.                 stdcall [mb_create],msgbox_5,thread ;message: save changes in file?
  134.                 stdcall [mb_setfunctions],msgbox_5_funct
  135.                 jmp .ret_f
  136.         @@:
  137.         stdcall [ted_open_file], tedit0,run_file_70,[edit1.text]
  138.         call ted_messages_after_open_file
  139.         .ret_f:
  140.         pop ebx eax
  141.         ret
  142.  
  143. ;input:
  144. ; eax = ª®¤ ®è¨¡ª¨
  145. ; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ­­ëå ¡ ©â
  146. ; edi = pointer to tedit struct
  147. align 4
  148. ted_messages_after_open_file:
  149.         push ecx
  150.         cmp eax,0
  151.         je @f
  152.         cmp eax,6
  153.         je @f
  154.                 cmp ax,10
  155.                 jl .zifra_0_9
  156.                         mov al,'?'
  157.                         sub ax,48
  158.                 .zifra_0_9:
  159.                 add ax,48
  160.  
  161.                 mov byte[msgbox_4.err],al
  162.                 stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
  163.                 jmp .ret_f
  164.         @@:
  165.         cmp ebx,-1
  166.         je .ret_f
  167.                 ;if open file
  168.                 mov ecx,ted_max_chars
  169.                 sub ecx,2 ;ecx = ¬ ªá¨¬ «ì­®¥ ç¨á«® ¡ ©â, ¤«ï ª®â®àëå ¡ë«  ¢ë¤¥«¥­  ¯ ¬ïâì
  170.                 cmp ebx,ecx
  171.                 jl .ret_f
  172.                         stdcall [mb_create],msgbox_1,thread
  173.         .ret_f:
  174.         pop ecx
  175.         ret
  176.  
  177. align 4
  178. ted_save_err_msg:
  179.         mov byte[msgbox_6.err],al
  180.         stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
  181.         ret
  182.  
  183. align 4
  184. proc ted_but_open_syntax, edit:dword
  185.   push ebx edi
  186.   mov edi,dword[edit]
  187.  
  188.   cmp ted_panel_id,TED_PANEL_SYNTAX
  189.   jne @f
  190.     stdcall dword[tl_node_get_data], tree1
  191.     pop dword[fn_col_option]
  192.         mov ebx,dword[fn_col_option]
  193.         copy_path ebx,fn_syntax_dir,file_name_rez,0x0
  194.         copy_path file_name_rez,sys_path,file_name,0x0
  195.     stdcall [ted_init_syntax_file],edi,run_file_70,file_name
  196.     call [ted_text_colored]
  197.     stdcall [ted_draw],edi
  198.   @@:
  199.   pop edi ebx
  200.   ret
  201. endp
  202.  
  203. align 4
  204. proc ted_but_find ;¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
  205.   push edi
  206.   mov edi,tedit0
  207.  
  208.   cmp ted_panel_id,TED_PANEL_NULL
  209.   je @f
  210.     mov ted_panel_id,TED_PANEL_NULL
  211.     mov ted_wnd_l,0
  212.     jmp .e_if
  213.   @@:
  214.     mov ted_panel_id,TED_PANEL_FIND
  215.     mov ted_wnd_l,TED_PANEL_WIDTH
  216.   .e_if:
  217.   stdcall EvSize,edi
  218.   stdcall [ted_draw],edi
  219.   pop edi
  220.   ret
  221. endp
  222.  
  223. align 4
  224. ted_on_find_err:
  225.         stdcall [mb_create],msgbox_7,thread ;message: Can not find text
  226.         ret
  227.  
  228. align 4
  229. but_replace:
  230.   ret
  231.  
  232. align 4
  233. but_find_key_w:
  234.   ret
  235.  
  236. align 4
  237. proc but_sumb_invis, edit:dword
  238.   push edi
  239.   mov edi,dword[edit]
  240.  
  241.   xor ted_mode_invis,1
  242.   call draw_but_toolbar
  243.   stdcall [ted_draw],edi
  244.   pop edi
  245.   ret
  246. endp
  247.  
  248. align 4
  249. proc but_k_words_show, edit:dword
  250.   push edi
  251.   mov edi,dword[edit]
  252.  
  253.   xor ted_mode_color,1
  254.   cmp ted_mode_color,0
  255.   je @f
  256.     call [ted_text_colored]
  257.   @@:
  258.   call draw_but_toolbar
  259.   stdcall [ted_draw],edi
  260.   pop edi
  261.   ret
  262. endp
  263.  
  264. align 4
  265. proc but_synt_show, edit:dword
  266.   push edi
  267.   mov edi,[edit]
  268.  
  269.   cmp ted_panel_id,TED_PANEL_NULL
  270.   je @f
  271.     mov ted_panel_id,TED_PANEL_NULL
  272.     mov ted_wnd_l,0
  273.     jmp .e_if
  274.   @@:
  275.     mov ted_panel_id,TED_PANEL_SYNTAX
  276.     mov ted_wnd_l,TED_PANEL_WIDTH
  277.   .e_if:
  278.   stdcall EvSize,edi
  279.   stdcall [ted_draw],edi
  280.   pop edi
  281.   ret
  282. endp
  283.