From d5f5e7780a36047a989b4714801a095dcb598167 Mon Sep 17 00:00:00 2001 From: IgorA Date: Thu, 15 Apr 2010 15:50:49 +0000 Subject: [PATCH] t_edit: 1) sync with the new box_lib.obj 2) corrected bug that could occur when pressing Ctrl+F 3) change the code git-svn-id: svn://kolibrios.org@1449 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../libraries/box_lib/trunk/box_lib.mac | 29 + .../libraries/box_lib/trunk/tree_list.mac | 43 +- programs/other/t_edit/t_button.inc | 80 ++- programs/other/t_edit/t_data.inc | 29 + programs/other/t_edit/t_draw.inc | 644 +++++++++--------- programs/other/t_edit/t_edit.asm | 172 +++-- programs/other/t_edit/t_work.inc | 41 +- 7 files changed, 525 insertions(+), 513 deletions(-) diff --git a/programs/develop/libraries/box_lib/trunk/box_lib.mac b/programs/develop/libraries/box_lib/trunk/box_lib.mac index 6e051b807f..502f0223eb 100644 --- a/programs/develop/libraries/box_lib/trunk/box_lib.mac +++ b/programs/develop/libraries/box_lib/trunk/box_lib.mac @@ -205,6 +205,35 @@ struc tree_list info_size,info_max_count,style, img_cx,img_cy,\ ;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] ;⨫ +tl_data_nodes equ dword[edi+14] ;㪠⥫ 㧫 +tl_data_img equ dword[edi+18] ;㪠⥫ ࠦ 㧫 +tl_img_cx equ word[edi+22] ;ਭ +tl_img_cy equ word[edi+24] ; +tl_data_img_sys equ dword[edi+26] ;㪠⥫ ⥬ ࠦ (५, ᨪ) +tl_ch_tim equ dword[edi+30] ;⢮ 䠩 +tl_tim_undo equ dword[edi+38] ;⢮ ⬥ ⢨ +tl_cur_pos equ dword[edi+42] ; +tl_col_bkg equ dword[edi+46] ;梥 䮭 +tl_col_zag equ dword[edi+50] ;梥 +tl_col_txt equ dword[edi+54] ;梥 ⥪ +tl_box_left equ dword[edi+58] +tl_box_top equ dword[edi+62] +tl_box_width equ dword[edi+66] +tl_box_height equ dword[edi+70] +tl_capt_cy equ word[edi+74] ; +tl_info_capt_offs equ word[edi+76] ;ᤢ 砫 ⥪ ( 㧫) +tl_info_capt_len equ word[edi+78] ; ⥪ 㧫 (᫨ = 0 ) +tl_el_focus equ dword[edi+80] ;㪠⥫ 䮪 +tl_p_scrol equ dword[edi+84] ;㪠⥫ ஫ +tl_on_press equ dword[edi+96] ;㪠⥫ 㭪, 뢠 ⨨ Enter + +;data_info dd ? ;+ 0 㪠⥫ ᭮ +;ls_tim dd ? ;+34 ६ ᫥ ࠭ +;on_activate dd ? ;+92 㪠⥫ 㭪 ⨢஢ 㧫 + ;⠭ ⨫ tl_key_no_edit equ 1b ; ।஢ ( ஢, 㤠) tl_draw_par_line equ 10b ;ᮢ த⥫᪮ 㧫 diff --git a/programs/develop/libraries/box_lib/trunk/tree_list.mac b/programs/develop/libraries/box_lib/trunk/tree_list.mac index 38a8a23261..4f24e29094 100644 --- a/programs/develop/libraries/box_lib/trunk/tree_list.mac +++ b/programs/develop/libraries/box_lib/trunk/tree_list.mac @@ -1,6 +1,6 @@ ; box_lib.obj ; TreeList Kolibri OS -; 26.03.2010 IgorA +; 14.04.2010 IgorA ; GPL2 @@ -15,47 +15,6 @@ sizeof.TreeList equ 20 ; td dd ? ;+16 . ;ends -tl_info_size equ word[edi +4] ; ( + ) -tl_info_max_count equ dword[edi+6] ; , -tl_style equ dword[edi+10] ; -tl_data_nodes equ dword[edi+14] ; -tl_data_img equ dword[edi+18] ; -tl_img_cx equ word[edi+22] ; -tl_img_cy equ word[edi+24] ; -tl_data_img_sys equ dword[edi+26] ; (, ) -tl_ch_tim equ dword[edi+30] ; -tl_tim_undo equ dword[edi+38] ; -tl_cur_pos equ dword[edi+42] ; -tl_col_bkg equ dword[edi+46] ; -tl_col_zag equ dword[edi+50] ; -tl_col_txt equ dword[edi+54] ; -tl_box_left equ dword[edi+58] -tl_box_top equ dword[edi+62] -tl_box_width equ dword[edi+66] -tl_box_height equ dword[edi+70] -tl_capt_cy equ word[edi+74] ; -tl_info_capt_offs equ word[edi+76] ; ( ) -tl_info_capt_len equ word[edi+78] ; ( = 0 ) -tl_el_focus equ dword[edi+80] ; -tl_p_scrol equ dword[edi+84] ; -tl_on_press equ dword[edi+96] ; , Enter - -; -tl_key_no_edit equ 1b ; ( , ) -tl_draw_par_line equ 10b ; -tl_list_box_mode equ 100b ; ( ListBox ) - -; -tl_err_save_memory_size equ 10b ; -tl_err_load_caption equ 1b ; 'tree' -tl_err_load_info_size equ 100b ; -tl_load_mode_add equ 0x20000 ; -tl_save_load_heder_size equ 26 ; / - -;data_info dd ? ;+ 0 -;ls_tim dd ? ;+34 -;on_activate dd ? ;+92 - macro use_tree_list { ;----------------------------------------------------------------------------- diff --git a/programs/other/t_edit/t_button.inc b/programs/other/t_edit/t_button.inc index bdf1890fbd..f616c95e7b 100644 --- a/programs/other/t_edit/t_button.inc +++ b/programs/other/t_edit/t_button.inc @@ -23,7 +23,7 @@ On_NewFile: mov al,1 call Clear call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 pop eax ret @@ -83,13 +83,12 @@ On_OpenFile: call [mb_create] ;message: Can-t open text file! jmp .ret_f @@: - mov [err_opn],1 cmp ebx,-1 je .ret_f ;if open file call OpenFile call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 cmp ebx,maxChars-2 jl .ret_f push thread @@ -194,7 +193,7 @@ but_FindText: call GetTexCoords mov [sel.x0],ebx mov [sel.y0],eax - call draw_main_win + stdcall draw_main_win, tedit0 jmp .end_find @@: push thread @@ -241,12 +240,11 @@ GetFindRezult: but_OpenSyntax: cmp byte[panel_id],TE_PANEL_SYNTAX jne @f - push dword tree1 - call dword [tl_node_get_data] - pop dword [fn_col_option] + stdcall dword[tl_node_get_data], dword tree1 + pop dword[fn_col_option] call InitColText call CmColored - call draw_main_win + stdcall draw_main_win, tedit0 @@: ret @@ -272,7 +270,7 @@ but_select_word: @@: pop edx ecx ebx eax call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 jmp still but_cut: @@ -285,7 +283,7 @@ but_cut: cmp al,1 jne @f call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 @@: jmp still @@ -293,7 +291,7 @@ but_cut: ; al = 1 if copy text but_Copy: push ax - call IsSel + stdcall IsSel, tedit0 cmp al,0 jne @f pop ax @@ -336,7 +334,7 @@ but_Copy: cmp ecx,0 je @f call draw_but_toolbar - call draw_bufer + stdcall draw_bufer, tedit0 @@: pop esi edx ecx ebx ax ret @@ -354,24 +352,29 @@ but_paste: mov edi,buf call TextAdd call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 @@: pop edi esi bx eax jmp still -but_find: +proc but_find, edit:dword ;맮/⨥ ᪠ + push edi + mov edi,[edit] + cmp byte[panel_id],TE_PANEL_NULL je @f mov byte[panel_id],TE_PANEL_NULL - mov word[wndMain.left],0 + mov ted_wnd_l,0 jmp .e_if @@: mov byte[panel_id],TE_PANEL_FIND - mov word[wndMain.left],TE_PANEL_WIDTH + mov ted_wnd_l,TE_PANEL_WIDTH .e_if: - call EvSize - call draw_main_win - jmp still + stdcall EvSize,edi + stdcall draw_main_win,edi + pop edi + ret +endp but_replace: jmp still @@ -385,7 +388,7 @@ but_sumb_upper: call ConvertSelText cmp edi,0 je @f - call draw_main_win + stdcall draw_main_win, tedit0 @@: pop edi jmp still @@ -396,14 +399,14 @@ but_sumb_lover: call ConvertSelText cmp edi,0 je @f - call draw_main_win + stdcall draw_main_win, tedit0 @@: pop edi jmp still but_reverse: push eax ebx - call IsSel + stdcall IsSel, tedit0 cmp al,0 je @f call SelNormalize @@ -427,7 +430,7 @@ but_reverse: call Revers @@: pop ebx eax - call draw_main_win + stdcall draw_main_win, tedit0 jmp still but_undo: @@ -501,22 +504,27 @@ but_CtrlHome: mov [hScr.position],0 call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 ret -but_synt_show: +proc but_synt_show, edit:dword + push edi + mov edi,[edit] + cmp byte[panel_id],TE_PANEL_NULL je @f mov byte[panel_id],TE_PANEL_NULL - mov word[wndMain.left],0 + mov ted_wnd_l,0 jmp .e_if @@: mov byte[panel_id],TE_PANEL_SYNTAX - mov word[wndMain.left],TE_PANEL_WIDTH + mov ted_wnd_l,TE_PANEL_WIDTH .e_if: - call EvSize - call draw_main_win - jmp still + stdcall EvSize,edi + stdcall draw_main_win,edi + pop edi + ret +endp sel_KeyUp: cmp [dragk],1 @@ -532,7 +540,7 @@ sel_KeyUp: @@: pop dx call SelMove - call draw_main_win + stdcall draw_main_win, tedit0 ret sel_KeyDown: @@ -549,7 +557,7 @@ sel_KeyDown: @@: pop dx call SelMove - call draw_main_win + stdcall draw_main_win, tedit0 ret sel_KeyLeft: @@ -568,10 +576,10 @@ sel_KeyLeft: cmp dl,8 jne @f call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 jmp .end_f @@: - call draw_cur_line + stdcall draw_cur_line, tedit0 .end_f: pop dx ret @@ -592,10 +600,10 @@ sel_KeyRight: cmp dl,8 jne @f call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 jmp .end_f @@: - call draw_cur_line + stdcall draw_cur_line, tedit0 .end_f: pop dx ret \ No newline at end of file diff --git a/programs/other/t_edit/t_data.inc b/programs/other/t_edit/t_data.inc index fb566d0ec5..51a5c3089c 100644 --- a/programs/other/t_edit/t_data.inc +++ b/programs/other/t_edit/t_data.inc @@ -282,6 +282,35 @@ TE_PANEL_WIDTH equ 150 ; count_of_dir_list_files equ 15 +;------------------------------------------------------------------------------ +struct TexSelect + x0 dd ? + y0 dd ? + x1 dd ? + 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] ;뤥 +;------------------------------------------------------------------------------ +align 4 +tedit0: ; ⥪⮢ । + .wnd BOX 0,50,440,150 ;+ 0 + .rec BOX 30,23,7,10 ;+16 + .dragm db 0 ;+32 뤥 + dragk db 0 ;+33 뤥 + sel TexSelect 0,0,0,0 ;+34 뤥 + seln TexSelect ;+50 ⥫쭠 뤥 +;------------------------------------------------------------------------------ + 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,\ diff --git a/programs/other/t_edit/t_draw.inc b/programs/other/t_edit/t_draw.inc index cddc3c229e..a006004c46 100644 --- a/programs/other/t_edit/t_draw.inc +++ b/programs/other/t_edit/t_draw.inc @@ -1,60 +1,65 @@ -mouse_wnd_main: - push eax ebx ecx +proc mouse_wnd_main, edit:dword + push eax ebx ecx edi mcall 37,2 ;get mouse buttons + mov edi,dword[edit] + cmp al,1 jne @f mcall 37,1 ;get mouse coords - mov ebx,[wndMain.top] - add ebx,[recMain.top] + mov ebx,ted_wnd_t + add ebx,ted_rec_t cmp ax,bx jl @f ;y_mousey_wnd - mov ebx,[wndMain.left] - add ebx,[recMain.left] + mov ebx,ted_wnd_l + add ebx,ted_rec_l mov ecx,eax shr ecx,16 cmp cx,bx jl @f ;x_mousex_wnd - call draw_cursor_sumb + stdcall draw_cursor_sumb, tedit0 call wnd_main_click - ;call draw_main_cursor ;??? jmp .no_in_wnd @@: call wnd_main_mouse_scroll - cmp [dragm],0 + cmp ted_drag_m,0 je .no_in_wnd - mov [dragm],0 + mov ted_drag_m,0 call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 .no_in_wnd: - pop ecx ebx eax + pop edi ecx ebx eax ret +endp -; input: -; eax->(x,y) +;input: +; eax -> (x,y) +; edi -> tedit +;description: +; wnd_main_click: push ecx edx push eax shr eax,16 and eax,0xffff - sub eax,[wndMain.left] - sub eax,[recMain.left] + sub eax,ted_wnd_l + sub eax,ted_rec_l xor edx,edx - mov ecx,[recMain.width] + mov ecx,ted_rec_w div cx ;inc eax cmp eax,[hScr.cur_area] @@ -67,11 +72,11 @@ wnd_main_click: push eax and eax,0xffff - sub eax,[wndMain.top] - sub eax,[recMain.top] + sub eax,ted_wnd_t + sub eax,ted_rec_t xor edx,edx - mov ecx,[recMain.height] + mov ecx,ted_rec_h div cx inc eax cmp eax,[wScr.cur_area] @@ -82,12 +87,12 @@ wnd_main_click: mov [cur_y],eax pop eax - cmp [dragm],0 + cmp ted_drag_m,0 je @f call SelMove jmp .sel_move @@: - mov [dragm],1 + mov ted_drag_m,1 call SelStart .sel_move: pop edx ecx @@ -112,7 +117,7 @@ wnd_main_mouse_scroll: mov dword[wScr.position],ebx ;if scroll position out of range jmp .no_scroll @@: - call draw_main_win + stdcall draw_main_win, tedit0 .no_scroll: pop ebx eax ret @@ -145,7 +150,7 @@ or ecx,0x40000000 mov edx,85*65536+25 call draw_but_icon -call IsSel +stdcall IsSel, tedit0 cmp al,0 jne @f and ecx,0xffff @@ -226,26 +231,28 @@ or ecx,0x40000000 pop edx ecx ebx ret - ;input: -; ebx = x*2^16+y coords to left up point clear line -; esi = 0 clear all rows -; edi - number text line -clear_line_before_draw: - push eax ebx ecx edx +; clear_o - =1 , =0 +proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword + pushad + mov edi,dword[edit] + mov ebx,dword[coords] ;ebx = x*2^16+y coords to left up point clear line + mov esi,dword[numb_lin] ;esi - number text line + sub ebx,0x10001 ; - cmp esi,0 + cmp dword[clear_o],0 jne @f - add bx,word[recMain.height] - inc edi ; ??? + add ebx,ted_rec_h + inc esi ror ebx,16 - mov bx,word[wndMain.left] - add bx,word[recMain.left] + xor bx,bx + add ebx,ted_wnd_l + add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l ror ebx,16 @@: - mov ax,word[wndMain.height] - add ax,word[wndMain.top] + mov eax,ted_wnd_h + add eax,ted_wnd_t cmp ax,bx jl .no_clear sub ax,bx @@ -253,12 +260,14 @@ clear_line_before_draw: mov cx,bx shl ecx,16 - mov bx,word[wndMain.width] - sub bx,word[recMain.left] - mov cx,word[recMain.height] + xor bx,bx + add ebx,ted_wnd_w + sub ebx,ted_rec_l + xor cx,cx + add ecx,ted_rec_h mov edx,[WND_WORK_COLOR] - cmp esi,0 + cmp dword[clear_o],0 je .pusto cmp ax,cx jge @f @@ -266,12 +275,12 @@ clear_line_before_draw: mov cx,ax @@: - call IsSel + stdcall IsSel,edi cmp al,0 je @f - cmp [seln.y0],edi + cmp [seln.y0],esi jg @f - cmp [seln.y1],edi + cmp [seln.y1],esi jl @f mov edx,[SELECT_COLOR] ;draw selected line @@: @@ -279,20 +288,21 @@ clear_line_before_draw: mov eax,13 ;rect int 0x40 - call IsSel + stdcall IsSel,edi cmp al,0 je .no_clear mov al,13 ;rect - mov cx,word[recMain.height] - cmp [seln.y0],edi + xor cx,cx + add ecx,ted_rec_h + cmp [seln.y0],esi jne @f push bx mov edx,[seln.x0] ; ( ) cmp edx,[hScr.position] jle .in_wnd sub edx,[hScr.position] - imul edx,[recMain.width] + imul edx,ted_rec_w mov bx,dx jmp .no_wnd .in_wnd: @@ -302,13 +312,13 @@ clear_line_before_draw: int 0x40 pop bx @@: - cmp [seln.y1],edi + cmp [seln.y1],esi jne @f mov edx,[seln.x1] ; ( ) cmp edx,[hScr.position] jle .in_wnd2 sub edx,[hScr.position] - imul edx,[recMain.width] + imul edx,ted_rec_w sub bx,dx shl edx,16 add ebx,edx @@ -319,55 +329,44 @@ clear_line_before_draw: @@: .no_clear: - pop edx ecx ebx eax + popad ret +endp -;include 't_debug.inc' -draw_main_win: - push eax ebx ecx edx edi esi -;---debug--- -;mov ecx,0 -;@@: -;call DebugSymb -;inc ecx -;cmp ecx,10 -;jge @f -;jmp @b -;@@: -;ret -;---debug--- + +proc draw_main_win, edit:dword + locals + line_num dd ? + endl + pushad + mov edi,dword[edit] mov eax,4 ;draw text - mov esi,1 mov ecx,[tex_colors] push dword[ecx] pop ecx - mov ebx,[wndMain.left] - add ebx,[recMain.left] - inc ebx + mov ebx,ted_wnd_l + add ebx,ted_rec_l shl ebx,16 - add ebx,[wndMain.top] - add ebx,[recMain.top] - inc ebx + add ebx,ted_wnd_t + add ebx,ted_rec_t + add ebx,0x10001 ; call SelNormalize ;need before draw select - mov edi,[wScr.position] + mov esi,[wScr.position] + mov dword[line_num],esi - call clear_line_before_draw + stdcall clear_line_before_draw, tedit0,ebx,1,esi call GetFirstVisiblePos cmp edx,0 je .no_draw_text + mov esi,1 ; 1- @@: call IteratNext cmp edx,[tex_1] jle .no_draw_text -;--- debug -;cmp dword[edx+6],maxChars -;jge .no_draw_text -;--- debug - ; *** cmp byte[mode_colored],0 je .no_col_change @@ -385,65 +384,43 @@ draw_main_win: int 0x40 pop edx .no_invis: - add bx,word [recMain.height] + add ebx,ted_rec_h ;optimized output \/ - mov ax,word [wndMain.height] - add ax,word [wndMain.top] + mov eax,ted_wnd_h + add eax,ted_wnd_t cmp bx,ax jg .no_draw_text - mov ax,4 - ;optimized output /\ + mov eax,4 + ;optimized output /\ + and ebx,0xffff ror ebx,16 - mov bx,word [wndMain.left] - add bx,word [recMain.left] + add ebx,ted_wnd_l + add ebx,ted_rec_l inc ebx ror ebx,16 - inc edi ;increment line number - call clear_line_before_draw + inc dword[line_num] ;increment line number + stdcall clear_line_before_draw, tedit0,ebx,1,dword[line_num] call OptDrawLineLeft jmp @b .no_13: int 0x40 ror ebx,16 - add bx,word [recMain.width] - mov si,word [wndMain.left] - add si,word [wndMain.width] + add ebx,ted_rec_w + mov esi,ted_wnd_l + add esi,ted_wnd_w cmp bx,si jl .no_opt call OptDrawLineRight .no_opt: - mov si,1 + mov si,1 ror ebx,16 jmp @b .no_draw_text: - xor esi,esi - call clear_line_before_draw - - mov eax,13 - ;top panel with caption - mov ebx,[wndMain.left] -; add ebx,[recMain.left] - shl ebx,16 - add ebx,[wndMain.width] -; sub ebx,[recMain.left] - mov edx,[WND_WORK_COLOR] - mov ecx,[wndMain.top] ;draw caption - shl ecx,16 - add ecx,[recMain.top] - mov edx,[WND_CAPT_COLOR] - int 0x40 - ;left panel with numbers -; mov ebx,[wndMain.left] -; shl ebx,16 -; add ebx,[recMain.left] - ;mov cx,word[wndMain.height] -; mov cx,word[recMain.top] -; int 0x40 - - call draw_line_numbers - call draw_main_cursor + stdcall clear_line_before_draw, tedit0,ebx,0,dword[line_num] + stdcall draw_line_numbers, tedit0 + stdcall draw_main_cursor, tedit0 ;--------------------------------------------- ; set all_redraw flag for draw all ScrollBar @@ -456,10 +433,8 @@ draw_main_win: mov [hScr.all_redraw],eax ; draw for Vertical ScrollBar - push dword wScr - call [scrollbar_ver_draw] - push dword hScr - call [scrollbar_hor_draw] + stdcall [scrollbar_ver_draw], dword wScr + stdcall [scrollbar_hor_draw], dword hScr ; reset all_redraw flag xor eax,eax mov [wScr.all_redraw],eax @@ -468,11 +443,11 @@ draw_main_win: mov eax,13 ;left-bottom square - mov bx,word[wndMain.left] + mov ebx,ted_wnd_l shl ebx,16 - mov bx,word[recMain.left] - mov ecx,[wndMain.top] - add ecx,[wndMain.height] + add ebx,ted_rec_l + mov ecx,ted_wnd_t + add ecx,ted_wnd_h shl ecx,16 mov cx,word[hScr.size_y] inc cx @@ -480,30 +455,34 @@ draw_main_win: int 0x40 ;right-bottom square - mov ebx,[wndMain.left] - add ebx,[wndMain.width] + mov ebx,ted_wnd_l + add ebx,ted_wnd_w shl ebx,16 mov bx,word[wScr.size_x] inc bx int 0x40 - pop esi edi edx ecx ebx eax - call draw_panel_find - call draw_panel_syntax + stdcall draw_panel_find, edi + stdcall draw_panel_syntax, edi + popad ret +endp ;txtBUp db 24 ;txtBDn db 25 ;txtBRi db 26 ;txtBLe db 27 -draw_panel_find: +proc draw_panel_find, edit:dword + push edi + mov edi,dword[edit] + cmp byte[panel_id],TE_PANEL_FIND ;if not panel jne @f push eax ebx ecx edx mov eax,13 ; mov ebx,TE_PANEL_WIDTH - mov cx,word[wndMain.top] + mov ecx,ted_wnd_t shl ecx,16 mov cx,20 mov edx,[sc.work] @@ -511,7 +490,7 @@ draw_panel_find: mov eax,4 ; mov ebx,30*65536+5 - add bx,word[wndMain.top] + add ebx,ted_wnd_t mov ecx,[sc.work_text] or ecx,0x80000000 mov edx,txtFindCapt @@ -522,10 +501,10 @@ draw_panel_find: mov eax,13 ; mov ebx,TE_PANEL_WIDTH - mov cx,word[wndMain.top] + mov ecx,ted_wnd_t add cx,20+15 ; 15 - height text box shl ecx,16 - mov cx,word[wndMain.height] + add ecx,ted_wnd_h add cx,word[hScr.size_y] sub cx,20+15-1 ; 15 - height text box mov edx,[sc.work] @@ -533,7 +512,7 @@ draw_panel_find: mov eax,8 ; mov ebx,5*65536+85 - mov cx,word[wndMain.top] + mov ecx,ted_wnd_t add cx,20+15+5 shl ecx,16 mov cx,20 @@ -543,14 +522,14 @@ draw_panel_find: mov eax,4 ; mov ebx,15*65536+(20+15+10) - add bx,word[wndMain.top] + add ebx,ted_wnd_t mov ecx,[sc.work_text] or ecx,0x80000000 mov edx,txtFindNext int 0x40 pop edx ecx ebx eax - ret + jmp .end_f @@: push eax edx mov eax,8 @@ -558,43 +537,47 @@ draw_panel_find: or edx,0x80000000 int 0x40 pop edx eax + .end_f: + pop edi ret +endp + +proc draw_panel_syntax, edit:dword + push edi + mov edi,dword[edit] -draw_panel_syntax: cmp byte[panel_id],TE_PANEL_SYNTAX ;if not panel jne @f push eax ebx ecx edx mov eax,13 ; mov ebx,TE_PANEL_WIDTH - mov cx,word[wndMain.top] + mov ecx,ted_wnd_t shl ecx,16 mov cx,20 mov edx,[sc.work] - int 0x40 + int 0x40 ; - push dword tree1 - call dword[tl_draw] - - mov [ws_dir_lbox.all_redraw],1 - push dword ws_dir_lbox - call dword[scrollbar_ver_draw] + stdcall dword[tl_draw], dword tree1 + mov [ws_dir_lbox.all_redraw],1 ; + stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox ror ecx,16 add ecx,dword[tree1.box_height] add ecx,20 + and ecx,0xffff ror ecx,16 - mov cx,word[wndMain.height] + add ecx,ted_wnd_h add cx,word[hScr.size_y] sub cx,20 sub ecx,dword[tree1.box_height] inc cx - int 0x40 + int 0x40 ; mov eax,8 ; mov ebx,5*65536+65 - mov cx,word[wndMain.top] - add cx,25 + mov ecx,ted_wnd_t + add ecx,25 add ecx,dword[tree1.box_height] shl ecx,16 mov cx,20 @@ -604,7 +587,7 @@ draw_panel_syntax: mov eax,4 ; mov ebx,30*65536+5 - add bx,word[wndMain.top] + add ebx,ted_wnd_t mov ecx,[sc.work_text] or ecx,0x80000000 mov edx,txtFormatCapt @@ -612,43 +595,44 @@ draw_panel_syntax: mov ebx,10*65536+30 add ebx,dword[tree1.box_height] - add bx,word[wndMain.top] + add ebx,ted_wnd_t mov edx,txtFormatApply int 0x40 pop edx ecx ebx eax - ret + jmp .end_f @@: - push eax edx - mov eax,8 - mov edx,200 - or edx,0x80000000 - int 0x40 - pop edx eax + push eax edx + mov eax,8 + mov edx,200 + or edx,0x80000000 + int 0x40 ; + pop edx eax + .end_f: + pop edi ret +endp -draw_cur_line: - push eax ebx ecx edx esi edi +proc draw_cur_line, edit:dword + pushad + mov edi,dword[edit] - mov edi,[cur_y] - - mov ebx,[wndMain.left] - add ebx,[recMain.left] - inc ebx + mov ebx,ted_wnd_l + add ebx,ted_rec_l shl ebx,16 - add ebx,edi - imul bx,word[recMain.height] - add ebx,[wndMain.top] - add ebx,[recMain.top] - inc ebx + mov eax,[cur_y] + imul eax,ted_rec_h + mov bx,ax + add ebx,ted_wnd_t + add ebx,ted_rec_t ;ebx - + add ebx,0x10001 ; - add edi,[wScr.position] - mov esi,1 call SelNormalize ;need before draw select - call clear_line_before_draw + mov ecx,[cur_y] + add ecx,[wScr.position] + stdcall clear_line_before_draw, tedit0, ebx,1,ecx mov esi,[hScr.position] - mov ecx,edi call GetPosByParam cmp [gpOpt],2 @@ -683,10 +667,9 @@ draw_cur_line: int 0x40 ror ebx,16 - add bx,word[recMain.width] -; cmp bx,word[wndMain.width] - mov ax,word[wndMain.width] - add ax,word[wndMain.left] ;ax = x + add ebx,ted_rec_w + mov eax,ted_wnd_w + add eax,ted_wnd_l ;ax = x cmp bx,ax jge .no_draw_text ;Opt ror ebx,16 @@ -694,49 +677,56 @@ draw_cur_line: jmp @b .no_draw_text: - pop edi esi edx ecx ebx eax - call draw_main_cursor + stdcall draw_main_cursor, tedit0 + popad ret +endp MIN_M_WND_H equ 100 MIN_W_SCRL_ARE equ 3 MIN_H_SCRL_ARE equ 3 -EvSize: +proc EvSize, edit:dword push eax ecx edx edi - m2m [wndMain.width],[procinfo.client_box.width] - mov ax,word[wndMain.left] - sub word[wndMain.width],ax - mov eax,[wScr] ;+0 size_x - sub word[wndMain.width],ax + mov edi,dword[edit] - m2m [wndMain.height],[procinfo.client_box.height] - cmp [wndMain.height],MIN_M_WND_H + m2m ted_wnd_w,[procinfo.client_box.width] ; + mov eax,ted_wnd_l + sub ted_wnd_w,eax ; + mov eax,[wScr] ;+0 size_x + and eax,0xffff + sub ted_wnd_w,eax ; . + + m2m ted_wnd_h,[procinfo.client_box.height] ; + cmp ted_wnd_h,MIN_M_WND_H jg @f - mov [wndMain.height],MIN_M_WND_H + mov ted_wnd_h,MIN_M_WND_H @@: mov ax,word[hScr.size_y] - sub word[wndMain.height],ax - mov eax,[wndMain.height] ;.height = .top+.height - mov word[hScr.start_y],ax - mov eax,[wndMain.top] - sub word[wndMain.height],ax + and eax,0xffff + sub ted_wnd_h,eax ; . + mov eax,ted_wnd_h ;eax = - . + mov word[hScr.start_y],ax ; . + mov eax,ted_wnd_t + sub ted_wnd_h,eax ; - m2m word[wScr.start_x],word[wndMain.width] - mov ax,word[wndMain.left] - add [wScr.start_x],ax - m2m word[wScr.size_y],word[wndMain.height] + mov eax,ted_wnd_w + mov ecx,ted_wnd_l + add eax,ecx + mov word[wScr.start_x],ax ; . + mov eax,ted_wnd_h + mov word[wScr.size_y],ax ; . - m2m word[hScr.start_x],word[recMain.left] - add [hScr.start_x],ax ;ax=[wndMain.left] - mov eax,[wndMain.width] - sub ax,word[recMain.left] - mov word[hScr.size_x],ax + add ecx,ted_rec_l ;ecx=ted_wnd_l+ted_rec_l + mov [hScr.start_x],cx ; . + mov eax,ted_wnd_w + sub eax,ted_rec_l + mov word[hScr.size_x],ax ; . - mov eax,[wndMain.height] ;calculate lines in page - sub eax,[recMain.top] + mov eax,ted_wnd_h ;calculate lines in page + sub eax,ted_rec_t xor edx,edx - mov ecx,[recMain.height] + mov ecx,ted_rec_h div ecx cmp eax,MIN_W_SCRL_ARE jg @f @@ -744,10 +734,10 @@ EvSize: @@: mov [wScr.cur_area],eax - mov eax,[wndMain.width] ;calculate cols in page - sub eax,[recMain.left] + mov eax,ted_wnd_w ;calculate cols in page + sub eax,ted_rec_l xor edx,edx - mov ecx,[recMain.width] + mov ecx,ted_rec_w div ecx cmp eax,MIN_H_SCRL_ARE jg @f @@ -756,16 +746,18 @@ EvSize: dec eax ; ??? mov [hScr.cur_area],eax + mov eax,ted_wnd_t mov edi,dword tree1 - m2m tl_box_top,dword[wndMain.top] + mov tl_box_top,eax ;=ted_wnd_t add tl_box_top,20 - m2m dword[edit2.top],dword[wndMain.top] + mov dword[edit2.top],eax ;=ted_wnd_t add dword[edit2.top],20 pop edi edx ecx eax call OnInitialUpdate ret +endp OnInitialUpdate: mov [wScr.redraw],1 @@ -870,40 +862,41 @@ OptDrawLineRight: call GetSymbColor ret -draw_main_cursor: - push eax ebx ecx edx edi esi +proc draw_main_cursor, edit:dword + pushad + mov edi,dword[edit] mov eax,13 ;draw cursor - mov ecx,[wndMain.top] ;calc rect -> y0,y1 - add ecx,[recMain.top] + mov ecx,ted_wnd_t ;calc rect -> y0,y1 + add ecx,ted_rec_t mov edx,[cur_y] - imul edx,[recMain.height] + imul edx,ted_rec_h add ecx,edx - cmp [curMod],1 + cmp [curMod],1 ; ( ) jne @f - mov edx,[recMain.height] - inc edx ; 1->1, 3->2, 5->3, ... - shr edx,1 + mov edx,ted_rec_h + inc edx ;1->1, 3->2, 5->3, ... + shr edx,1 ;edx = 2 ( ) add ecx,edx @@: shl ecx,16 - add ecx,[recMain.height] + add ecx,ted_rec_h cmp [curMod],1 jne @f - shr cx,1 + shr cx,1 ; 2 @@: - mov ebx,[wndMain.left] ;calc rect -> x0,x1 - add ebx,[recMain.left] + mov ebx,ted_wnd_l ;calc rect -> x0,x1 + add ebx,ted_rec_l mov edx,[cur_x] - imul edx,[recMain.width] + imul edx,ted_rec_w add ebx,edx shl ebx,16 - add ebx,[recMain.width] + add ebx,ted_rec_w mov edx,[CURSOR_COLOR] - int 0x40 + int 0x40 ; call GetPos cmp [gpOpt],2 @@ -915,7 +908,7 @@ draw_main_cursor: add ebx,0x10001 cmp [curMod],1 jne .no_up_tetx - mov cx,word[recMain.height] + mov ecx,ted_rec_h inc cx ; 1->1, 3->2, 5->3, ... shr cx,1 sub bx,cx @@ -925,22 +918,20 @@ draw_main_cursor: int 0x40 @@: - - mov eax,4 - mov ebx,[wndMain.left] - add ebx,[recMain.left] + mov ebx,ted_wnd_l + add ebx,ted_rec_l shl ebx,16 - add ebx,[wndMain.top] + add ebx,ted_wnd_t add ebx,3 mov ecx,[WND_BORD_COLOR] or ecx,0x80000000 mov edx,txtRow - int 0x40 + int 0x40 ; '' add ebx,0x500000 mov edx,txtCol - int 0x40 + int 0x40 ; '' cmp [tim_Undo],0 je @f @@ -950,13 +941,12 @@ draw_main_cursor: sub ebx,0x500000 @@: - call draw_bufer - call draw_help_f1 + stdcall draw_bufer, edi + stdcall draw_help_f1, edi mov eax,47 ;draw cursor coords mov esi,[WND_BORD_COLOR] or esi,0x40000000 - mov edi,[WND_WORK_COLOR] mov edx,ebx ror edx,16 @@ -967,6 +957,8 @@ draw_main_cursor: mov ecx,[cur_y] inc ecx add ecx,[wScr.position] +; edi <> tedit ---------------------------------------------------------------- + mov edi,[WND_WORK_COLOR] int 0x40 ;mov ebx,0x40000 ;Col=... @@ -983,19 +975,21 @@ draw_main_cursor: int 0x40 @@: - pop esi edi edx ecx ebx eax + popad ret +endp +proc draw_bufer, edit:dword + pushad + mov edi,dword[edit] -draw_bufer: - push eax ebx ecx edx esi edi cmp byte[buf],0 je @f - mov ebx,[wndMain.left] - add ebx,[recMain.left] + mov ebx,ted_wnd_l + add ebx,ted_rec_l add bx,250 shl ebx,16 - add ebx,[wndMain.top] + add ebx,ted_wnd_t add ebx,3 mov ecx,[WND_BORD_COLOR] or ecx,0x40000000 @@ -1022,34 +1016,37 @@ end if mov eax,4 int 0x40 @@: - pop edi esi edx ecx ebx eax + popad ret +endp + +proc draw_help_f1, edit:dword + pushad + mov edi,dword[edit] -draw_help_f1: - push eax ebx ecx edx edi mov eax,13 ;clear place before draw help - mov ebx,[wndMain.left] - add ebx,[recMain.left] + mov ebx,ted_wnd_l + add ebx,ted_rec_l shl ebx,16 - add ebx,[wndMain.width] - sub ebx,[recMain.left] - mov ecx,[wndMain.top] + add ebx,ted_wnd_w + sub ebx,ted_rec_l + mov ecx,ted_wnd_t add ecx,13 shl ecx,16 - add ecx,[recMain.height] + add ecx,ted_rec_h mov edx,[WND_CAPT_COLOR] int 0x40 cmp [help_id],-1 - je @f;.no_help + je @f mov eax,[help_id] ColToIndexOffset eax,edx ;SetCoordinates - mov ebx,[wndMain.left] - add ebx,[recMain.left] + mov ebx,ted_wnd_l + add ebx,ted_rec_l shl ebx,16 - add ebx,[wndMain.top] + add ebx,ted_wnd_t add ebx,13 ;=3+10 ;SetTextColor @@ -1062,7 +1059,7 @@ draw_help_f1: pop ecx or ecx,0xc0000000 ;SetTextStyles mov edi,[WND_WORK_COLOR] - +; edi <> edit ----------------------------------------------------------------- mov eax,4 int 0x40 @@ -1076,76 +1073,93 @@ draw_help_f1: mov edx,edi add ebx,0x500000 int 0x40 - @@: - ;.no_help: - pop edi edx ecx ebx eax - ret - -draw_line_numbers: - push eax ebx ecx edx esi ;edi - ;line numbers - mov eax,47 - mov esi,[WND_BORD_COLOR] - ;or esi,0x40000000 - ;mov edi,[WND_WORK_COLOR] - mov ebx,0x40000 ;format - - mov ecx,[wScr.position] - inc ecx - mov dx,3 - add dx,word[wndMain.left] - shl edx,16 - mov dx,word[wndMain.top] - add dx,word[recMain.top] @@: + popad + ret +endp -push eax ebx ecx edx - mov eax,13 - ;left panel with numbers - mov ebx,[wndMain.left] +proc draw_line_numbers, edit:dword + pushad + mov edi,dword[edit] + + ;top panel with caption + mov ebx,ted_wnd_l +; add ebx,ted_rec_l shl ebx,16 - add ebx,[recMain.left] - mov cx,dx -; mov ecx,[wndMain.top] ;draw caption -; add ecx,[recMain.top] + add ebx,ted_wnd_w +; sub ebx,ted_rec_l + mov edx,[WND_WORK_COLOR] + mov ecx,ted_wnd_t shl ecx,16 - mov cx,word [recMain.height] + add ecx,ted_rec_t + mov eax,13 mov edx,[WND_CAPT_COLOR] int 0x40 -pop edx ecx ebx eax - int 0x40 + ;line numbers + mov ebx,0x40000 ;format + mov ecx,[wScr.position] + inc ecx + mov edx,3 + add edx,ted_wnd_l + rol edx,16 + add edx,ted_wnd_t + add edx,ted_rec_t + @@: + +push ebx ecx edx + ;left panel with numbers + mov ebx,ted_wnd_l + shl ebx,16 + add ebx,ted_rec_l + mov ecx,ted_rec_h + rol ecx,16 + mov cx,dx + rol ecx,16 + mov eax,13 + mov edx,[WND_CAPT_COLOR] + int 0x40 ; +pop edx ecx ebx + + mov eax,47 + mov esi,[WND_BORD_COLOR] + int 0x40 ; inc ecx - add dx,word[recMain.height] - sub dx,word[wndMain.top] - cmp dx,word[wndMain.height] + add edx,ted_rec_h + sub edx,ted_wnd_t + mov esi,edx + and esi,0xffff + cmp esi,ted_wnd_h jge @f - add dx,word[wndMain.top] + add edx,ted_wnd_t jmp @b @@: - pop esi edx ecx ebx eax + popad ret +endp + +;this function need to optimize output +proc draw_cursor_sumb, edit:dword + push eax ecx edx edi + mov edi,dword[edit] - -draw_cursor_sumb: ;this function need to optimize output - push eax ecx edx mov eax,13 ;rect - mov ebx,[wndMain.left] - add ebx,[recMain.left] + mov ebx,ted_wnd_l + add ebx,ted_rec_l mov edx,[cur_x] - imul edx,[recMain.width] + imul edx,ted_rec_w add ebx,edx shl ebx,16 - add ebx,[recMain.width] + add ebx,ted_rec_w - mov ecx,[wndMain.top] ;calc rect -> y0,y1 - add ecx,[recMain.top] + mov ecx,ted_wnd_t ;calc rect -> y0,y1 + add ecx,ted_rec_t mov edx,[cur_y] - imul edx,[recMain.height] + imul edx,ted_rec_h add ecx,edx shl ecx,16 - add ecx,[recMain.height] + add ecx,ted_rec_h mov edx,[WND_WORK_COLOR] push ecx @@ -1200,9 +1214,9 @@ draw_cursor_sumb: ;this function need to optimize output pop esi @@: - pop edx ecx eax + pop edi edx ecx eax ret - +endp ;input: diff --git a/programs/other/t_edit/t_edit.asm b/programs/other/t_edit/t_edit.asm index 615ccc28d0..bbe22e2018 100644 --- a/programs/other/t_edit/t_edit.asm +++ b/programs/other/t_edit/t_edit.asm @@ -1,17 +1,17 @@ -; Maxxxx32, Diamond, Heavyiron -; , -; ( www.lrz.land.ru) +;஬ ୮ Maxxxx32, Diamond, Heavyiron +; 㣨 ணࠬ⠬, ⠪ +; ( www.lrz.land.ru) use32 org 0x0 - db 'MENUET01' ;. 8 + db 'MENUET01' ;. ᯮ塞 䠩 ᥣ 8 dd 0x01 dd start - dd i_end ; + dd i_end ; ࠧ ਫ dd mem dd stacktop - dd file_name;buf_cmd_lin + dd file_name ; command line dd sys_path MAX_COLOR_WORD_LEN equ 40 @@ -19,11 +19,10 @@ maxChars equ 100002 ;(...+2) BUF_SIZE equ 1000 ;bufer for copy|paste maxColWords equ 10000 - +include '../../proc32.inc' include '../../macros.inc' include '../../develop/libraries/box_lib/load_lib.mac' -include '../../develop/libraries/box_lib/trunk/tree_list.mac' -include '../../develop/libraries/box_lib/trunk/editbox.mac' +include '../../develop/libraries/box_lib/trunk/box_lib.mac' include 'lang.inc' include 't_data.inc' @@ -128,7 +127,7 @@ load_libraries l_libs_start,load_lib_end push dword tree1 call dword[tl_data_init] ;--------------------------------------------------------------------- -; bmp +; ⠥ bmp 䠩 ࠬ ﬨ copy_path fn_icon_tl_sys,sys_path,file_name,0x0 mov ecx,3*256*13 @@ -151,7 +150,7 @@ load_libraries l_libs_start,load_lib_end mov dword[tree1.data_img_sys],0 @@: ;--------------------------------------------------------------------- -; bmp +; ⠥ bmp 䠩 㧫 copy_path fn_icon_tl_nod,sys_path,file_name,0x0 mov ecx,3*256*2 @@ -174,7 +173,7 @@ load_libraries l_libs_start,load_lib_end mov dword[tree1.data_img],0 @@: ;------------------------------------------------------------------------------ - copy_path fn_syntax_dir,sys_path,file_name,0x0 ; + copy_path fn_syntax_dir,sys_path,file_name,0x0 ;६ 䠩 ᨭ⠪ mov eax,70 mov ebx,tree_file_struct int 0x40 @@ -186,10 +185,10 @@ je .end_dir_init add eax,32+4+1+3+4*6+8 mov ecx,ebx @@: - cmp byte[eax],'.' ; '.' '..' + cmp byte[eax],'.' ;䨫㥬 䠩 '.' '..' je .filter push dword tree1 - push dword 0x10000 ;1*2^16 - 1 + push dword 0x10000 ;1*2^16 - 1 push dword eax call dword[tl_node_add] @@ -228,36 +227,33 @@ red_win: mov edx,[sc.work] or edx,0x73000000 mov edi,hed - mcall + int 0x40 + + mov edi,tedit0 mcall 9,procinfo,-1 - call EvSize + stdcall EvSize,edi - mov eax,13 ;rect + mov eax,13 ; , xor ebx,ebx - xor ecx,ecx + mov ecx,ted_wnd_t mov bx,word [procinfo.client_box.width] inc bx - mov cx,word [wndMain.top] - mcall + int 0x40 - push dword edit1 - call [edit_box_draw] - -; draw for Menu 1 - push dword menu_data_1 - call [menu_bar_draw] + stdcall [edit_box_draw], dword edit1 + stdcall [menu_bar_draw], dword menu_data_1 call draw_but_toolbar cmp [err_ini0],1 jne @f mov eax,4 - mov ebx,[wndMain.left] - add ebx,[recMain.left] + mov ebx,ted_wnd_l + add ebx,ted_rec_l shl ebx,16 - add ebx,[wndMain.top] - add ebx,[recMain.top] + add ebx,ted_wnd_t + add ebx,ted_rec_t mov ecx,0x80ff0000 mov edx,txtErrIni0 int 0x40 @@ -270,16 +266,7 @@ red_win: cmp [err_ini0],1 je @f - call draw_main_win - @@: - - cmp [err_opn],1 - jne @f - ;mov eax,4 - mov ebx,10*65536+35 - mov ecx,0x80ff0000 - mov edx,txtErrOpen - mcall + stdcall draw_main_win, tedit0 @@: mcall 12,2 @@ -288,7 +275,7 @@ still: mov eax,10 mcall - cmp al,1 ;. + cmp al,1 ;. jz red_win cmp al,2 jz key @@ -302,8 +289,7 @@ still: mouse: - push dword edit1 - call [edit_box_mouse] + stdcall [edit_box_mouse], dword edit1 test word [edit1.flags],10b;ed_focus ; ᫨ 䮪, 室 jne still @@ -316,16 +302,14 @@ mouse: cmp eax,[wScr.cur_area] jbe .horizontal ; mouse event for Vertical ScrollBar - push dword wScr - call [scrollbar_ver_mouse] + stdcall [scrollbar_ver_mouse], dword wScr mov eax,wScr.redraw xor ebx,ebx cmp [eax],ebx je @f mov [eax],ebx - call draw_main_win - ;call mouse_wnd_main + stdcall draw_main_win, tedit0 jmp still @@: cmp [wScr.delta2],0 @@ -342,7 +326,7 @@ mouse: cmp [eax],ebx je .other mov [eax],ebx - call draw_main_win + stdcall draw_main_win, tedit0 jmp still .other: cmp [wScr.delta2],0 @@ -350,7 +334,7 @@ mouse: cmp [hScr.delta2],0 jne still - call mouse_wnd_main + stdcall mouse_wnd_main, tedit0 cmp byte[panel_id],TE_PANEL_FIND ;if not panel jne @f @@ -468,8 +452,7 @@ key: ; jne still call KeyConvertToASCII - push dword edit2 - call [edit_box_key] + stdcall [edit_box_key], dword edit2 jmp still @@: @@ -495,7 +478,7 @@ key: jne @f cmp byte[panel_id],TE_PANEL_FIND je @f - call but_find + stdcall but_find, tedit0 @@: cmp ah,44 ;Ctrl+Z je but_undo @@ -534,105 +517,105 @@ key: jne @f call sel_KeyDown @@: - ;mov [dragk],1 ; + ;mov [dragk],1 ;稭 뤥 jmp .key_MoveCur .key_Shift: ;------------------------------------------------- cmp ah,72 ;178 ;Up jne @f push dx - call draw_cursor_sumb + stdcall draw_cursor_sumb, tedit0 call CurMoveUp cmp dl,8 jne .no_red_0 call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 pop dx jmp @f .no_red_0: - call draw_main_cursor + stdcall draw_main_cursor, tedit0 pop dx - mov [dragk],0 ; + mov [dragk],0 ;稢 뤥 @@: cmp ah,80 ;177 ;Down jne @f push dx - call draw_cursor_sumb + stdcall draw_cursor_sumb, tedit0 call CurMoveDown cmp dl,8 jne .no_red_1 call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 pop dx jmp @f .no_red_1: - call draw_main_cursor + stdcall draw_main_cursor, tedit0 pop dx - mov [dragk],0 ; + mov [dragk],0 ;稢 뤥 @@: cmp ah,75 ;176 ;Left jne @f push dx - call draw_cursor_sumb + stdcall draw_cursor_sumb, tedit0 call CurMoveLeft cmp dl,8 jne .no_red_2 call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 pop dx jmp @f .no_red_2: - call draw_main_cursor + stdcall draw_main_cursor, tedit0 pop dx - mov [dragk],0 ; + mov [dragk],0 ;稢 뤥 @@: cmp ah,77 ;179 ;Right jne @f push dx - call draw_cursor_sumb + stdcall draw_cursor_sumb, tedit0 call CurMoveRight cmp dl,8 jne .no_red_3 call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 pop dx jmp @f .no_red_3: - call draw_main_cursor + stdcall draw_main_cursor, tedit0 pop dx - mov [dragk],0 ; + mov [dragk],0 ;稢 뤥 @@: cmp ah,71 ;180 ;Home jne @f push dx - call draw_cursor_sumb + stdcall draw_cursor_sumb, tedit0 call CurMoveX_FirstChar cmp dl,8 jne .no_red_4 call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 pop dx jmp @f .no_red_4: - call draw_main_cursor + stdcall draw_main_cursor, tedit0 pop dx - mov [dragk],0 ; + mov [dragk],0 ;稢 뤥 @@: cmp ah,79 ;181 ;End jne @f push dx - call draw_cursor_sumb + stdcall draw_cursor_sumb, tedit0 call CurMoveX_LastChar cmp dl,8 jne .no_red_5 call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 pop dx jmp @f .no_red_5: - call draw_main_cursor + stdcall draw_main_cursor, tedit0 pop dx - mov [dragk],0 ; + mov [dragk],0 ;稢 뤥 @@: cmp ah,73 ;184 ;PageUp jne @f @@ -642,7 +625,7 @@ key: pop dx je @f call OnInitialUpdate - call draw_main_win + stdcall draw_main_win, tedit0 @@: cmp ah,81 ;183 ;PageDown jne @f @@ -652,8 +635,8 @@ key: pop dx je @f call OnInitialUpdate - call draw_main_win - mov [dragk],0 ; + stdcall draw_main_win, tedit0 + mov [dragk],0 ;稢 뤥 @@: ;------------------------------------------------- cmp [keyUpr],0 @@ -668,7 +651,7 @@ key: ja still call KeyConvertToASCII - ;mov [dragk],0 ; + ;mov [dragk],0 ;稢 뤥 push ebx xor ebx,ebx @@ -692,10 +675,10 @@ key: call draw_but_toolbar cmp byte [key_new],13 jne .dr_m_win - call draw_main_win + stdcall draw_main_win, tedit0 jmp .dr_cur_l .dr_m_win: - call draw_cur_line + stdcall draw_cur_line, tedit0 .dr_cur_l: pop edi esi @@: @@ -713,7 +696,7 @@ key: call TextDel .del_one_b: call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 pop bx ax @@: @@ -729,27 +712,27 @@ key: call TextDel .del_one_d: call draw_but_toolbar - call draw_main_win + stdcall draw_main_win, tedit0 pop bx ax @@: cmp ah,185 ;Ins jne @f - call draw_cursor_sumb + stdcall draw_cursor_sumb, tedit0 xor [curMod],1 - call draw_main_cursor + stdcall draw_main_cursor, tedit0 @@: jmp still button: -; cmp [menu_active],1 ; , +; cmp [menu_active],1 ;᫨ , ᭠砫 ॠ ; jne @f ;mouse.menu_bar_1 ; mov [menu_active],0 ; jmp still ; @@: - mcall 17 ; + mcall 17 ; ⮩ cmp ah,3 jne @f call but_NewFile @@ -773,7 +756,9 @@ button: cmp ah,9 jz but_paste cmp ah,10 - jz but_find + jne @f + stdcall but_find, tedit0 + @@: cmp ah,11 jz but_replace cmp ah,12 @@ -793,7 +778,9 @@ button: cmp ah,19 jz but_k_words_show cmp ah,20 - jz but_synt_show + jne @f + stdcall but_synt_show, tedit0 + @@: cmp ah,200 jne @f @@ -824,11 +811,10 @@ button: call mem_Free push dword tree1 call dword[tl_data_clear] - mcall -1 ; + mcall -1 ;室 ணࠬ -txtErrOpen db ' 䠩, ஢ ࠢ쭮 ',0 txtErrIni0 db ' 䠩 ',0 err_ini0 db 0 diff --git a/programs/other/t_edit/t_work.inc b/programs/other/t_edit/t_work.inc index ca4c01fd68..d45e23c517 100644 --- a/programs/other/t_edit/t_work.inc +++ b/programs/other/t_edit/t_work.inc @@ -8,13 +8,6 @@ struct f70 name dd ? ends -struct TexSelect - x0 dd ? - y0 dd ? - x1 dd ? - y1 dd ? -ends - struct TexColViv Text rb MAX_COLOR_WORD_LEN; // f1 dd 0 @@ -52,7 +45,7 @@ Col dd 0 ; conv_tabl rb 128 ; scan- ascii- keyUpr dd 0 -err_opn db 0 ; + err_sav db 0 ; panel_id db 0 ; @@ -68,23 +61,16 @@ tex dd 0 ;text memory pointer tex_1 dd 0 ;text first symbol pointer tex_end dd 0 ;text end memory pointer -hed db 'TextEditor 05.02.10',0 ; -sc system_colors - -wndMain BOX 0,50,440,150 -recMain BOX 30,23,7,10 - curMod db 1 cur_x dd 0 cur_y dd 0 invis db 0 ; symbol_new_line db 20 ; -dragm db 0 ; -dragk db 0 ; -sel TexSelect 0,0,0,0 ; -seln TexSelect ; help_id dd -1 ; +hed db 'TextEditor 15.04.10',0 ; +sc system_colors + fn_icon db 'te_icon.bmp',0 bmp_icon dd 0 run_file_70 f70 @@ -117,10 +103,11 @@ CanSave: ;output: ; al = 1 - selected -IsSel: - push ebx +proc IsSel, edit:dword + push ebx edi + mov edi,dword[edit] xor al,al - cmp [dragm],1 + cmp ted_drag_m,1 je @f mov al,1 mov ebx,[sel.x0] @@ -131,8 +118,9 @@ IsSel: jne @f xor al,al @@: - pop ebx + pop edi ebx ret +endp SelNormalize: push ecx esi edi @@ -343,7 +331,6 @@ InitColText: ;input: ; ebx = file size OpenFile: - mov [err_opn],0 push eax ;destination push ecx ;for cycle push edx ;source @@ -729,7 +716,7 @@ CharAdd: ConvertSelText: xor edi,edi push eax ebx ecx edx esi - call IsSel + stdcall IsSel, tedit0 cmp al,0 je .end_f call SetUndo @@ -1329,7 +1316,7 @@ GoToPos: ;output: ; al = 1 if delete SelTextDel: - call IsSel + stdcall IsSel, tedit0 cmp al,0 jne @f ret @@ -1664,8 +1651,8 @@ ShowHelpF1: call FindHelpId @@: pop edx eax - ;call draw_main_cursor - call draw_help_f1 + ;stdcall draw_main_cursor, tedit0 + stdcall draw_help_f1, tedit0 ret ;input: