1) new element 'text_editor' in library 'box_lib.obj'

2) changes code t_edit.kex
3) fixed function 'tl_strlen' in 'tree_list'
4) minor edits documentation 'box_lib.obj'

git-svn-id: svn://kolibrios.org@1457 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2010-04-29 18:27:40 +00:00
parent f751f0881f
commit fd898963db
16 changed files with 4600 additions and 4086 deletions

View File

@ -7,3 +7,4 @@ include 'menubar.mac' ;macro implements menubar
include 'filebrowser.mac' ;macro implements filebrowser
include 'tree_list.mac' ;macro implements tree_list, image_list, list_box
include 'pathshow.mac' ;macro implements pathshow
include 't_edit.mac' ;macro implements text_editor

View File

@ -16,6 +16,7 @@ public EXPORTS
section '.flat' code readable align 16
include '../../../../macros.inc'
include '../../../../proc32.inc'
include 'bl_sys.mac'
include 'box_lib.mac' ;macro which should make life easier :)
@ -88,6 +89,12 @@ use_tree_list
align 16
use_path_show
;--------------------------------------------------
;text editor
;--------------------------------------------------
align 16
use_text_edit
align 16
init:
ret
@ -141,13 +148,13 @@ dd sz_tl_mouse, tl_mouse
dd sz_tl_draw, tl_draw
dd sz_tl_info_undo, tl_info_undo
dd sz_tl_info_redo, tl_info_redo
dd sz_tl_node_add, tl_node_add
dd sz_tl_node_add, tl_node_add
dd sz_tl_node_set_data, tl_node_set_data
dd sz_tl_node_get_data, tl_node_get_data
dd sz_tl_node_delete, tl_node_delete
dd sz_tl_cur_beg, tl_cur_beg
dd sz_tl_cur_next, tl_cur_next
dd sz_tl_cur_perv, tl_cur_perv
dd sz_tl_cur_next, tl_cur_next
dd sz_tl_cur_perv, tl_cur_perv
dd sz_tl_node_close_open, tl_node_close_open
dd sz_tl_node_lev_inc, tl_node_lev_inc
dd sz_tl_node_lev_dec, tl_node_lev_dec
@ -156,8 +163,8 @@ dd sz_tl_node_move_down, tl_node_move_down
dd sz_tl_node_poi_get_info, tl_node_poi_get_info
dd sz_tl_node_poi_get_next_info, tl_node_poi_get_next_info
dd sz_tl_node_poi_get_data, tl_node_poi_get_data
dd sz_tl_save_mem, tl_save_mem
dd sz_tl_load_mem, tl_load_mem
dd sz_tl_save_mem, tl_save_mem
dd sz_tl_load_mem, tl_load_mem
dd sz_tl_get_mem_size, tl_get_mem_size
dd sz_tl_version_tree_list, 0x00000001
@ -165,14 +172,39 @@ dd sz_PathShow_prepare, path_show.prepare
dd sz_PathShow_draw, path_show.draw
dd szVersion_path_show, 0x00010001
dd sz_ted_but_save_file, ted_but_save_file
dd sz_ted_but_sumb_upper, ted_but_sumb_upper
dd sz_ted_but_sumb_lover, ted_but_sumb_lover
dd sz_ted_can_save, ted_can_save
dd sz_ted_clear, ted_clear
dd sz_ted_delete, ted_delete
dd sz_ted_draw, ted_draw
dd sz_ted_init, ted_init
dd sz_ted_init_syntax_file, ted_init_syntax_file
dd sz_ted_is_select, ted_is_select
dd sz_ted_key, ted_key
dd sz_ted_mouse, ted_mouse
dd sz_ted_open_file, ted_open_file
dd sz_ted_text_add, ted_text_add
dd sz_ted_but_select_word, ted_but_select_word
dd sz_ted_but_cut, ted_but_cut
dd sz_ted_but_copy, ted_but_copy
dd sz_ted_but_paste, ted_but_paste
dd sz_ted_but_undo, ted_but_undo
dd sz_ted_but_redo, ted_but_redo
dd sz_ted_but_reverse, ted_but_reverse
dd sz_ted_but_find_next, ted_but_find_next
dd sz_ted_text_colored, ted_text_colored
dd sz_ted_version, 0x00000001
dd 0,0
sz_init db 'lib_init',0
sz_init db 'lib_init',0
sz_version db 'version',0
sz_edit_box db 'edit_box',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_mouse db 'edit_box_mouse',0
szVersion_ed db 'version_ed',0
@ -196,7 +228,7 @@ szVersion_dbutton db 'version_dbutton',0
sz_Menu_bar_draw db 'menu_bar_draw',0
sz_Menu_bar_mouse db 'menu_bar_mouse',0
sz_Menu_bar_activate db 'menu_bar_activate',0
sz_Menu_bar_activate db 'menu_bar_activate',0
szVersion_menu_bar db 'version_menu_bar',0
sz_FileBrowser_draw db 'FileBrowser_draw',0
@ -204,14 +236,14 @@ sz_FileBrowser_mouse db 'FileBrowser_mouse',0
sz_FileBrowser_key db 'FileBrowser_key',0
szVersion_FileBrowser db 'version_FileBrowser',0
sz_tl_data_init db 'tl_data_init',0
sz_tl_data_init db 'tl_data_init',0
sz_tl_data_clear db 'tl_data_clear',0
sz_tl_info_clear db 'tl_info_clear',0
sz_tl_key db 'tl_key',0
sz_tl_mouse db 'tl_mouse',0
sz_tl_draw db 'tl_draw',0
sz_tl_info_undo db 'tl_info_undo',0
sz_tl_info_redo db 'tl_info_redo',0
sz_tl_info_undo db 'tl_info_undo',0
sz_tl_info_redo db 'tl_info_redo',0
sz_tl_node_add db 'tl_node_add',0
sz_tl_node_set_data db 'tl_node_set_data',0
sz_tl_node_get_data db 'tl_node_get_data',0
@ -224,14 +256,39 @@ sz_tl_node_lev_inc db 'tl_node_lev_inc',0
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
sz_tl_node_move_up db 'tl_node_move_up',0
sz_tl_node_move_down db 'tl_node_move_down',0
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
sz_tl_save_mem db 'tl_save_mem',0
sz_tl_load_mem db 'tl_load_mem',0
sz_tl_get_mem_size db 'tl_get_mem_size',0
sz_tl_version_tree_list db 'version_tree_list',0
sz_tl_version_tree_list db 'version_tree_list',0
sz_PathShow_prepare db 'PathShow_prepare',0
sz_PathShow_draw db 'PathShow_draw',0
szVersion_path_show db 'version_PathShow',0
sz_ted_but_save_file db 'ted_but_save_file',0
sz_ted_but_sumb_upper db 'ted_but_sumb_upper',0
sz_ted_but_sumb_lover db 'ted_but_sumb_lover',0
sz_ted_can_save db 'ted_can_save',0
sz_ted_clear db 'ted_clear',0
sz_ted_delete db 'ted_delete',0
sz_ted_draw db 'ted_draw',0
sz_ted_init db 'ted_init',0
sz_ted_init_syntax_file db 'ted_init_syntax_file',0
sz_ted_is_select db 'ted_is_select',0
sz_ted_key db 'ted_key',0
sz_ted_mouse db 'ted_mouse',0
sz_ted_open_file db 'ted_open_file',0
sz_ted_text_add db 'ted_text_add',0
sz_ted_but_select_word db 'ted_but_select_word',0
sz_ted_but_cut db 'ted_but_cut',0
sz_ted_but_copy db 'ted_but_copy',0
sz_ted_but_paste db 'ted_but_paste',0
sz_ted_but_undo db 'ted_but_undo',0
sz_ted_but_redo db 'ted_but_redo',0
sz_ted_but_reverse db 'ted_but_reverse',0
sz_ted_but_find_next db 'ted_but_find_next',0
sz_ted_text_colored db 'ted_text_colored',0
sz_ted_version db 'version_text_edit',0

View File

@ -168,6 +168,10 @@ op_flag_en=10b
.flags: dd flags+0 ; ä« £¨
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use TreeList ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
struc tree_list info_size,info_max_count,style, img_cx,img_cy,\
col_bkg,col_zag,col_txt, box_l,box_t,box_w,box_h, capt_cy,info_capt_offs,\
info_capt_len,el_focus, p_scrol,on_press {
@ -201,10 +205,6 @@ struc tree_list info_size,info_max_count,style, img_cx,img_cy,\
.on_press dd on_press
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use TreeList ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
tl_info_size equ word[edi +4] ;à §¬¥à ¤ ­­ëå ¢ë¤¥«ï¥¬ëå ¤«ï ª ¦¤®£® 㧫  (¯®«ì§®¢ â¥«ìá쪨¥ ¤ ­­ë¥ + ⥪áâ ¤«ï ¯®¤¯¨á¨)
tl_info_max_count equ dword[edi+6] ;¬ ªá¨¬ «ì­®¥ ª®«¨ç¥á⢮ 㧫®¢, ª®â®àë¥ ¬®¦­® ¤®¡ ¢¨âì ¢ í«¥¬¥­â
tl_style equ dword[edi+10] ;á⨫¨ í«¥¬¥­â 
@ -245,3 +245,102 @@ tl_err_load_caption equ 1b ;
tl_err_load_info_size equ 100b ;­¥ ᮢ¯ ¤ ¥â à §¬¥à ¨­ä®à¬ æ¨®­­®© áâàãªâãàë ¯à¨ ®âªàë⨨
tl_load_mode_add equ 0x20000 ;®¯æ¨ï áç¨â뢠­¨ï ¢ ०¨¬¥ ¤®¡ ¢«¥­¨ï ¨­ä®à¬ æ¨¨
tl_save_load_heder_size equ 26 ;à §¬¥à § £®«®¢ª  ¤«ï § ¯¨á¨/ç⥭¨ï í«¥¬¥­â®¢
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use TextEditor ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ted_wnd_l equ dword[edi+ 0] ;®ª­® । ªâ®à : ®âáâ㯠᫥¢ 
ted_wnd_t equ dword[edi+ 4] ;®ª­® । ªâ®à : ®âáâ㯠ᢥàåã
ted_wnd_w equ dword[edi+ 8] ;®ª­® । ªâ®à : è¨à¨­ 
ted_wnd_h equ dword[edi+12] ;®ª­® । ªâ®à : ¢ëá®â 
ted_rec_l equ dword[edi+16] ;è¨à¨­  ¯ ­¥«¨ ¢ ®ª­¥
ted_rec_t equ dword[edi+20] ;¢ëá®â  ¯ ­¥«¨ ¢ ®ª­¥
ted_rec_w equ dword[edi+24] ;è¨à¨­  ᨬ¢®«  (§­ ª®¬¥áâ ) ¢ ®ª­¥
ted_rec_h equ dword[edi+28] ;¢ëá®â  ᨬ¢®«  (§­ ª®¬¥áâ ) ¢ ®ª­¥
ted_drag_m equ byte[edi+32] ;¢ë¤¥«¥­¨¥ ®â ¬ëè¨
ted_drag_k equ byte[edi+33] ;¢ë¤¥«¥­¨¥ ®â ª« ¢¨ âãàë
ted_sel_x0 equ dword[edi+34] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï x0
ted_sel_y0 equ dword[edi+38] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï y0
ted_sel_x1 equ dword[edi+42] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï x1
ted_sel_y1 equ dword[edi+46] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï y1
;§ ¯ á­ë¥ ª®®à¤¨­ âë ¢ë¤¥«¥­¨ï
ted_seln_x0 equ dword[edi+50]
ted_seln_y0 equ dword[edi+54]
ted_seln_x1 equ dword[edi+58]
ted_seln_y1 equ dword[edi+62]
ted_tex equ dword[edi+66] ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ⥪áâ 
ted_tex_1 equ dword[edi+70] ;㪠§ â¥«ì ­  1-î áâàªãâàã ᨬ¢®« 
ted_tex_end equ dword[edi+74] ;㪠§ â¥«ì ­  ¯®á«¥¤­îî áâàãªâãàã ᨬ¢®« 
ted_cur_x equ dword[edi+78] ;ª®®à¤¨­ â  x ªãàá®à 
ted_cur_y equ dword[edi+82] ;ª®®à¤¨­ â  y ªãàá®à 
ted_max_chars equ dword[edi+86] ;¬ ªá¨¬ «ì­®¥ ç¨á«® ᨬ¢®«®¢ ¢ ®¤­®¬ ¤®ªã¬¥­â¥
ted_colors_text_count equ dword[edi+90] ;ª®««¨ç¥á⢮ 梥⮢ ⥪áâ 
ted_key_words_count equ dword[edi+94] ;ª®««¨ç¥á⢮ ª«î祢ëå á«®¢
ted_color_cursor equ dword[edi+98] ;梥⠪ãàá®à 
ted_color_wnd_capt equ dword[edi+102] ;梥⠯®«¥© ¢®ªà㣠®ª­ 
ted_color_wnd_work equ dword[edi+106] ;梥â ä®­  ®ª­ 
ted_color_wnd_bord equ dword[edi+110] ;梥â ⥪áâ  ­  ¯®«ïå
ted_color_select equ dword[edi+114] ;梥⠢뤥«¥­¨ï
ted_color_cur_text equ dword[edi+118] ;梥â ᨬ¢®«  ¯®¤ ªãàá®à®¬
ted_color_wnd_text equ dword[edi+122] ;梥â ⥪áâ  ¢ ®ª­¥
ted_syntax_file equ dword[edi+126] ;㪠§ â¥«ì ­  ­ ç «® ä ©«  ᨭ⠪á¨á 
ted_syntax_file_size equ dword[edi+130] ;¬ ªá¨¬ «ì­ë© à §¬¥à ä ©«  ᨭ⠪á¨á 
ted_text_colors equ dword[edi+134] ;㪠§ â¥«ì ­  ¬ áᨢ 梥⮢ ⥪áâ 
ted_help_text_f1 equ dword[edi+138] ;㪠§ â¥«ì ­  ⥪áâ á¯à ¢ª¨ (¯® ­ ¦ â¨¨ F1)
ted_help_id equ dword[edi+142] ;¨¤¥­â¨ä¨ª â®à ¤«ï á¯à ¢ª¨
ted_key_words_data equ dword[edi+146] ;㪠§ â¥«ì ­  áâàãªâãàë ª«î祢ëå á«®¢ TexColViv
ted_tim_ch equ dword[edi+150] ;ª®««¨ç¥á⢮ ¨§¬¥­¥­¨© ¢ ä ©«¥
ted_tim_undo equ dword[edi+154] ;ª®««¨ç¥á⢮ ®â¬¥­¥­­ëå ¤¥©á⢨©
ted_tim_ls equ dword[edi+158] ;¢à¥¬ï ¯®á«¥¤­¥£® á®åà ­¥­¨ï
ted_tim_co equ dword[edi+162] ;¢à¥¬ï ¯®á«¥¤­¥© 梥⮢®© à §¬¥âª¨
ted_el_focus equ dword[edi+166] ;㪠§ â¥«ì ­  ¯¥à¥¬¥­­ãî í«¥¬¥­â  ¢ 䮪ãá¥
ted_err_save equ byte[edi+170] ;®è¨¡ª  á®åà ­¥­¨ï ä ©« 
ted_panel_id equ byte[edi+171] ;­®¬¥à ®âªàë⮩ ¯ ­¥«¨
ted_key_new equ byte[edi+172] ;ᨬ¢®«, ª®â®àë© ¡ã¤¥â ¤®¡ ¢«ïâáï á ª« ¢¨ âãàë
ted_symbol_new_line equ byte[edi+173] ;ᨬ¢®« § ¢¥à襭¨ï áâப¨
ted_scr_w equ dword[edi+174] ;¢¥à⨪ «ì­ë© áªà®««¨­£
ted_scr_h equ dword[edi+178] ;£®à¨§®­â «ì­ë© áªà®««¨­£
ted_arr_key_pos equ dword[edi+182] ;㪠§ â¥«ì ­  ¬ áᨢ ¯®§¨æ¨© ª«î祢ëå á«®¢
ted_buffer equ dword[edi+186] ;㪠§ â¥«ì ­  ¡ãä¥à ª®¯¨à®¢ ­¨ï/¢áâ ¢ª¨
ted_buffer_find equ dword[edi+190] ;㪠§ â¥«ì ­  ¡ãä¥à ¤«ï ¯®¨áª 
ted_cur_ins equ byte[edi+194] ;०¨¬ à ¡®âë ªãàá®à  (®¡ëç­ë© ¨«¨ § ¬¥­ )
ted_mode_color equ byte[edi+195] ;०¨¬ ¢ë¤¥«¥­¨ï á«®¢ 梥⮬ (0-¢ëª«. 1-¢ª«.)
ted_mode_invis equ byte[edi+196] ;०¨¬ ¯®ª §  ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
ted_gp_opt equ byte[edi+197] ;®¯æ¨¨ ¢®§¢à é ¥¬ë¥ ä㭪樥© ted_get_pos_by_cursor
ted_fun_on_key_ctrl_o equ dword[edi+198] ;㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+O (®âªàë⨥ ä ©« )
ted_fun_on_key_ctrl_f equ dword[edi+202] ;... Ctrl+F (¢ë§®¢ /áªàëâ¨ï ¯ ­¥«¨ ¯®¨áª )
ted_fun_on_key_ctrl_n equ dword[edi+206] ;... Ctrl+N (ᮧ¤ ­¨¥ ­®¢®£® ¤®ªã¬¥­â )
ted_fun_on_key_ctrl_s equ dword[edi+210] ;... Ctrl+S
ted_buffer_size equ dword[edi+214] ;à §¬¥à ¡ãä¥à  ª®¯¨à®¢ ­¨ï/¢áâ ¢ª¨
ted_fun_find_err equ dword[edi+218] ;㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ ¯®¨áª § ª®­ç¨«áï ­¥ã¤ ç­®
ted_fun_init_synt_err equ dword[edi+222] ;㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ®è¨¡®ç­®¬ ®âªàë⨨ ä ©«  ᨭ⠪á¨á 
ted_fun_draw_panel_buttons equ dword[edi+226] ;㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ á ª­®¯ª ¬¨
ted_fun_draw_panel_find equ dword[edi+230] ;㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ¯®¨áª 
ted_fun_draw_panel_syntax equ dword[edi+234] ;㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ᨭ⠪á¨á 
ted_fun_save_err equ dword[edi+238] ;㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ á®åà ­¥­¨¥ ä ©«  § ª®­ç¨«®áì ­¥ã¤ ç­®
;------------------------------------------------------------------------------
ted_opt_ed_move_cursor equ 1 ;¤¢¨£ âì ªãàá®à ¯®á«¥ ¤®¡ ¢«¥­¨ï ⥪áâ 
ted_opt_ed_change_time equ 2 ;¤®¡ ¢«ïâì ¨§¬¥­¥­¨ï ¯à¨ । ªâ¨à®¢ ­¨¨ ⥪áâ 
ted_offs_sel equ 34 ;ᬥ饭¨¥ áâàãªâãàë sel
ted_offs_seln equ 50 ;ᬥ饭¨¥ áâàãªâãàë seln
ted_offs_count_colors equ 90 ;ᬥ饭¨¥ ¯¥à¥¬¥­­®© ª®««¨ç¥á⢠ 梥⮢
ted_offs_key_new equ 172
ted_offs_symbol_new_line equ 173 ;ᬥ饭¨¥ ᨬ¢®«  ­®¢®© áâப¨
;------------------------------------------------------------------------------
; *** scroll bar constant ***
sb_offs_size_x equ 0
sb_offs_start_x equ 2
sb_offs_size_y equ 4
sb_offs_start_y equ 6
sb_offs_max_area equ 16
sb_offs_cur_area equ 20
sb_offs_position equ 24
sb_offs_redraw equ 40
sb_offs_delta2 equ 46
sb_offs_all_redraw equ 80
;------------------------------------------------------------------------------

View File

@ -24,7 +24,9 @@
<li>d_button</li>
<li>menubar</li>
<li>filebrowser</li>
<li><a href="tree_list\info_treelist.htm">tree_list</a></li>
<li>filepath</li>
<li><a href="tree_list\info_treelist.htm">tree_list</a></li>
<li><a href="t_edit\t_edit.htm">text_editor</a></li>
</ul>
<h1><a name="autors">Àâòîðñêèé ñîñòàâ</a></h1>
@ -36,6 +38,6 @@
<p>Èãîðü Àôàíàñüåâ aka IgorA</p>
<hr>
<p>Äîęóěĺíňŕöč˙ îáíîâë˙ëŕńü ďîńëĺäíčé đŕç 05.02.10.</p>
<p>Äîęóěĺíňŕöč˙ îáíîâë˙ëŕńü ďîńëĺäíčé đŕç 29.04.10.</p>
</body>
</html>

View File

@ -36,16 +36,6 @@ pre{
color: #004000;
background: #ffd0ff;
}
pre font.f0 { color: #ffff00; }
pre font.f1 { color: #ffffff; }
pre font.f2 { color: #00ff00; }
pre font.f3 { color: #00ffff; }
pre font.f4 { color: #808080; }
pre font.f5 { color: #ff40ff; }
pre font.f6 { color: #4080ff; }
pre font.f7 { color: #ff0000; }
pre font.f8 { color: #ffcc00; }
pre font.f9 { color: #00ccff; }
caption
{
@ -57,15 +47,12 @@ caption
}
table
{
font-size: 10px;
border-collapse: collapse;
border: #000000 1px solid;
background-color: #c0e7fb;
}
table td
{
border: none;
text-align: center;
}
table th
{

View File

@ -0,0 +1,138 @@
<html>
<head>
<title>элемент Text Editor</title>
<meta http-equiv="content-type" content="text/html; charset=WINDOWS-1251">
<link href="../style.css" type=text/css rel=stylesheet>
</head>
<body>
<p><a href="../box_lib.htm">На главную &uarr;</a></p>
<h1>Оглавление</h1>
<p><a href="#vveden">Введение</a></p>
<p><a href="#funct">Функции</a></p>
<ul>
<li><a href="#fun_but_copy">ted_but_copy</a></li>
</ul>
<h1><a name="vveden">Введение</a></h1>
<p>Элемент text_editor позволяет работать с текстовыми файлами, содержит много функция для редактирования текста.</p>
<p><img src="../../../../../../other/t_edit/t_edit.png"></p>
<p>Внешний вид программы, с элементом text_editor.</p>
<h2>Возможности</h2>
<ul>
<li>Открытие (Ctrl+O)/Сохранение файла.</li>
<li>Редактирование: Повтор/Отмена действия (Ctrl+Z), Вырезать/Копировать (Ctrl+C)/Вставить (Ctrl+V), Поиск (Ctrl+F, F3).</li>
<li>Выделение цветом слов, заданных в файле синтаксиса. Вывод справки по ним, если она есть (нажатием F1 когда курсор на слове).</li>
</ul>
<h2>Некоторые недоработки</h2>
<ul>
<li>Если открыть большой файл, размер которого больше чем:
maxChars equ 100002 ;(...+2)
он откроется не весь, а первые maxChars-2 символов из файла
(о чем выдается сообщение).</li>
<li>При сохранении программа не спрашивает о замене существ. файла.</li>
</ul>
<h2>О работе программы</h2>
<p>Раздел для программистов (и интересующихся людей), в котором расказаны
некоторые идеи, на которых построена данная программа.</p>
<p>Для работы с текстом программа использует структуры:</p>
<pre>struct symbol
c db ? ; +0 символ
col db ? ; +1 цвет
perv dd ? ; +2
next dd ? ; +6 указатели
tc dd ? ; +10 врем. создания
td dd ? ; +14 врем. удаления
ends</pre>
<p>Каждая из таких структур сохраняет один символ в переменной 'c'. Переменные
'perv' и 'next' хранят индексы первого и следующего символов. Благодаря чему
текст создается в виде цепочки символов (двунаправленный список).</p>
<p><b>'tc'</b> - время создания символа, при отмене действия текстовый редактор "знает"
какие символы отображать, а какие нет (хотя все символы "висят" в памяти).</p>
<p><b>'td'</b> - время удаления символа, заполняется при удалении, при отмене действия
удаления символов, текст может быть восстановлен.</p>
<p><b>'col'</b> - используется для цветовой разметки.</p>
<h1><a name="funct">Функции</a></h1>
<p>Функции на экспорт:</p>
<h4><a name="fun_but_copy">ted_but_copy</a></h4>
<p>Функция которая будет вызываться при нажатии на кнопку копирования в буфер или на <b>Ctrl+C</b>.</p>
<p>Пример использования:</p>
<pre>stdcall [ted_but_copy], tedit0</pre>
<h4>ted_but_cut</h4><p></p>
<h4>ted_but_find_next</h4><p></p>
<h4>ted_but_paste</h4><p></p>
<h4>ted_but_redo</h4><p></p>
<h4>ted_but_reverse</h4><p></p>
<h4>ted_but_save_file</h4><p></p>
<h4>ted_but_select_word</h4><p></p>
<h4>ted_but_sumb_lover</h4><p></p>
<h4>ted_but_sumb_upper</h4><p></p>
<h4>ted_but_undo</h4><p></p>
<h4>ted_can_save</h4><p></p>
<h4>ted_clear</h4><p></p>
<h4>ted_delete</h4><p></p>
<h4>ted_draw</h4><p></p>
<h4>ted_init</h4><p></p>
<h4>ted_init_syntax_file</h4><p></p>
<h4>ted_is_select</h4><p></p>
<h4>ted_key</h4><p></p>
<h4>ted_mouse</h4><p></p>
<h4>ted_open_file</h4><p></p>
<h4>ted_text_add</h4><p></p>
<h4>ted_text_colored</h4><p></p>
<p>Внутренние функции:</p>
<p><b>ted_get_text_perv_pos</b> - переход на предыдущий символ в цепи (через указатель 'perv')</p>
<p><b>ted_get_text_next_pos</b> - переход на следующий символ в цепи (через указатель 'next')</p>
<p><b>ted_symbol_not_vis</b> - определяет видимый ли указанный символ на экране (в зависимости
от значений 'tc' и 'td')</p>
<p><b>ted_iterat_next</b> - переход на следующий видимый символ в цепи. Использует для
работы функции ted_get_text_next_pos и ted_symbol_not_vis.</p>
<p><b>ted_iterat_perv</b> - переход на предедущий видимый символ в цепи.</p>
<p><b>ted_iterat_next_pos_char</b> - найти следующую позицию указанного символа (edx-поз. начала
поиска, bl->код искомого символа)</p>
<p><b>ted_get_pos_by_coords</b> - берет позицию символа по координатам (esi->коорд. x, знак;
ecx->коорд. y, строка)</p>
<p><b>ted_go_to_pos</b> - переставляет курсор в указанную позицию, если указанная позиция
находится вне экрана, то также переставляются скролинги (ecx->коорд. x, знак; edx->коорд. y, строка)</p>
<h1>Формат файла подсветки *.syn</h1>
<table>
<tr><th>Элемент</th><th>Размер (байт)</th></tr>
<tr><td>Количество цветов текста</td>
<td><pre>4</pre></td></tr>
<tr><td>Количество подсвечиваемых слов</td>
<td><pre>4</pre></td></tr>
<tr><td>Цвета интерфейса</td>
<td><pre>4*6</pre></td></tr>
<tr><td>Цвета для текста</td>
<td><pre>4*(кол. цв. текста)</pre></td></tr>
<tr><td>Структуры со свойствами и описаниями слов</td>
<td><pre>sizeof(TexColViv)*(кол. слов)</pre></td></tr>
<tr><td>Разделительный символ, означающий начало описаний слов (всегда равен 0)</td>
<td><pre>1 байт</pre></td></tr>
<tr><td>Описания слов (строки текста с 0-ми в конце)</td>
<td><pre>(длинна справочного текста + 1)</pre></td></tr>
</table>
<h4>Замечания.</h4>
<ul>
<li>Все слова должны быть расположены в порядке следования их ASCII кодов.
Возможно в будущих версиях формат файлов подсветки будет изменен.</li>
</ul>
<hr>
<p>Документация обновлялась последний раз 29.04.10.</p>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
; макрос для системной библиотеки box_lib.obj
; элемент TreeList для Kolibri OS
; ôàéë ïîñëåäíèé ðàç èçìåíÿëñÿ 14.04.2010 IgorA
; файл последний раз изменялся 29.04.2010 IgorA
; на код применена GPL2 лицензия
@ -1303,7 +1303,7 @@ tl_strlen:
cmp byte[eax],0
je @f
inc eax
loop @b
jmp @b
@@:
sub eax,esi
ret

View File

@ -6,7 +6,7 @@ if not exist bin\te_icon.bmp @copy te_icon.bmp bin\te_icon.bmp
if not exist bin\info mkdir bin\info
copy info\* bin\info\*
@fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj
if not exist bin\box_lib.obj @fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj
@kpack bin\box_lib.obj
@erase lang.inc

View File

@ -6,7 +6,7 @@ if not exist bin\te_icon.bmp @copy te_icon.bmp bin\te_icon.bmp
if not exist bin\info mkdir bin\info
copy info\* bin\info\*
@fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj
if not exist bin\box_lib.obj @fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj
@kpack bin\box_lib.obj
@erase lang.inc

View File

@ -48,7 +48,7 @@ table
</head>
<body>
<h1>TextEditor версия от 22.04.2010</h1>
<h1>TextEditor версия от 29.04.2010</h1>
<h2>О программе</h2>
<p>Программа для работы с текстовыми файлами.
Лицензия свободная.</p>
@ -73,11 +73,11 @@ table
<tr><td>Поддержка кодировок KOI8M, OEM</td>
<td>есть</td><td>нет</td></tr>
<tr><td>Подсветка синтаксиса</td>
<td>подсветка заранее зашита в программу</td><td>подсветка берется из файлов, которые может указать пользователь. Также есть возможность получать справку по подсвечиваемым словам (если она есть в файлах подсветки, навести курсор на слово и нажать F1).</td><td></td></tr>
<td>подсветка заранее зашита в программу</td><td>подсветка берется из файлов, которые может указать пользователь. Также есть возможность получать справку по подсвечиваемым словам (если она есть в файлах подсветки, навести курсор на слово и нажать F1).</td></tr>
<tr><td>Многократная отмена/повтор действий</td>
<td>нет</td><td>есть</td><td></td></tr>
<td>нет</td><td>есть</td></tr>
<tr><td>Ограничения на размер файлов</td>
<td>нет</td><td>есть</td><td></td></tr>
<td>нет</td><td>есть</td></tr>
</table>
<h2>Некоторые недоработки</h2>
@ -112,21 +112,8 @@ ends</pre>
удаления символов, текст может быть восстановлен.</p>
<p><b>'col'</b> - используется для цветовой разметки.</p>
<p>Теперь немного о функциях:</p>
<p><b>GetTexPervPos</b> - переход на предыдущий символ в цепи (через указатель 'perv')</p>
<p><b>GetTexNextPos</b> - переход на следующий символ в цепи (через указатель 'next')</p>
<p><b>SymbNotVis</b> - определяет видимый ли указанный символ на экране (в зависимости
от значений 'tc' и 'td')</p>
<p><b>IteratNext</b> - переход на следующий видимый символ в цепи. Использует для
работы функции GetTexNextPos и SymbNotVis.</p>
<p><b>IteratPerv</b> - переход на предедущий видимый символ в цепи.</p>
<p><b>ItPoNextUc</b> - найти следующую позицию указанного символа (edx-поз. начала
поиска, bl->код искомого символа)</p>
<p><b>GetPosByParam</b> - берет позицию символа по координатам (esi->коорд. x, знак;
ecx->коорд. y, строка)</p>
<p><b>GoToPos</b> - переставляет курсор в указанную позицию, если указанная позиция
находится вне экрана, то также переставляются скролинги (ecx->коорд. x, знак; edx->коорд. y, строка)</p>
<h3>Функции</h3>
<p>Информацию по функциям смотрите в документации по элементу t_edit в библиотеке box_lib.obj.</p>
<h3>Формат файла подсветки *.syn</h3>
<table>

View File

@ -1,7 +1,83 @@
struct f70
func_n dd ?
param1 dd ?
param2 dd ?
param3 dd ?
param4 dd ?
rezerv db ?
name dd ?
ends
struct TexColViv
Text rb MAX_COLOR_WORD_LEN ; á«®¢® ¤«ï ¯®¤á¢¥âª¨
f1 dd 0 ; á¯à ¢ª  ¯® á«®¢ã
wwo db ? ; whole words only
endc db ? ; ᨬ¢®« ª®­æ  ¢ë¤¥«¥­¨ï (wwo&4)
color db ? ; ­®¬¥à 梥â 
ends
struct symbol
c db ? ; +0 ᨬ¢®«
col db ? ; +1 梥â
perv dd ? ; +2
next dd ? ; +6 㪠§ â¥«¨
tc dd ? ; +10 ¢à¥¬. ᮧ¤ ­¨ï
td dd ? ; +14 ¢à¥¬. 㤠«¥­¨ï
ends
hed db 'TextEditor 29.04.10',0 ;¯®¤¯¨áì ®ª­ 
sc system_colors
fn_icon db 'te_icon.bmp',0
bmp_icon dd 0
run_file_70 f70
;input:
; al = ª®¤ ®è¨¡ª¨
align 4
but_NewFile:
ted_on_init_synt_err:
mov byte[msgbox_3.err],al
stdcall [mb_create],msgbox_3,thread ;message: Can-t open color options file!
ret
;-----------------------------------------------------------------------------
;äã­ªæ¨ï ¤«ï ¢ë¤¥«¥­¨ï ¯ ¬ïâ¨
;input:
; ecx = size data
;otput:
; eax = pointer to memory
align 4
mem_Alloc:
push ebx
mov eax,68
mov ebx,12
int 0x40
pop ebx
ret
;-----------------------------------------------------------------------------
;äã­ªæ¨ï ¤«ï ®á¢®¡®¦¤¥­¨ï ¯ ¬ïâ¨
;input:
; ecx = pointer to memory
align 4
mem_Free:
push eax ebx
stdcall ted_can_save, tedit0
cmp ecx,0
jz @f
mov eax,68
mov ebx,13
int 0x40
@@:
pop ebx eax
ret
align 4
ted_but_new_file:
push eax ebx
stdcall [ted_can_save], tedit0
cmp al,1
jne @f
stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
@ -18,9 +94,9 @@ but_NewFile:
align 4
On_NewFile:
stdcall ted_clear, tedit0,1
stdcall [ted_clear], tedit0,1
call draw_but_toolbar
stdcall draw_main_win, tedit0
stdcall [ted_draw], tedit0
ret
align 4
@ -28,7 +104,7 @@ On_SaveAndNewFile:
push edi
mov edi, tedit0
stdcall but_SaveFile,edi
stdcall [ted_but_save_file],edi,run_file_70,[edit1.text]
cmp ted_err_save,0
jne @f
call On_NewFile
@ -36,387 +112,119 @@ On_SaveAndNewFile:
pop edi
ret
;description:
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ¡¥§ ®ª®­  á®®¡é¥­¨ï
align 4
but_no_msg_OpenFile: ;äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ç¥à¥§ ¡¥§ ®ª®­  á®®¡é¥­¨ï
stdcall ted_on_open_file, tedit0
ret
but_no_msg_OpenFile:
push eax ebx
stdcall [ted_open_file], tedit0,run_file_70,[edit1.text]
call ted_messages_after_open_file
pop ebx eax
ret
;äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
;description:
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
align 4
but_OpenFile:
push eax
stdcall ted_can_save, tedit0
cmp al,1
jne @f
stdcall [mb_create],msgbox_5,thread ;message: save changes in file?
stdcall [mb_setfunctions],msgbox_5_funct
jmp .ret_f
@@:
stdcall ted_on_open_file, tedit0
.ret_f:
pop eax
ret
align 4
proc ted_on_open_file, edit:dword ;äã­ªæ¨ï ®âªàëâ¨ï ä ©« 
push eax ebx edi
mov edi,dword[edit]
mov eax,70
mov [run_file_70.func_n], 0
mov [run_file_70.param1], 0
mov [run_file_70.param2], 0
mov [run_file_70.param3], maxChars-2 ;sizeof.symbol
m2m [run_file_70.param4], ted_tex
mov [run_file_70.rezerv], 0
push dword[edit1.text]
pop dword[run_file_70.name]
mov ebx,run_file_70
int 0x40
cmp eax,0
je @f
cmp eax,6
je @f
cmp ax,10
jl .zifra_0_9
mov al,'?'
sub ax,48
.zifra_0_9:
add ax,48
mov byte[msgbox_4.err],al
stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
jmp .ret_f
@@:
cmp ebx,-1
je .ret_f
;if open file
call OpenFile
cmp ebx,maxChars-2
jl .ret_f
stdcall [mb_create],msgbox_1,thread
.ret_f:
pop edi ebx eax
ret
endp
align 4
proc but_SaveFile, edit:dword
pushad
stdcall ted_can_save,edi
cmp al,0
je .no_save
mov edi,dword[edit]
mov ecx,maxChars
call mem_Alloc
push eax
mov edx,ted_tex
xor ecx,ecx
@@:
call IteratNext
cmp edx,ted_tex_1
jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol
mov bl,[edx]
mov byte[eax],bl
inc eax
inc ecx
jmp @b
@@:
cmp ecx,0
je @f
pop eax
mov [run_file_70.param4],eax
push eax
mov eax,70
mov [run_file_70.func_n], 2
mov [run_file_70.param1], 0
mov [run_file_70.param2], 0
mov [run_file_70.param3], ecx
mov [run_file_70.rezerv], 0
push [edit1.text]
pop [run_file_70.name]
mov ebx,run_file_70
int 0x40
mov ted_err_save,ax
cmp eax,0
je .no_msg
; cmp eax,6
; je @f
cmp ax,10
jl .zifra_0_9
mov al,'?'
sub ax,48
.zifra_0_9:
add ax,48
mov byte[msgbox_6.err],al
stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
jmp @f
.no_msg:
m2m ted_tim_ls,ted_tim_ch
@@:
pop ecx
call mem_Free
.no_save:
popad
ret
endp
align 4
proc but_FindText, edit:dword
pushad
mov edi,dword[edit]
call GetPos
mov eax,[edit2.text]
mov bl,byte[eax]
@@:
call GetFindRezult
cmp bh,1
je @f ; find
call IteratNext
cmp edx,ted_tex_1
jle @f
jmp @b
@@:
cmp bh,0
je @f
call GetTexCoords
inc ebx ;move cursor right
mov ted_sel_x1,ebx
mov ted_sel_y1,eax
mov edx,eax
mov ecx,ebx
call GoToPos
mov edx,esi ;esi ¡ë«® ãáâ ­®¢«¥® ¢ GetFindRezult
call GetTexCoords
mov ted_sel_x0,ebx
mov ted_sel_y0,eax
stdcall draw_main_win,edi
jmp .end_find
@@:
stdcall [mb_create],msgbox_7,thread ;message: Can not find text
.end_find:
popad
ret
endp
ted_but_open_file:
push eax ebx
stdcall [ted_can_save], tedit0
cmp al,1
jne @f
stdcall [mb_create],msgbox_5,thread ;message: save changes in file?
stdcall [mb_setfunctions],msgbox_5_funct
jmp .ret_f
@@:
stdcall [ted_open_file], tedit0,run_file_70,[edit1.text]
call ted_messages_after_open_file
.ret_f:
pop ebx eax
ret
;input:
; eax - text need find
; bl - first symbol to find
; edx - first symbol pointer
; edi - pointer to tedit struct
;output:
; bh - rezult
; edx - last text position (if find sucess)
; esi - first symbol pointer
;description:
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
; eax = ª®¤ ®è¨¡ª¨
; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ­­ëå ¡ ©â
; edi = pointer to tedit struct
align 4
GetFindRezult:
push eax
mov bh,1
mov esi,edx ;copy edx
@@:
cmp byte[edx],bl
jne .no_text
ted_messages_after_open_file:
push ecx
cmp eax,0
je @f
cmp eax,6
je @f
cmp ax,10
jl .zifra_0_9
mov al,'?'
sub ax,48
.zifra_0_9:
add ax,48
inc eax ;*** get next symbol (in find text) ***
mov bl,byte[eax]
cmp bl,0
je @f ;end of find text
mov byte[msgbox_4.err],al
stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
jmp .ret_f
@@:
cmp ebx,-1
je .ret_f
;if open file
mov ecx,ted_max_chars
sub ecx,2 ;ecx = ¬ ªá¨¬ «ì­®¥ ç¨á«® ¡ ©â, ¤«ï ª®â®àëå ¡ë«  ¢ë¤¥«¥­  ¯ ¬ïâì
cmp ebx,ecx
jl .ret_f
stdcall [mb_create],msgbox_1,thread
.ret_f:
pop ecx
ret
call IteratNext ;*** get next symbol (in editor text) ***
cmp edx,ted_tex_1
jle @f ;end of editor text
jmp @b
.no_text:
xor bh,bh
mov edx,esi ;restore edx
@@:
pop eax
mov bl,byte[eax] ;restore bl
ret
align 4
ted_save_err_msg:
mov byte[msgbox_6.err],al
stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
ret
align 4
proc ted_but_open_syntax, edit:dword
push edi
push ebx edi
mov edi,dword[edit]
cmp ted_panel_id,TE_PANEL_SYNTAX
cmp ted_panel_id,TED_PANEL_SYNTAX
jne @f
stdcall dword[tl_node_get_data], tree1
pop dword[fn_col_option]
stdcall InitColText,edi
call CmColored
stdcall draw_main_win,edi
mov ebx,dword[fn_col_option]
copy_path ebx,fn_syntax_dir,file_name_rez,0x0
copy_path file_name_rez,sys_path,file_name,0x0
stdcall [ted_init_syntax_file],edi,run_file_70,file_name
call [ted_text_colored]
stdcall [ted_draw],edi
@@:
pop edi
pop edi ebx
ret
endp
align 4
proc ted_but_select_word, edit:dword
pushad
mov edi,dword[edit]
call GetPos
push edx
call ItPervColorTag
cmp edx,ted_tex_1
jle @f
call GetTexCoords
mov ted_sel_x0,ebx
mov ted_sel_y0,eax
@@:
pop edx
call ItNextColorTag
cmp edx,ted_tex_1
jle @f
call GetTexCoords
mov ted_sel_x1,ebx
mov ted_sel_y1,eax
@@:
call draw_but_toolbar
stdcall draw_main_win,edi
popad
ret
endp
align 4
proc ted_but_cut, edit:dword
proc ted_but_find ;¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
push edi
mov edi,dword[edit]
mov edi,tedit0
stdcall ted_but_copy,edi
stdcall ted_set_undo,edi
stdcall SelTextDel,ted_opt_ed_change_time
cmp al,1
jne @f
call draw_but_toolbar
stdcall draw_main_win,edi
@@:
pop edi
ret
endp
;output:
; al = 1 if copy text
align 4
proc ted_but_copy, edit:dword
pushad
mov edi,dword[edit]
stdcall IsSel,edi
cmp al,0
je .end_f ;if not selected text
stdcall SelNormalize,edi
mov esi,ted_seln_x1
mov ecx,ted_seln_y1
call GetPosByParam
mov ebx,edx
mov esi,ted_seln_x0
mov ecx,ted_seln_y0
call GetPosByParam
mov esi,ebx
xor ecx,ecx
mov ebx,buf
;mov edx,ted_tex
@@:
cmp edx,ted_tex_1 ;end of file
jle @f
cmp edx,esi ;end of select
je @f
inc ecx
cmp ecx,BUF_SIZE ;owerflow bufer
je @f
mov al,byte[edx]
mov byte[ebx],al
inc ebx
call IteratNext
jmp @b
@@:
add ecx,buf
mov byte[ebx],0
cmp ecx,0
je .end_f
call draw_but_toolbar
stdcall draw_bufer,edi
.end_f:
popad
ret
endp
align 4
proc ted_but_paste, edit:dword
push eax ebx esi edi
mov edi,dword[edit]
mov esi,buf
call strlen
cmp eax,1
jl @f
stdcall ted_set_undo,edi
mov esi,eax
mov ebx,ted_opt_ed_change_time+ted_opt_ed_move_cursor
stdcall SelTextDel,ebx
cmp al,1
jne .del
mov ebx,ted_opt_ed_move_cursor
.del:
stdcall ted_text_add,edi,buf,esi,ebx
call draw_but_toolbar
stdcall draw_main_win,edi
@@:
pop edi esi ebx eax
ret
endp
align 4
proc but_find, edit:dword ;¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
push edi
mov edi,dword[edit]
cmp ted_panel_id,TE_PANEL_NULL
cmp ted_panel_id,TED_PANEL_NULL
je @f
mov ted_panel_id,TE_PANEL_NULL
mov ted_panel_id,TED_PANEL_NULL
mov ted_wnd_l,0
jmp .e_if
@@:
mov ted_panel_id,TE_PANEL_FIND
mov ted_wnd_l,TE_PANEL_WIDTH
mov ted_panel_id,TED_PANEL_FIND
mov ted_wnd_l,TED_PANEL_WIDTH
.e_if:
stdcall EvSize,edi
stdcall draw_main_win,edi
stdcall [ted_draw],edi
pop edi
ret
endp
align 4
ted_on_find_err:
stdcall [mb_create],msgbox_7,thread ;message: Can not find text
ret
align 4
but_replace:
ret
@ -425,102 +233,6 @@ align 4
but_find_key_w:
ret
align 4
proc but_sumb_upper, edit:dword
push edi esi
mov edi,dword[edit]
mov [conv_table],EvUpper
call ConvertSelText
cmp esi,0
je @f
stdcall draw_main_win,edi
@@:
pop esi edi
ret
endp
align 4
proc but_sumb_lover, edit:dword
push edi esi
mov edi,dword[edit]
mov [conv_table],EvLover
call ConvertSelText
cmp esi,0
je @f
stdcall draw_main_win,edi
@@:
pop esi edi
ret
endp
align 4
proc but_reverse, edit:dword
push eax ebx edi
mov edi,dword[edit]
stdcall IsSel,edi
cmp al,0
je @f
stdcall SelNormalize,edi
push esi ecx edx
mov esi,ted_seln_x0
mov ecx,ted_seln_y0
call GetPosByParam
mov eax,edx
mov esi,ted_seln_x1
cmp esi,0
je .beg_str
dec esi
.beg_str:
mov ecx,ted_seln_y1
call GetPosByParam
;call GetTexPervPos
mov ebx,edx
pop edx ecx esi
;cmp eax,...
;je @f
call Revers
@@:
stdcall draw_main_win,edi
pop edi ebx eax
ret
endp
align 4
proc ted_but_undo, edit:dword
push eax edi
mov edi,dword[edit]
mov eax,ted_tim_undo
cmp ted_tim_ch,eax
jbe @f
inc ted_tim_undo
;call CmColored
stdcall draw_main_win,edi
call draw_but_toolbar
@@:
pop edi eax
ret
endp
align 4
proc ted_but_redo, edit:dword
push edi
mov edi,dword[edit]
cmp ted_tim_undo,1
jb @f
dec ted_tim_undo
;call CmColored
stdcall draw_main_win,edi
call draw_but_toolbar
@@:
pop edi
ret
endp
align 4
proc but_sumb_invis, edit:dword
push edi
@ -528,7 +240,7 @@ proc but_sumb_invis, edit:dword
xor ted_mode_invis,1
call draw_but_toolbar
stdcall draw_main_win,edi
stdcall [ted_draw],edi
pop edi
ret
endp
@ -541,153 +253,30 @@ proc but_k_words_show, edit:dword
xor ted_mode_color,1
cmp ted_mode_color,0
je @f
call CmColored
call [ted_text_colored]
@@:
call draw_but_toolbar
stdcall draw_main_win,edi
stdcall [ted_draw],edi
pop edi
ret
endp
;input:
; edi = pointer to tedit struct
align 4
but_CtrlHome:
mov ted_cur_x,0
mov ted_cur_y,0
push eax
mov eax,ted_scr_w
mov dword[eax+sb_offs_position],0
mov eax,ted_scr_h
mov dword[eax+sb_offs_position],0
pop eax
call draw_but_toolbar
stdcall draw_main_win,edi
ret
align 4
proc but_synt_show, edit:dword
push edi
mov edi,[edit]
cmp ted_panel_id,TE_PANEL_NULL
cmp ted_panel_id,TED_PANEL_NULL
je @f
mov ted_panel_id,TE_PANEL_NULL
mov ted_panel_id,TED_PANEL_NULL
mov ted_wnd_l,0
jmp .e_if
@@:
mov ted_panel_id,TE_PANEL_SYNTAX
mov ted_wnd_l,TE_PANEL_WIDTH
mov ted_panel_id,TED_PANEL_SYNTAX
mov ted_wnd_l,TED_PANEL_WIDTH
.e_if:
stdcall EvSize,edi
stdcall draw_main_win,edi
pop edi
ret
endp
align 4
proc ted_sel_key_up, edit:dword
push edi
mov edi,dword[edit]
cmp ted_drag_k,1
je @f
stdcall SelStart,edi
mov ted_drag_k,1
@@:
push dx
call CurMoveUp
cmp dl,8
jne @f
call OnInitialUpdate
@@:
pop dx
stdcall SelMove,edi
stdcall draw_main_win,edi
pop edi
ret
endp
align 4
proc ted_sel_key_down, edit:dword
push edi
mov edi,dword[edit]
cmp ted_drag_k,1
je @f
stdcall SelStart,edi
mov ted_drag_k,1
@@:
push dx
call CurMoveDown
cmp dl,8
jne @f
call OnInitialUpdate
@@:
pop dx
stdcall SelMove,edi
stdcall draw_main_win,edi
pop edi
ret
endp
align 4
proc ted_sel_key_left, edit:dword
push edi
mov edi,dword[edit]
cmp ted_drag_k,1
je @f
stdcall SelStart,edi
@@:
push dx
call CurMoveLeft
stdcall SelMove,edi
cmp ted_drag_k,1
je @f
mov ted_drag_k,1
mov dl,8
@@:
cmp dl,8
jne @f
call OnInitialUpdate
stdcall draw_main_win,edi
jmp .end_f
@@:
stdcall draw_cur_line,edi
.end_f:
pop dx
pop edi
ret
endp
align 4
proc ted_sel_key_right, edit:dword
push edi
mov edi,dword[edit]
cmp ted_drag_k,1
je @f
stdcall SelStart,edi
@@:
push dx
call CurMoveRight
stdcall SelMove,edi
cmp ted_drag_k,1
je @f
mov ted_drag_k,1
mov dl,8
@@:
cmp dl,8
jne @f
call OnInitialUpdate
stdcall draw_main_win,edi
jmp .end_f
@@:
stdcall draw_cur_line,edi
.end_f:
pop dx
stdcall [ted_draw],edi
pop edi
ret
endp

View File

@ -72,6 +72,32 @@ menu_bar_mouse dd aMenu_bar_mouse
tl_node_close_open dd sz_tl_node_close_open
tl_node_lev_inc dd sz_tl_node_lev_inc
tl_node_lev_dec dd sz_tl_node_lev_dec
ted_but_save_file dd sz_ted_but_save_file
ted_but_sumb_upper dd sz_ted_but_sumb_upper
ted_but_sumb_lover dd sz_ted_but_sumb_lover
ted_can_save dd sz_ted_can_save
ted_clear dd sz_ted_clear
ted_delete dd sz_ted_delete
ted_draw dd sz_ted_draw
ted_init dd sz_ted_init
ted_init_syntax_file dd sz_ted_init_syntax_file
ted_is_select dd sz_ted_is_select
ted_key dd sz_ted_key
ted_mouse dd sz_ted_mouse
ted_open_file dd sz_ted_open_file
ted_text_add dd sz_ted_text_add
ted_but_select_word dd sz_ted_but_select_word
ted_but_cut dd sz_ted_but_cut
ted_but_copy dd sz_ted_but_copy
ted_but_paste dd sz_ted_but_paste
ted_but_undo dd sz_ted_but_undo
ted_but_redo dd sz_ted_but_redo
ted_but_reverse dd sz_ted_but_reverse
ted_but_find_next dd sz_ted_but_find_next
ted_text_colored dd sz_ted_text_colored
;;;version_text_edit dd sz_ted_version
dd 0,0
aEdit_box_draw db 'edit_box',0
@ -119,6 +145,31 @@ aMenu_bar_mouse db 'menu_bar_mouse',0
sz_tl_node_close_open db 'tl_node_close_open',0
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
sz_ted_but_save_file db 'ted_but_save_file',0
sz_ted_but_sumb_upper db 'ted_but_sumb_upper',0
sz_ted_but_sumb_lover db 'ted_but_sumb_lover',0
sz_ted_can_save db 'ted_can_save',0
sz_ted_clear db 'ted_clear',0
sz_ted_delete db 'ted_delete',0
sz_ted_draw db 'ted_draw',0
sz_ted_init db 'ted_init',0
sz_ted_init_syntax_file db 'ted_init_syntax_file',0
sz_ted_is_select db 'ted_is_select',0
sz_ted_key db 'ted_key',0
sz_ted_mouse db 'ted_mouse',0
sz_ted_open_file db 'ted_open_file',0
sz_ted_text_add db 'ted_text_add',0
sz_ted_but_select_word db 'ted_but_select_word',0
sz_ted_but_cut db 'ted_but_cut',0
sz_ted_but_copy db 'ted_but_copy',0
sz_ted_but_paste db 'ted_but_paste',0
sz_ted_but_undo db 'ted_but_undo',0
sz_ted_but_redo db 'ted_but_redo',0
sz_ted_but_reverse db 'ted_but_reverse',0
sz_ted_but_find_next db 'ted_but_find_next',0
sz_ted_text_colored db 'ted_text_colored',0
;;;sz_ted_version db 'version_text_edit',0
;--------------------------------------------------
align 4
msgbox_lib_import:
@ -275,10 +326,10 @@ menu_data_1:
.get_mouse_flag dd 0 ;+116
;-------------------------
TE_PANEL_NULL equ 0
TE_PANEL_FIND equ 1
TE_PANEL_SYNTAX equ 2
TE_PANEL_WIDTH equ 150 ;øèðèíà ïàíåëè
TED_PANEL_NULL equ 0 ;­¥â ®âªàë⮩ ¯ ­¥«¨
TED_PANEL_FIND equ 1 ;¯ ­¥«ì ¯®¨áª 
TED_PANEL_SYNTAX equ 2 ;¯ ­¥«ì ¢ë¡®à  ä ©«®¢ ¯®¤á¢¥âª¨
TED_PANEL_WIDTH equ 150 ;è¨à¨­  ¯ ­¥«¨
count_of_dir_list_files equ 15
@ -290,75 +341,6 @@ struct TexSelect
y1 dd ?
ends
;------------------------------------------------------------------------------
ted_wnd_l equ dword[edi+ 0] ;®ª­® । ªâ®à : ®âáâ㯠᫥¢ 
ted_wnd_t equ dword[edi+ 4] ;®ª­® । ªâ®à : ®âáâ㯠ᢥàåã
ted_wnd_w equ dword[edi+ 8] ;®ª­® । ªâ®à : è¨à¨­ 
ted_wnd_h equ dword[edi+12] ;®ª­® । ªâ®à : ¢ëá®â 
ted_rec_l equ dword[edi+16] ;è¨à¨­  ¯ ­¥«¨ ¢ ®ª­¥
ted_rec_t equ dword[edi+20] ;¢ëá®â  ¯ ­¥«¨ ¢ ®ª­¥
ted_rec_w equ dword[edi+24] ;è¨à¨­  ᨬ¢®«  (§­ ª®¬¥áâ ) ¢ ®ª­¥
ted_rec_h equ dword[edi+28] ;¢ëá®â  ᨬ¢®«  (§­ ª®¬¥áâ ) ¢ ®ª­¥
ted_drag_m equ byte[edi+32] ;¢ë¤¥«¥­¨¥ ®â ¬ëè¨
ted_drag_k equ byte[edi+33] ;¢ë¤¥«¥­¨¥ ®â ª« ¢¨ âãàë
ted_sel_x0 equ dword[edi+34] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï x0
ted_sel_y0 equ dword[edi+38] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï y0
ted_sel_x1 equ dword[edi+42] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï x1
ted_sel_y1 equ dword[edi+46] ;ª®®à¤¨­ â  ¢ë¤¥«¥­¨ï y1
;§ ¯ á­ë¥ ª®®à¤¨­ âë ¢ë¤¥«¥­¨ï
ted_seln_x0 equ dword[edi+50]
ted_seln_y0 equ dword[edi+54]
ted_seln_x1 equ dword[edi+58]
ted_seln_y1 equ dword[edi+62]
ted_tex equ dword[edi+66] ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ⥪áâ 
ted_tex_1 equ dword[edi+70] ;㪠§ â¥«ì ­  1-î áâàªãâàã ᨬ¢®« 
ted_tex_end equ dword[edi+74] ;㪠§ â¥«ì ­  ¯®á«¥¤­îî áâàãªâãàã ᨬ¢®« 
ted_cur_x equ dword[edi+78] ;ª®®à¤¨­ â  x ªãàá®à 
ted_cur_y equ dword[edi+82] ;ª®®à¤¨­ â  y ªãàá®à 
ted_cur_ins equ byte[edi+86] ;०¨¬ à ¡®âë ªãàá®à  (®¡ëç­ë© ¨«¨ § ¬¥­ )
ted_mode_color equ byte[edi+87] ;०¨¬ ¢ë¤¥«¥­¨ï á«®¢ 梥⮬ (0-¢ëª«. 1-¢ª«.)
ted_mode_invis equ byte[edi+88] ;०¨¬ ¯®ª §  ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
ted_gp_opt equ byte[edi+89] ;®¯æ¨¨ ¢®§¢à é ¥¬ë¥ ä㭪樥© GetPos
ted_colors_text_count equ dword[edi+90] ;ª®««¨ç¥á⢮ 梥⮢ ⥪áâ 
ted_key_words_count equ dword[edi+94] ;ª®««¨ç¥á⢮ ª«î祢ëå á«®¢
ted_color_cursor equ dword[edi+98] ;梥⠪ãàá®à 
ted_color_wnd_capt equ dword[edi+102] ;梥⠯®«¥© ¢®ªà㣠®ª­ 
ted_color_wnd_work equ dword[edi+106] ;梥â ä®­  ®ª­ 
ted_color_wnd_bord equ dword[edi+110] ;梥â ⥪áâ  ­  ¯®«ïå
ted_color_select equ dword[edi+114] ;梥⠢뤥«¥­¨ï
ted_color_cur_text equ dword[edi+118] ;梥â ᨬ¢®«  ¯®¤ ªãàá®à®¬
ted_color_wnd_text equ dword[edi+122] ;梥â ⥪áâ  ¢ ®ª­¥
ted_syntax_file equ dword[edi+126] ;㪠§ â¥«ì ­  ­ ç «® ä ©«  ᨭ⠪á¨á 
ted_syntax_file_end equ dword[edi+130] ;㪠§ â¥«ì ­  ª®­¥æ ä ©«  ᨭ⠪á¨á 
ted_text_colors equ dword[edi+134] ;㪠§ â¥«ì ­  ¬ áᨢ 梥⮢ ⥪áâ 
ted_help_text_f1 equ dword[edi+138] ;㪠§ â¥«ì ­  ⥪áâ á¯à ¢ª¨ (¯® ­ ¦ â¨¨ F1)
ted_help_id equ dword[edi+142] ;¨¤¥­â¨ä¨ª â®à ¤«ï á¯à ¢ª¨
ted_key_words_data equ dword[edi+146] ;㪠§ â¥«ì ­  áâàãªâãàë ª«î祢ëå á«®¢ TexColViv
ted_tim_ch equ dword[edi+150] ;ª®««¨ç¥á⢮ ¨§¬¥­¥­¨© ¢ ä ©«¥
ted_tim_undo equ dword[edi+154] ;ª®««¨ç¥á⢮ ®â¬¥­¥­­ëå ¤¥©á⢨©
ted_tim_ls equ dword[edi+158] ;¢à¥¬ï ¯®á«¥¤­¥£® á®åà ­¥­¨ï
ted_tim_co equ dword[edi+162] ;¢à¥¬ï ¯®á«¥¤­¥© 梥⮢®© à §¬¥âª¨
ted_el_focus equ dword[edi+166] ;㪠§ â¥«ì ­  ¯¥à¥¬¥­­ãî í«¥¬¥­â  ¢ 䮪ãá¥
ted_err_save equ word[edi+170] ;®è¨¡ª  á®åà ­¥­¨ï ä ©« 
ted_key_new equ byte[edi+172] ;ᨬ¢®«, ª®â®àë© ¡ã¤¥â ¤®¡ ¢«ïâáï á ª« ¢¨ âãàë
ted_symbol_new_line equ byte[edi+173] ;ᨬ¢®« § ¢¥à襭¨ï áâப¨
ted_scr_w equ dword[edi+174] ;¢¥à⨪ «ì­ë© áªà®««¨­£
ted_scr_h equ dword[edi+178] ;£®à¨§®­â «ì­ë© áªà®««¨­£
ted_panel_id equ byte[edi+182] ;­®¬¥à ®âªàë⮩ ¯ ­¥«¨
;------------------------------------------------------------------------------
sb_offs_max_area equ 16
sb_offs_cur_area equ 20
sb_offs_position equ 24
sb_offs_redraw equ 40
;------------------------------------------------------------------------------
ted_opt_ed_move_cursor equ 1 ;¤¢¨£ âì ªãàá®à ¯®á«¥ ¤®¡ ¢«¥­¨ï ⥪áâ 
ted_opt_ed_change_time equ 2 ;¤®¡ ¢«ïâì ¨§¬¥­¥­¨ï ¯à¨ । ªâ¨à®¢ ­¨¨ ⥪áâ 
ted_offs_sel equ 34 ;ᬥ饭¨¥ áâàãªâãàë sel
ted_offs_seln equ 50 ;ᬥ饭¨¥ áâàãªâãàë seln
ted_offs_count_colors equ 90 ;ᬥ饭¨¥ ¯¥à¥¬¥­­®© ª®««¨ç¥á⢠ 梥⮢
ted_offs_key_new equ 172
ted_offs_symbol_new_line equ 173 ;ᬥ饭¨¥ ᨬ¢®«  ­®¢®© áâப¨
;------------------------------------------------------------------------------
align 4
tedit0: ;áâàãªâãà  â¥ªá⮢®£® । ªâ®à 
.wnd BOX 0,50,440,150 ;+ 0
@ -367,53 +349,67 @@ tedit0: ;
.drag_k db 0 ;+33 ¢ë¤¥«¥­¨¥ ®â ª« ¢¨ âãàë
.sel TexSelect 0,0,0,0 ;+34 áâàãªâãà  ¢ë¤¥«¥­¨ï
.seln TexSelect ;+50 ¤®¯®«­¨â¥«ì­ ï áâàãªâãà  ¢ë¤¥«¥­¨ï
.tex dd 0 ;+66 text memory pointer
.tex_1 dd 0 ;+70 text first symbol pointer
.tex_end dd 0 ;+74 text end memory pointer
.cur_x dd 0 ;+78
.cur_y dd 0 ;+82
.cur_ins db 1 ;+86
.mode_color db 1 ;+87 ०¨¬ ¢ë¤¥«¥­¨ï á«®¢ 梥⮬ (0-¢ëª«. 1-¢ª«.)
.mode_invis db 0 ;+88 ०¨¬ ¯®ª §  ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
.gp_opt db 0 ;+89 ®¯æ¨¨ ¢®§¢à é ¥¬ë¥ ä㭪樥© GetPos
.tex dd 0 ;+66 text memory pointer
.tex_1 dd 0 ;+70 text first symbol pointer
.tex_end dd 0 ;+74 text end memory pointer
.cur_x dd 0 ;+78 ª®®à¤¨­ â  x ªãàá®à 
.cur_y dd 0 ;+82 ª®®à¤¨­ â  y ªãàá®à 
.max_chars dd maxChars ;+86 ¬ ªá¨¬ «ì­®¥ ç¨á«® ᨬ¢®«®¢ ¢ ®¤­®¬ ¤®ªã¬¥­â¥
; \/ ­¥ à §à뢠âì á«¥¤ãî騥 ¯¥à¥¬¥­­ë¥:
.count_colors_text dd 1 ;+90 ª®««¨ç¥á⢮ 梥⮢ ⥪áâ 
.count_key_words dd 0 ;+94 ª®««¨ç¥á⢮ ª«î祢ëå á«®¢
.color_cursor dd 0x808080 ;+98 梥⠪ãàá®à 
.color_wnd_capt dd 0x80 ;+102 梥⠯®«¥© ¢®ªà㣠®ª­ 
.color_wnd_work dd 0x0 ;+106 梥â ä®­  ®ª­ 
.color_wnd_bord dd 0xd0d0d0 ;+110 梥â ⥪áâ  ­  ¯®«ïå
.color_select dd 0x208080 ;+114 梥⠢뤥«¥­¨ï
.color_cur_text dd 0xff0000 ;+118 梥â ᨬ¢®«  ¯®¤ ªãàá®à®¬
.color_wnd_text dd 0xffff00 ;+122 梥â ⥪áâ  ¢ ®ª­¥
.color_cursor dd 0x808080 ;+98 梥⠪ãàá®à 
.color_wnd_capt dd 0x80 ;+102 梥⠯®«¥© ¢®ªà㣠®ª­ 
.color_wnd_work dd 0x0 ;+106 梥â ä®­  ®ª­ 
.color_wnd_bord dd 0xd0d0d0 ;+110 梥â ⥪áâ  ­  ¯®«ïå
.color_select dd 0x208080 ;+114 梥⠢뤥«¥­¨ï
.color_cur_text dd 0xff0000 ;+118 梥â ᨬ¢®«  ¯®¤ ªãàá®à®¬
.color_wnd_text dd 0xffff00 ;+122 梥â ⥪áâ  ¢ ®ª­¥
; /\ ¤à㣨¥, ¨¤ã騥 ­¨¦¥ ¬®¦­® à §à뢠âì.
.syntax_file dd 0 ;+126 㪠§ â¥«ì ­  ­ ç «® ä ©«  ᨭ⠪á¨á 
.syntax_file_end dd 0 ;+130 㪠§ â¥«ì ­  ª®­¥æ ä ©«  ᨭ⠪á¨á 
.text_colors dd 0 ;+134 㪠§ â¥«ì ­  ¬ áᨢ 梥⮢ ⥪áâ 
.help_text_f1 dd 0 ;+138 㪠§ â¥«ì ­  ⥪áâ á¯à ¢ª¨ (¯® ­ ¦ â¨¨ F1)
.help_id dd -1 ;+142 ¨¤¥­â¨ä¨ª â®à ¤«ï á¯à ¢ª¨
.key_words_data dd 0 ;+146 㪠§ â¥«ì ­  áâàãªâãàë ª«î祢ëå á«®¢ TexColViv
.tim_ch dd ? ;+150 ª®«¨ç¥á⢮ ¨§¬¥­¥­¨© ¢ ä ©«¥
.tim_undo dd ? ;+154 ª®«¨ç¥á⢮ ®â¬¥­¥­­ëå ¤¥©á⢨©
.tim_ls dd ? ;+158 ¢à¥¬ï ¯®á«¥¤­¥£® á®åà ­¥­¨ï
.tim_co dd ? ;+162 ¢à¥¬ï ¯®á«¥¤­¥© 梥⮢®© à §¬¥âª¨
.el_focus dd el_focus ;+166 㪠§ â¥«ì ­  ¯¥à¥¬¥­­ãî í«¥¬¥­â  ¢ 䮪ãá¥
.err_save dw 0 ;+170 ®è¨¡ª  á®åà ­¥­¨ï ä ©« 
.syntax_file dd 0 ;+126 㪠§ â¥«ì ­  ­ ç «® ä ©«  ᨭ⠪á¨á 
.syntax_file_size dd maxSyntaxFileSize ;+130 ¬ ªá¨¬ «ì­ë© à §¬¥à ä ©«  ᨭ⠪á¨á 
.text_colors dd 0 ;+134 㪠§ â¥«ì ­  ¬ áᨢ 梥⮢ ⥪áâ 
.help_text_f1 dd 0 ;+138 㪠§ â¥«ì ­  ⥪áâ á¯à ¢ª¨ (¯® ­ ¦ â¨¨ F1)
.help_id dd -1 ;+142 ¨¤¥­â¨ä¨ª â®à ¤«ï á¯à ¢ª¨
.key_words_data dd 0 ;+146 㪠§ â¥«ì ­  áâàãªâãàë ª«î祢ëå á«®¢ TexColViv
.tim_ch dd ? ;+150 ª®«¨ç¥á⢮ ¨§¬¥­¥­¨© ¢ ä ©«¥
.tim_undo dd ? ;+154 ª®«¨ç¥á⢮ ®â¬¥­¥­­ëå ¤¥©á⢨©
.tim_ls dd ? ;+158 ¢à¥¬ï ¯®á«¥¤­¥£® á®åà ­¥­¨ï
.tim_co dd ? ;+162 ¢à¥¬ï ¯®á«¥¤­¥© 梥⮢®© à §¬¥âª¨
.el_focus dd el_focus ;+166 㪠§ â¥«ì ­  ¯¥à¥¬¥­­ãî í«¥¬¥­â  ¢ 䮪ãá¥
.err_save db 0 ;+170 ®è¨¡ª  á®åà ­¥­¨ï ä ©« 
.panel_id db 0 ;+171 ­®¬¥à ®âªàë⮩ ¯ ­¥«¨
.key_new db 0 ;+172 ᨬ¢®«, ª®â®àë© ¡ã¤¥â ¤®¡ ¢«ïâáï á ª« ¢¨ âãàë
.symbol_new_line db 20 ;+173 ᨬ¢®« § ¢¥à襭¨ï áâப¨
.scr_w dd wScr ;+174 ¢¥à⨪ «ì­ë© áªà®««¨­£
.scr_h dd hScr ;+178 £®à¨§®­â «ì­ë© áªà®««¨­£
.panel_id db 0 ;+182 ­®¬¥à ®âªàë⮩ ¯ ­¥«¨
.scr_w dd wScr ;+174 ¢¥à⨪ «ì­ë© áªà®««¨­£
.scr_h dd hScr ;+178 £®à¨§®­â «ì­ë© áªà®««¨­£
.arr_key_pos dd 0 ;+182 㪠§ â¥«ì ­  ¬ áᨢ ¯®§¨æ¨© ª«î祢ëå á«®¢
.buffer dd buf ;+186 㪠§ â¥«ì ­  ¡ãä¥à ª®¯¨à®¢ ­¨ï/¢áâ ¢ª¨
.buffer_find dd buf_find ;+190 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï ¯®¨áª 
.cur_ins db 1 ;+194 ०¨¬ à ¡®âë ªãàá®à  (®¡ëç­ë© ¨«¨ § ¬¥­ )
.mode_color db 1 ;+195 ०¨¬ ¢ë¤¥«¥­¨ï á«®¢ 梥⮬ (0-¢ëª«. 1-¢ª«.)
.mode_invis db 0 ;+196 ०¨¬ ¯®ª §  ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
.gp_opt db 0 ;+197 ®¯æ¨¨ ¢®§¢à é ¥¬ë¥ ä㭪樥© ted_get_pos_by_cursor
.fun_on_key_ctrl_o dd ted_but_open_file ;+198 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+O (®âªàë⨥ ä ©« )
.fun_on_key_ctrl_f dd ted_but_find ;+202 ... Ctrl+F (¢ë§®¢ /áªàëâ¨ï ¯ ­¥«¨ ¯®¨áª )
.fun_on_key_ctrl_n dd ted_but_new_file ;+206 ... Ctrl+N (ᮧ¤ ­¨¥ ­®¢®£® ¤®ªã¬¥­â )
.fun_on_key_ctrl_s dd 0 ;+210 ... Ctrl+S
.buffer_size dd BUF_SIZE ;+214 à §¬¥à ¡ãä¥à  ª®¯¨à®¢ ­¨ï/¢áâ ¢ª¨
.fun_find_err dd ted_on_find_err ;+218 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ ¯®¨áª § ª®­ç¨«áï ­¥ã¤ ç­®
.fun_init_synt_err dd ted_on_init_synt_err ;+222 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ®è¨¡®ç­®¬ ®âªàë⨨ ä ©«  ᨭ⠪á¨á 
.fun_draw_panel_buttons dd draw_but_toolbar ;+226 㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ á ª­®¯ª ¬¨
.fun_draw_panel_find dd draw_panel_find ;+230 㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ¯®¨áª 
.fun_draw_panel_syntax dd draw_panel_syntax ;+234 㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ᨭ⠪á¨á 
.fun_save_err dd ted_save_err_msg ;+238 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ á®åà ­¥­¨¥ ä ©«  § ª®­ç¨«®áì ­¥ã¤ ç­®
;------------------------------------------------------------------------------
FkPos: rd 256
conv_tabl rb 128 ; â ¡«¨æ  ¤«ï ª®­¢¥àâ¨à®¢ ­¨ï scan-ª®¤  ¢ ascii-ª®¤
buf db BUF_SIZE dup(0)
el_focus dd 0
mouse_dd dd 0
tree1 tree_list 264,count_of_dir_list_files+2, tl_key_no_edit+tl_draw_par_line+tl_list_box_mode,\
16,16, 0x8080ff,0x0000ff,0xffffff, 0,70,TE_PANEL_WIDTH-17,120, 0,0,0, el_focus,\
16,16, 0x8080ff,0x0000ff,0xffffff, 0,70,TED_PANEL_WIDTH-17,120, 0,0,0, el_focus,\
ws_dir_lbox,0
;dir_list memory
@ -426,7 +422,6 @@ tree_file_struct:
dir_mem rb 32+304*count_of_dir_list_files
if lang eq ru
menu_text_area:
@ -525,11 +520,6 @@ txtFindCapt db '
txtFindNext db '<27> ©â¨ ¤ «¥¥',0
txtFormatCapt db '”®à¬ â',0
txtFormatApply db '<27>ਬ¥­¨âì',0
txtRow db '‘âப ',0
txtCol db '‡­ ª',0
txtOtm db 'Žâ¬¥­ë',0
txtBuf db '<27>ãä¥à: '
buf db BUF_SIZE dup(0) ;buf âñåãäà ïîñëå txtBuf
else
@ -629,66 +619,9 @@ txtFindCapt db 'Search',0
txtFindNext db 'Find next',0
txtFormatCapt db 'Format',0
txtFormatApply db 'Apply',0
txtRow db 'Rows',0
txtCol db 'Cols',0
txtOtm db 'Undo',0
txtBuf db 'Buffer: '
buf db BUF_SIZE dup(0) ;buf always after txtBuf
end if
;------
align 4
EvChar db 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
EvUpper db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
db 80,81,82,83,84,85,86,87,88,89,90,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
EvLover db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111
db 112,113,114,115,116,117,118,119,120,121,122,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
conv_table dd 0
KM_SHIFT equ 0x00010000
KM_CTRL equ 0x00020000

File diff suppressed because it is too large Load Diff

View File

@ -16,8 +16,8 @@ use32
MAX_COLOR_WORD_LEN equ 40
maxChars equ 100002 ;(...+2)
BUF_SIZE equ 1000 ;bufer for copy|paste
maxColWords equ 10000
BUF_SIZE equ 1000 ;buffer for copy|paste
maxSyntaxFileSize equ 410000
include '../../proc32.inc'
include '../../macros.inc'
@ -27,9 +27,8 @@ include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'lang.inc'
include 't_data.inc'
include 'strlen.inc'
include 't_work.inc' ;text work functions
include 't_draw.inc' ;draw main window functions
include 't_button.inc'
include 't_button.inc' ;text work functions
@use_library
@ -37,14 +36,15 @@ align 4
start:
mcall 48,3,sc,sizeof.system_colors
m2m [wScr.bckg_col],[sc.work]
m2m [wScr.frnt_col],[sc.work_button]
m2m [wScr.line_col],[sc.work_button_text]
m2m [hScr.bckg_col],[sc.work]
m2m [hScr.frnt_col],[sc.work_button]
m2m [hScr.line_col],[sc.work_button_text]
mov eax,[sc.work]
mov [wScr.bckg_col],eax
mov [hScr.bckg_col],eax
mov eax,[sc.work_button]
mov [wScr.frnt_col],eax
mov [hScr.frnt_col],eax
mov eax,[sc.work_button_text]
mov [wScr.line_col],eax
mov [hScr.line_col],eax
mcall 68,11
or eax,eax
@ -75,7 +75,7 @@ load_libraries l_libs_start,load_lib_end
@@:
;---------------------------------------------------------------------
stdcall ted_init, tedit0
stdcall [ted_init], tedit0
stdcall dword[tl_data_init], tree1
;---------------------------------------------------------------------
@ -174,7 +174,10 @@ mov ecx,ebx
.end_dir_init:
;--- load color option file ---
stdcall InitColText, tedit0
mov ebx,dword[fn_col_option]
copy_path ebx,fn_syntax_dir,file_name_rez,0x0
copy_path file_name_rez,sys_path,file_name,0x0
stdcall [ted_init_syntax_file], tedit0,run_file_70,file_name
;--- get cmd line ---
cmp byte[buf_cmd_lin+3],0 ;buf_cmd_lin
@ -202,7 +205,7 @@ red_win:
mcall 9,procinfo,-1
stdcall EvSize,edi
mov eax,13 ;âåðõíèé ïðÿìîóãîëüíèê, äëÿ î÷èñòêè âåðõíåé ïàíåëè
mov eax,13 ;¢¥àå­¨© ¯àאַ㣮«ì­¨ª, ¤«ï ®ç¨á⪨ ¢¥àå­¥© ¯ ­¥«¨
xor ebx,ebx
mov ecx,ted_wnd_t
mov bx,word [procinfo.client_box.width]
@ -234,7 +237,7 @@ red_win:
cmp [err_ini0],1
je @f
stdcall draw_main_win, tedit0
stdcall [ted_draw], tedit0
@@:
mcall 12,2
@ -263,53 +266,13 @@ mouse:
test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
jne still
;-----------------------------------------------
cmp [hScr.delta2],0
jne .horizontal
.vertical:
mov eax,[wScr.max_area]
cmp eax,[wScr.cur_area]
jbe .horizontal
; mouse event for Vertical ScrollBar
stdcall [scrollbar_ver_mouse], dword wScr
mov eax,wScr.redraw
xor ebx,ebx
cmp [eax],ebx
je @f
mov [eax],ebx
stdcall [ted_mouse], tedit0
stdcall draw_main_win, tedit0
jmp still
@@:
cmp [wScr.delta2],0
jne still
.horizontal:
mov eax,[hScr.max_area]
cmp eax,[hScr.cur_area]
jbe .other
; mouse event for Horizontal ScrollBar
push dword hScr
call [scrollbar_hor_mouse]
mov eax,hScr.redraw
xor ebx,ebx
cmp [eax],ebx
je .other
mov [eax],ebx
stdcall draw_main_win, tedit0
jmp still
.other:
cmp [wScr.delta2],0
jne still
cmp [hScr.delta2],0
jne still
stdcall mouse_wnd_main, tedit0
cmp byte[tedit0.panel_id],TE_PANEL_FIND ;if not panel
cmp byte[tedit0.panel_id],TED_PANEL_FIND ;if not panel
jne @f
stdcall [edit_box_mouse], dword edit2
@@:
cmp byte[tedit0.panel_id],TE_PANEL_SYNTAX ;if not panel
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX ;if not panel
jne .menu_bar_1 ;@f
stdcall [tl_mouse], tree1
;-----------------------------------------------
@ -324,15 +287,15 @@ mouse:
je button.exit
cmp [menu_data_1.cursor_out],dword 3
jne @f
stdcall but_SaveFile, tedit0
stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text]
@@:
cmp [menu_data_1.cursor_out],dword 2
jne @f
call but_OpenFile
call ted_but_open_file
@@:
cmp [menu_data_1.cursor_out],dword 1
jne @f
call but_NewFile
call ted_but_new_file
@@:
;cmp [menu_data_1.cursor_out],dword 0
;jne @f
@ -357,29 +320,30 @@ endp
align 4
key:
mcall 66,3 ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
xor ebx,ebx
xor esi,esi
mov ecx,1
test al,0x03 ;[Shift]
jz @f
mov cl,2
or ebx,KM_SHIFT
or esi,KM_SHIFT
@@:
test al,0x0c ;[Ctrl]
jz @f
or ebx,KM_CTRL
or esi,KM_CTRL
@@:
test al,0x30 ;[Alt]
jz @f
mov cl,3
or ebx,KM_ALT
or esi,KM_ALT
@@:
test al,0x80 ;[NumLock]
jz @f
or ebx,KM_NUMLOCK
or esi,KM_NUMLOCK
@@:
mcall 26,2,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
mcall 2 ;¯®«ãç ¥¬ ª®¤ ­ ¦ â®© ª« ¢¨è¨
;stdcall [tl_key], tree1 ;???
;stdcall [tl_key], tree1
test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
@ -421,9 +385,10 @@ key:
jmp still
@@:
stdcall ted_key, tedit0, conv_tabl
stdcall [ted_key], tedit0, conv_tabl,esi
jmp still
align 4
button:
; cmp [menu_active],1 ;¥á«¨ ­ ¦ «¨ ¬¥­î, â® á­ ç «  ॠªæ¨ï ­  ¬¥­î
; jne @f ;mouse.menu_bar_1
@ -434,35 +399,35 @@ button:
mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
cmp ah,3
jne @f
call but_NewFile
call ted_but_new_file
@@:
cmp ah,4
jne @f
call but_OpenFile
call ted_but_open_file
@@:
cmp ah,5
jne @f
stdcall but_SaveFile, tedit0
stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text]
@@:
cmp ah,6
jne @f
stdcall ted_but_select_word, tedit0
stdcall [ted_but_select_word], tedit0
@@:
cmp ah,7
jne @f
stdcall ted_but_cut, tedit0
stdcall [ted_but_cut], tedit0
@@:
cmp ah,8
jne @f
stdcall ted_but_copy, tedit0
stdcall [ted_but_copy], tedit0
@@:
cmp ah,9
jne @f
stdcall ted_but_paste, tedit0
stdcall [ted_but_paste], tedit0
@@:
cmp ah,10
jne @f
stdcall but_find, tedit0
call ted_but_find
@@:
cmp ah,11
jne @f
@ -474,23 +439,23 @@ button:
@@:
cmp ah,13
jne @f
stdcall but_sumb_upper, tedit0
stdcall [ted_but_sumb_upper], tedit0
@@:
cmp ah,14
jne @f
stdcall but_sumb_lover, tedit0
stdcall [ted_but_sumb_lover], tedit0
@@:
cmp ah,15
jne @f
stdcall but_reverse, tedit0
stdcall [ted_but_reverse], tedit0
@@:
cmp ah,16
jne @f
stdcall ted_but_undo, tedit0
stdcall [ted_but_undo], tedit0
@@:
cmp ah,17
jne @f
stdcall ted_but_redo, tedit0
stdcall [ted_but_redo], tedit0
@@:
cmp ah,18
jne @f
@ -511,13 +476,13 @@ button:
@@:
cmp ah,201
jne @f
stdcall but_FindText, tedit0
stdcall [ted_but_find_next], tedit0
@@:
cmp ah,1
jne still
.exit:
stdcall ted_can_save, tedit0
stdcall [ted_can_save], tedit0
cmp al,1
jne @f
stdcall [mb_create],msgbox_8,thread ;message: save changes in file?
@ -526,7 +491,7 @@ button:
mov ecx,[bmp_icon]
call mem_Free
stdcall ted_delete, tedit0
stdcall [ted_delete], tedit0
stdcall dword[tl_data_clear], tree1
mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
@ -536,7 +501,7 @@ txtErrIni0 db '
err_ini0 db 0
edit1 edit_box 250, 220, 5, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_cmd_lin, mouse_dd, 0
edit2 edit_box TE_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
edit2 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
buf_cmd_lin db 302 dup(0)
buf_find db 302 dup(0)

File diff suppressed because it is too large Load Diff