fixed position of signatures when pressing [f1]

update 'asm' syntax file

git-svn-id: svn://kolibrios.org@6087 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2016-01-21 22:22:11 +00:00
parent 8a4f974d14
commit 44e780f476
4 changed files with 1110 additions and 1263 deletions

View File

@ -1,6 +1,6 @@
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj ; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS ; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 20.01.2016 IgorA ; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 21.01.2016 IgorA
; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï ; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï
;input: ;input:
@ -106,8 +106,7 @@ KEY_F3 equ 0x0000003D
align 4 align 4
proc ted_init, edit:dword proc ted_init uses eax ecx edi, edit:dword
push eax ecx edi
mov edi,dword[edit] mov edi,dword[edit]
mov ecx,sizeof.symbol mov ecx,sizeof.symbol
@ -130,7 +129,6 @@ proc ted_init, edit:dword
mov ted_syntax_file,eax mov ted_syntax_file,eax
stdcall ted_init_scroll_bars,edi,3 stdcall ted_init_scroll_bars,edi,3
pop edi ecx eax
ret ret
endp endp
@ -210,12 +208,10 @@ proc ted_init_scroll_bars, edit:dword, opt:dword
endp endp
align 4 align 4
proc ted_delete, edit:dword proc ted_delete uses edi, edit:dword
push edi
mov edi,dword[edit] mov edi,dword[edit]
invoke mem.free,ted_tex invoke mem.free,ted_tex
invoke mem.free,ted_arr_key_pos ;ted_syntax_file invoke mem.free,ted_arr_key_pos ;ted_syntax_file
pop edi
ret ret
endp endp
@ -529,8 +525,7 @@ endp
;output: ;output:
; al = 1 - can save ; al = 1 - can save
align 4 align 4
proc ted_can_save, edit:dword proc ted_can_save uses ecx edi, edit:dword
push ecx edi
mov edi,dword[edit] mov edi,dword[edit]
mov ecx,ted_tim_ch mov ecx,ted_tim_ch
@ -540,7 +535,6 @@ proc ted_can_save, edit:dword
jne @f jne @f
dec al dec al
@@: @@:
pop edi ecx
ret ret
endp endp
@ -549,8 +543,7 @@ endp
;output: ;output:
; al = 1 - selected ; al = 1 - selected
align 4 align 4
proc ted_is_select proc ted_is_select uses ebx
push ebx
xor al,al xor al,al
cmp ted_drag_m,1 cmp ted_drag_m,1
je @f je @f
@ -563,15 +556,13 @@ proc ted_is_select
jne @f jne @f
xor al,al xor al,al
@@: @@:
pop ebx
ret ret
endp endp
;input: ;input:
; edi = pointer to tedit struct ; edi = pointer to tedit struct
align 4 align 4
proc ted_sel_normalize proc ted_sel_normalize uses ecx esi
push ecx esi
push edi push edi
mov esi,edi mov esi,edi
add esi,ted_offs_sel add esi,ted_offs_sel
@ -606,7 +597,6 @@ proc ted_sel_normalize
jg .swp_f jg .swp_f
.end_f: .end_f:
pop esi ecx
ret ret
endp endp
@ -615,20 +605,18 @@ endp
;description: ;description:
; ”ã­ªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ­ ç «¥ ¢ë¤¥«¥­¨ï ; ”ã­ªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ­ ç «¥ ¢ë¤¥«¥­¨ï
align 4 align 4
proc ted_sel_start proc ted_sel_start uses eax ecx
push eax ecx mov eax,ted_scr_h
mov eax,ted_scr_h mov ecx,ted_cur_x
mov ecx,ted_cur_x add ecx,dword[eax+sb_offs_position]
add ecx,dword[eax+sb_offs_position] mov ted_sel_x0,ecx
mov ted_sel_x0,ecx mov ted_sel_x1,ecx
mov ted_sel_x1,ecx
mov eax,ted_scr_w mov eax,ted_scr_w
mov ecx,ted_cur_y mov ecx,ted_cur_y
add ecx,dword[eax+sb_offs_position] add ecx,dword[eax+sb_offs_position]
mov ted_sel_y0,ecx mov ted_sel_y0,ecx
mov ted_sel_y1,ecx mov ted_sel_y1,ecx
pop ecx eax
ret ret
endp endp
@ -682,8 +670,7 @@ endp
;input: ;input:
; cl_al_mem = 1 - clear all memory ; cl_al_mem = 1 - clear all memory
align 4 align 4
proc ted_clear, edit:dword, cl_al_mem:dword proc ted_clear uses ecx edi, edit:dword, cl_al_mem:dword
push ecx edi
mov edi,dword[edit] mov edi,dword[edit]
mov ted_cur_x,0 mov ted_cur_x,0
@ -727,7 +714,6 @@ proc ted_clear, edit:dword, cl_al_mem:dword
pop edx pop edx
.exit: .exit:
pop edi ecx
ret ret
endp endp
@ -1055,30 +1041,30 @@ ted_iterat_next_color_tag:
; (tex[i].td+ted_tim_undo<=ted_tim_ch && tex[i].td) || (tex[i].tc>ted_tim_ch-ted_tim_undo) ; (tex[i].td+ted_tim_undo<=ted_tim_ch && tex[i].td) || (tex[i].tc>ted_tim_ch-ted_tim_undo)
align 4 align 4
ted_symbol_not_vis: ted_symbol_not_vis:
push eax push eax
xor bl,bl xor bl,bl
cmp dword [edx+14],0 cmp dword [edx+14],0
je @f je @f
mov eax,[edx+14] ;eax=tex[i].td mov eax,[edx+14] ;eax=tex[i].td
add eax,ted_tim_undo add eax,ted_tim_undo
cmp eax,ted_tim_ch cmp eax,ted_tim_ch
jg @f jg @f
mov bl,1 mov bl,1
pop eax pop eax
ret ret
@@: @@:
mov eax,ted_tim_ch mov eax,ted_tim_ch
sub eax,ted_tim_undo sub eax,ted_tim_undo
cmp [edx+10],eax cmp [edx+10],eax
jle @f jle @f
or bl,1 or bl,1
@@: @@:
pop eax pop eax
ret ret
;input: ;input:
; text:dword - pointer to text string ; text:dword - pointer to text string
@ -1445,9 +1431,7 @@ endp
;description: ;description:
; ”ã­ªæ¨ï 㤠«ï¥â ¢ë¤¥«¥­­ë© ⥪áâ ; ”ã­ªæ¨ï 㤠«ï¥â ¢ë¤¥«¥­­ë© ⥪áâ
align 4 align 4
proc ted_sel_text_del, del_opt:dword proc ted_sel_text_del uses ebx ecx edx esi, del_opt:dword
push ebx ecx edx esi
call ted_is_select call ted_is_select
cmp al,0 cmp al,0
je .end_f je .end_f
@ -1494,7 +1478,6 @@ proc ted_sel_text_del, del_opt:dword
mov ted_sel_y1,0 mov ted_sel_y1,0
@@: @@:
.end_f: .end_f:
pop esi edx ecx ebx
ret ret
endp endp
@ -1505,56 +1488,56 @@ endp
; edi = pointer to tedit struct ; edi = pointer to tedit struct
align 4 align 4
ted_revers: ted_revers:
cmp eax,ebx cmp eax,ebx
jne @f jne @f
ret ret
@@: @@:
push ecx edx push ecx edx
mov edx,ted_tex_1 mov edx,ted_tex_1
cmp edx,ebx ;if(p1==1)p1=tex[1].perv; cmp edx,ebx ;if(p1==1)p1=tex[1].perv;
jne @f jne @f
call ted_get_text_perv_pos call ted_get_text_perv_pos
mov ebx,edx mov ebx,edx
@@: @@:
push esi push esi
mov edx,[eax+2] ; *** edx = tex[p0].perv *** mov edx,[eax+2] ; *** edx = tex[p0].perv ***
ConvertIndexToPointer edx ConvertIndexToPointer edx
add edx,6 add edx,6
mov ecx,[edx] ;tmp = tex[tex[p0].perv].next; mov ecx,[edx] ;tmp = tex[tex[p0].perv].next;
mov esi,[ebx+6] ; *** esi = tex[p1].next *** mov esi,[ebx+6] ; *** esi = tex[p1].next ***
ConvertIndexToPointer esi ConvertIndexToPointer esi
add esi,2 add esi,2
m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv; m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv;
mov [esi],ecx ;tex[tex[p1].next].perv = tmp; mov [esi],ecx ;tex[tex[p1].next].perv = tmp;
pop esi pop esi
mov ecx,[eax+2] ;tmp = tex[p0].perv; mov ecx,[eax+2] ;tmp = tex[p0].perv;
m2m dword[eax+2],dword[ebx+6] ;tex[p0].perv = tex[p1].next; m2m dword[eax+2],dword[ebx+6] ;tex[p0].perv = tex[p1].next;
mov [ebx+6],ecx ;tex[p1].next = tmp; mov [ebx+6],ecx ;tex[p1].next = tmp;
mov edx,eax ;i=p0; mov edx,eax ;i=p0;
@@: @@:
mov ecx,[edx+6] ;tmp = tex[i].next; mov ecx,[edx+6] ;tmp = tex[i].next;
m2m dword[edx+6],dword[edx+2] ;tex[i].next = tex[i].perv; m2m dword[edx+6],dword[edx+2] ;tex[i].next = tex[i].perv;
mov [edx+2],ecx ;tex[i].perv = tmp; mov [edx+2],ecx ;tex[i].perv = tmp;
cmp edx,ebx ;if(i==p1)break; cmp edx,ebx ;if(i==p1)break;
je @f je @f
; --- ; ---
;cmp edx,ted_tex ;cmp edx,ted_tex
;je @f ;je @f
; --- ; ---
mov edx,ecx ;i = tmp; mov edx,ecx ;i = tmp;
ConvertIndexToPointer edx ConvertIndexToPointer edx
jmp @b jmp @b
@@: @@:
pop edx ecx pop edx ecx
call ted_text_colored call ted_text_colored
ret ret
;input: ;input:
@ -1975,22 +1958,22 @@ ted_get_text_coords:
; eax = num lines ; eax = num lines
align 4 align 4
ted_get_num_lines: ted_get_num_lines:
push edx push edx
mov eax,1 mov eax,1
mov edx,ted_tex mov edx,ted_tex
@@: @@:
call ted_iterat_next call ted_iterat_next
cmp edx,ted_tex_1 cmp edx,ted_tex_1
jle @f jle @f
cmp byte [edx],13 cmp byte [edx],13
jne @b jne @b
inc eax inc eax
jmp @b jmp @b
@@: @@:
;... ;...
;dec eax ;dec eax
pop edx pop edx
ret ret
;input: ;input:
@ -2455,8 +2438,7 @@ endp
; eax = ª®¤ ®è¨¡ª¨ ; eax = ª®¤ ®è¨¡ª¨
; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ­­ëå ¡ ©â ; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ­­ëå ¡ ©â
align 4 align 4
proc ted_open_file, edit:dword, file:dword, f_name:dword ;äã­ªæ¨ï ®âªàëâ¨ï ä ©«  proc ted_open_file uses ecx edx edi, edit:dword, file:dword, f_name:dword ;äã­ªæ¨ï ®âªàëâ¨ï ä ©« 
push ecx edx edi
mov edi,dword[edit] mov edi,dword[edit]
; *** ¯à®¢¥à塞 à §¬¥à ¯ ¬ï⨠¨ ¥á«¨ ­¥ 墠⠥â ⮠㢥«¨ç¨¢ ¥¬ *** ; *** ¯à®¢¥à塞 à §¬¥à ¯ ¬ï⨠¨ ¥á«¨ ­¥ 墠⠥â ⮠㢥«¨ç¨¢ ¥¬ ***
@ -2527,7 +2509,6 @@ proc ted_open_file, edit:dword, file:dword, f_name:dword ;
;if open file ;if open file
call ted_on_open_file call ted_on_open_file
.ret_f: .ret_f:
pop edi edx ecx
ret ret
endp endp
@ -2564,8 +2545,7 @@ proc ted_but_select_word, edit:dword
endp endp
align 4 align 4
proc ted_but_cut, edit:dword proc ted_but_cut uses edi, edit:dword
push edi
mov edi,dword[edit] mov edi,dword[edit]
stdcall ted_but_copy,edi stdcall ted_but_copy,edi
@ -2579,7 +2559,6 @@ proc ted_but_cut, edit:dword
je @f je @f
call ted_fun_draw_panel_buttons call ted_fun_draw_panel_buttons
@@: @@:
pop edi
ret ret
endp endp
@ -2754,41 +2733,38 @@ proc ted_but_sumb_lover uses edi esi, edit:dword
endp endp
align 4 align 4
proc ted_but_reverse, edit:dword proc ted_but_reverse uses eax ebx edi, edit:dword
push eax ebx edi mov edi,dword[edit]
mov edi,dword[edit]
call ted_is_select call ted_is_select
cmp al,0 cmp al,0
je @f je @f
call ted_sel_normalize call ted_sel_normalize
push esi ecx edx push esi ecx edx
mov esi,ted_seln_x0 mov esi,ted_seln_x0
mov ecx,ted_seln_y0 mov ecx,ted_seln_y0
call ted_get_pos_by_coords call ted_get_pos_by_coords
mov eax,edx mov eax,edx
mov esi,ted_seln_x1 mov esi,ted_seln_x1
cmp esi,0 cmp esi,0
je .beg_str je .beg_str
dec esi dec esi
.beg_str: .beg_str:
mov ecx,ted_seln_y1 mov ecx,ted_seln_y1
call ted_get_pos_by_coords call ted_get_pos_by_coords
;call ted_get_text_perv_pos ;call ted_get_text_perv_pos
mov ebx,edx mov ebx,edx
pop edx ecx esi pop edx ecx esi
;cmp eax,... ;cmp eax,...
;je @f ;je @f
call ted_revers call ted_revers
@@: @@:
stdcall ted_draw,edi stdcall ted_draw,edi
pop edi ebx eax ret
ret
endp endp
align 4 align 4
proc ted_but_undo, edit:dword proc ted_but_undo uses eax edi, edit:dword
push eax edi
mov edi,dword[edit] mov edi,dword[edit]
mov eax,ted_tim_undo mov eax,ted_tim_undo
@ -2801,13 +2777,11 @@ proc ted_but_undo, edit:dword
je @f je @f
call ted_fun_draw_panel_buttons call ted_fun_draw_panel_buttons
@@: @@:
pop edi eax
ret ret
endp endp
align 4 align 4
proc ted_but_redo, edit:dword proc ted_but_redo uses edi, edit:dword
push edi
mov edi,dword[edit] mov edi,dword[edit]
cmp ted_tim_undo,1 cmp ted_tim_undo,1
@ -2819,7 +2793,6 @@ proc ted_but_redo, edit:dword
je @f je @f
call ted_fun_draw_panel_buttons call ted_fun_draw_panel_buttons
@@: @@:
pop edi
ret ret
endp endp
@ -3264,18 +3237,16 @@ proc ted_draw, edit:dword
mov dword[esi+sb_offs_all_redraw],0 mov dword[esi+sb_offs_all_redraw],0
;--------------------------------------------- ;---------------------------------------------
;left-bottom square ;left-bottom square
mov ebx,ted_wnd_l mov ebx,ted_wnd_l
shl ebx,16 shl ebx,16
add ebx,ted_rec_l add ebx,ted_rec_l
mov ecx,ted_wnd_t mov ecx,ted_wnd_t
add ecx,ted_wnd_h add ecx,ted_wnd_h
shl ecx,16 shl ecx,16
mov cx,word[eax+sb_offs_size_y] mov cx,word[eax+sb_offs_size_y]
inc cx inc cx
mov edx,ted_color_wnd_capt ;[sc.work] mcall 13,,,ted_color_wnd_capt ;[sc.work]
mov eax,13
int 0x40
;right-bottom square ;right-bottom square
mov ebx,ted_wnd_l mov ebx,ted_wnd_l
@ -3479,7 +3450,7 @@ proc ted_draw_help_f1
pushad pushad
cmp ted_rec_t,13 ;¬¨­¨¬ «ì­ ï ¢ëá®â  ¤«ï à¨á®¢ ­¨ï á¯à ¢ª¨ cmp ted_rec_t,13 ;¬¨­¨¬ «ì­ ï ¢ëá®â  ¤«ï à¨á®¢ ­¨ï á¯à ¢ª¨
jle @f jle @f
mov eax,13 ;clear place before draw help ;clear place before draw help
mov ebx,ted_wnd_l mov ebx,ted_wnd_l
add ebx,ted_rec_l add ebx,ted_rec_l
shl ebx,16 shl ebx,16
@ -3489,8 +3460,7 @@ proc ted_draw_help_f1
add ecx,13 add ecx,13
shl ecx,16 shl ecx,16
add ecx,ted_rec_h add ecx,ted_rec_h
mov edx,ted_color_wnd_capt mcall 13,,,ted_color_wnd_capt
int 0x40
cmp ted_help_id,-1 cmp ted_help_id,-1
je @f je @f
@ -3513,11 +3483,12 @@ proc ted_draw_help_f1
mov ecx,dword[ecx] mov ecx,dword[ecx]
or ecx,0xc0000000 ;SetTextStyles or ecx,0xc0000000 ;SetTextStyles
mov esi,edi mov esi,edi
mov edi,ted_color_wnd_work mcall 4,,,,,ted_color_wnd_work
mov eax,4
int 0x40
mov edi,esi mov edi,esi
mov esi,edx
call tl_strlen
;*** draw help string *** ;*** draw help string ***
mov ecx,ted_color_wnd_bord mov ecx,ted_color_wnd_bord
or ecx,0x80000000 or ecx,0x80000000
@ -3525,8 +3496,11 @@ proc ted_draw_help_f1
cmp edx,0 cmp edx,0
je @f je @f
add edx,ted_help_text_f1 add edx,ted_help_text_f1
add ebx,0x500000 inc eax
int 0x40 imul eax,6 ;è¨à¨­  ᨬ¢®«  ¢ á¨áâ. èà¨äâ¥
shl eax,16
add ebx,eax
mcall 4
@@: @@:
popad popad
ret ret
@ -4062,42 +4036,42 @@ ted_wnd_main_click:
mov ebx,ted_el_focus mov ebx,ted_el_focus
mov dword[ebx],edi ;áâ ¢¨¬ 䮪ãá mov dword[ebx],edi ;áâ ¢¨¬ 䮪ãá
push eax push eax
shr eax,16 shr eax,16
and eax,0xffff and eax,0xffff
sub eax,ted_wnd_l sub eax,ted_wnd_l
sub eax,ted_rec_l sub eax,ted_rec_l
xor edx,edx xor edx,edx
mov ecx,ted_rec_w mov ecx,ted_rec_w
div cx div cx
;inc eax ;inc eax
mov ebx,ted_scr_h mov ebx,ted_scr_h
cmp eax,dword[ebx+sb_offs_cur_area] cmp eax,dword[ebx+sb_offs_cur_area]
jle @f jle @f
mov eax,dword[ebx+sb_offs_cur_area] mov eax,dword[ebx+sb_offs_cur_area]
@@: @@:
;dec eax ;dec eax
mov ted_cur_x,eax mov ted_cur_x,eax
pop eax pop eax
push eax push eax
and eax,0xffff and eax,0xffff
sub eax,ted_wnd_t sub eax,ted_wnd_t
sub eax,ted_rec_t sub eax,ted_rec_t
xor edx,edx xor edx,edx
mov ecx,ted_rec_h mov ecx,ted_rec_h
div cx div cx
inc eax inc eax
mov ebx,ted_scr_w mov ebx,ted_scr_w
cmp eax,dword[ebx+sb_offs_cur_area] cmp eax,dword[ebx+sb_offs_cur_area]
jle @f jle @f
mov eax,dword[ebx+sb_offs_cur_area] mov eax,dword[ebx+sb_offs_cur_area]
@@: @@:
dec eax dec eax
mov ted_cur_y,eax mov ted_cur_y,eax
pop eax pop eax
cmp ted_drag_m,0 cmp ted_drag_m,0
je @f je @f

File diff suppressed because it is too large Load Diff

View File

@ -1,95 +1,95 @@
align 4 align 4
draw_but_toolbar: ;ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ draw_but_toolbar: ;ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
pushad pushad
mov edi,tedit0 mov edi,tedit0
mov ecx,0x40000000 mov ecx,0x40000000
mov edx,5*65536+25 mov edx,5*65536+25
call draw_but_icon call draw_but_icon
inc cx inc cx
mov edx,30*65536+25 mov edx,30*65536+25
call draw_but_icon call draw_but_icon
stdcall [ted_can_save],edi stdcall [ted_can_save],edi
cmp al,1 cmp al,1
je @f je @f
and ecx,0xffff and ecx,0xffff
@@: @@:
inc cx inc cx
mov edx,55*65536+25 mov edx,55*65536+25
call draw_but_icon call draw_but_icon
or ecx,0x40000000 or ecx,0x40000000
inc cx inc cx
mov edx,85*65536+25 mov edx,85*65536+25
call draw_but_icon call draw_but_icon
call [ted_is_select] call [ted_is_select]
cmp al,0 cmp al,0
jne @f jne @f
and ecx,0xffff and ecx,0xffff
@@: @@:
inc cx ; Cut inc cx ; Cut
mov edx,110*65536+25 mov edx,110*65536+25
call draw_but_icon call draw_but_icon
inc cx ; Copy inc cx ; Copy
mov edx,135*65536+25 mov edx,135*65536+25
call draw_but_icon call draw_but_icon
mov cx,10 ; Upper mov cx,10 ; Upper
mov edx,265*65536+25 mov edx,265*65536+25
call draw_but_icon call draw_but_icon
inc cx ; Lower inc cx ; Lower
mov edx,290*65536+25 mov edx,290*65536+25
call draw_but_icon call draw_but_icon
inc cx ; reverse inc cx ; reverse
mov edx,315*65536+25 mov edx,315*65536+25
call draw_but_icon call draw_but_icon
or ecx,0x40000000 or ecx,0x40000000
cmp dword[buf],0 cmp dword[buf],0
jne @f jne @f
and ecx,0xffff and ecx,0xffff
@@: @@:
mov cx,6 ; Paste mov cx,6 ; Paste
mov edx,160*65536+25 mov edx,160*65536+25
call draw_but_icon call draw_but_icon
or ecx,0x40000000 or ecx,0x40000000
inc cx inc cx
mov edx,185*65536+25 mov edx,185*65536+25
call draw_but_icon call draw_but_icon
inc cx inc cx
mov edx,210*65536+25 mov edx,210*65536+25
call draw_but_icon call draw_but_icon
inc cx inc cx
mov edx,235*65536+25 mov edx,235*65536+25
call draw_but_icon call draw_but_icon
mov ebx,ted_tim_undo mov ebx,ted_tim_undo
cmp ted_tim_ch,ebx cmp ted_tim_ch,ebx
jg @f jg @f
and ecx,0xffff and ecx,0xffff
@@: @@:
mov cx,13 mov cx,13
mov edx,345*65536+25 mov edx,345*65536+25
call draw_but_icon call draw_but_icon
or ecx,0x40000000 or ecx,0x40000000
cmp ted_tim_undo,1 cmp ted_tim_undo,1
jge @f jge @f
and ecx,0xffff and ecx,0xffff
@@: @@:
inc cx inc cx
mov edx,370*65536+25 mov edx,370*65536+25
call draw_but_icon call draw_but_icon
or ecx,0x40000000 or ecx,0x40000000
inc cx inc cx
mov edx,400*65536+25 mov edx,400*65536+25
@ -123,146 +123,112 @@ or ecx,0x40000000
; edi = pointer to tedit struct ; edi = pointer to tedit struct
align 4 align 4
proc draw_panel_find proc draw_panel_find
;push edi cmp ted_panel_id,TED_PANEL_FIND ;if not panel
;mov edi,dword[edit] jne @f
cmp ted_panel_id,TED_PANEL_FIND ;if not panel push eax ebx ecx edx
jne @f mov ecx,ted_wnd_t
push eax ebx ecx edx shl ecx,16
mov cx,20
mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà mov ebx,30*65536+25
mov ebx,TED_PANEL_WIDTH add ebx,ted_wnd_t
mov ecx,ted_wnd_t mov ecx,[sc.work_text]
shl ecx,16 or ecx,0x80000000
mov cx,20 mcall SF_DRAW_TEXT,,,txtFindCapt
mov edx,[sc.work]
int 0x40
mov eax,4 ;ðèñîâàíèå òåêñòà stdcall [edit_box_draw], edit2
mov ebx,30*65536+25
add ebx,ted_wnd_t
mov ecx,[sc.work_text]
or ecx,0x80000000
mov edx,txtFindCapt
int 0x40
stdcall [edit_box_draw], dword edit2 mov ecx,ted_wnd_t
add cx,20+15 ; 15 - height text box
shl ecx,16
add ecx,ted_wnd_h
mov edx,ted_scr_h
add cx,word[edx+sb_offs_size_y]
sub cx,20+15-1 ; 15 - height text box
mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà mov ecx,ted_wnd_t
mov ebx,TED_PANEL_WIDTH add cx,20+15+5
mov ecx,ted_wnd_t shl ecx,16
add cx,20+15 ; 15 - height text box mov cx,20
shl ecx,16 mcall SF_DEFINE_BUTTON,5*65536+85,,201,[sc.work_button] ;201 - button id
add ecx,ted_wnd_h
mov edx,ted_scr_h
add cx,word[edx+sb_offs_size_y]
sub cx,20+15-1 ; 15 - height text box
mov edx,[sc.work]
int 0x40
mov eax,8 ;êíîïêà mov ebx,15*65536+(20+15+10)
mov ebx,5*65536+85 add ebx,ted_wnd_t
mov ecx,ted_wnd_t mov ecx,[sc.work_text]
add cx,20+15+5 or ecx,0x80000000
shl ecx,16 mcall SF_DRAW_TEXT,,,txtFindNext
mov cx,20 pop edx ecx ebx eax
mov edx,201 ;button id jmp .end_f
mov esi,[sc.work_button] @@:
int 0x40 push eax edx
mov edx,201
mov eax,4 ;ðèñîâàíèå òåêñòà or edx,0x80000000
mov ebx,15*65536+(20+15+10) mcall SF_DEFINE_BUTTON
add ebx,ted_wnd_t pop edx eax
mov ecx,[sc.work_text] .end_f:
or ecx,0x80000000 ret
mov edx,txtFindNext
int 0x40
pop edx ecx ebx eax
jmp .end_f
@@:
push eax edx
mov eax,8
mov edx,201
or edx,0x80000000
int 0x40
pop edx eax
.end_f:
;pop edi
ret
endp endp
;input: ;input:
; edi = pointer to tedit struct ; edi = pointer to tedit struct
align 4 align 4
proc draw_panel_syntax proc draw_panel_syntax
;push edi cmp ted_panel_id,TED_PANEL_SYNTAX ;if not panel
;mov edi,dword[edit] jne @f
cmp ted_panel_id,TED_PANEL_SYNTAX ;if not panel pushad
jne @f
pushad
mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà mov ecx,ted_wnd_t
mov ebx,TED_PANEL_WIDTH shl ecx,16
mov ecx,ted_wnd_t mov cx,20
shl ecx,16 mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work] ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
mov cx,20
mov edx,[sc.work]
int 0x40 ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
stdcall dword[tl_draw], tree1 stdcall dword[tl_draw], tree1
mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà
stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox
ror ecx,16 ror ecx,16
add ecx,dword[tree1.box_height] add ecx,dword[tree1.box_height]
add ecx,20 add ecx,20
and ecx,0xffff and ecx,0xffff
ror ecx,16 ror ecx,16
add ecx,ted_wnd_h add ecx,ted_wnd_h
mov esi,ted_scr_h mov esi,ted_scr_h
add cx,word[esi+sb_offs_size_y] add cx,word[esi+sb_offs_size_y]
sub cx,20 sub cx,20
sub ecx,dword[tree1.box_height] sub ecx,dword[tree1.box_height]
inc cx inc cx
int 0x40 ;ðèñîâàíèå íèæíåãî ôîíîâîãî ïðÿìîóãîëüíèêà int 0x40 ;ðèñîâàíèå íèæíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
mov eax,8 ;êíîïêà mov ecx,ted_wnd_t
mov ebx,5*65536+65 add ecx,25
mov ecx,ted_wnd_t add ecx,dword[tree1.box_height]
add ecx,25 shl ecx,16
add ecx,dword[tree1.box_height] mov cx,20
shl ecx,16 mcall SF_DEFINE_BUTTON,(5 shl 16)+65,,200,[sc.work_button] ;200 - button id
mov cx,20
mov edx,200 ;button id
mov esi,[sc.work_button]
int 0x40
mov eax,4 ;ðèñîâàíèå òåêñòà mov ebx,(30 shl 16)+5
mov ebx,30*65536+5 add ebx,ted_wnd_t
add ebx,ted_wnd_t mov ecx,[sc.work_text]
mov ecx,[sc.work_text] or ecx,0x80000000
or ecx,0x80000000 mcall SF_DRAW_TEXT,,,txtFormatCapt
mov edx,txtFormatCapt
int 0x40
mov ebx,10*65536+31 mov ebx,(10 shl 16)+31
add ebx,dword[tree1.box_height] add ebx,dword[tree1.box_height]
add ebx,ted_wnd_t add ebx,ted_wnd_t
mov edx,txtFormatApply mcall ,,,txtFormatApply
int 0x40
popad popad
jmp .end_f jmp .end_f
@@: @@:
push eax edx push eax edx
mov eax,8 mov edx,200
mov edx,200 or edx,0x80000000
or edx,0x80000000 mcall SF_DEFINE_BUTTON ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó
int 0x40 ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó pop edx eax
pop edx eax .end_f:
.end_f: ret
;pop edi
ret
endp endp
MIN_M_WND_H equ 100 ;ìèíèìàëüíàÿ âûñîòà ãëàâíîãî îêíà MIN_M_WND_H equ 100 ;ìèíèìàëüíàÿ âûñîòà ãëàâíîãî îêíà
@ -270,41 +236,39 @@ MIN_M_WND_H equ 100 ;
; edi = pointer to tedit struct ; edi = pointer to tedit struct
align 4 align 4
EvSize: EvSize:
pushad pushad
mov ebx,ted_scr_h mov ebx,ted_scr_h
mov esi,ted_scr_w mov esi,ted_scr_w
m2m ted_wnd_w,[procinfo.client_box.width] ;ñòàâèì øèðèíó îêíà ðåäàêòîðà ðàâíîé øèðèíå âñåãî îêíà m2m ted_wnd_w,[procinfo.client_box.width] ;ñòàâèì øèðèíó îêíà ðåäàêòîðà ðàâíîé øèðèíå âñåãî îêíà
mov eax,ted_wnd_l mov eax,ted_wnd_l
sub ted_wnd_w,eax ;îòíèìàåì îòñòóï ñëåâà sub ted_wnd_w,eax ;îòíèìàåì îòñòóï ñëåâà
mov eax,dword[esi+sb_offs_size_x] movzx eax,word[esi+sb_offs_size_x]
and eax,0xffff sub ted_wnd_w,eax ;îòíèìàåì øèðèíó âåðò. ñêðîëëèíãà
sub ted_wnd_w,eax ;îòíèìàåì øèðèíó âåðò. ñêðîëëèíãà
m2m ted_wnd_h,[procinfo.client_box.height] ;ñòàâèì âûñîòó îêíà ðåäàêòîðà ðàâíîé âûñîòå âñåãî îêíà m2m ted_wnd_h,[procinfo.client_box.height] ;ñòàâèì âûñîòó îêíà ðåäàêòîðà ðàâíîé âûñîòå âñåãî îêíà
cmp ted_wnd_h,MIN_M_WND_H cmp ted_wnd_h,MIN_M_WND_H
jg @f jg @f
mov ted_wnd_h,MIN_M_WND_H mov ted_wnd_h,MIN_M_WND_H
@@: @@:
mov ax,word[ebx+sb_offs_size_y] movzx eax,word[ebx+sb_offs_size_y]
and eax,0xffff sub ted_wnd_h,eax ;îòíèìàåì âûñîòó ãîðèç. ñêðîëëèíãà
sub ted_wnd_h,eax ;îòíèìàåì âûñîòó ãîðèç. ñêðîëëèíãà mov eax,ted_wnd_t
mov eax,ted_wnd_t sub ted_wnd_h,eax ;îòíèìàåì îòñòóï ñâåðõó
sub ted_wnd_h,eax ;îòíèìàåì îòñòóï ñâåðõó
stdcall [ted_init_scroll_bars], tedit0,2 stdcall [ted_init_scroll_bars], tedit0,2
mov eax,ted_wnd_t mov eax,ted_wnd_t
mov edi,dword tree1 mov edi,dword tree1
mov tl_box_top,eax ;=ted_wnd_t mov tl_box_top,eax ;=ted_wnd_t
add tl_box_top,20 add tl_box_top,20
mov dword[edit2.top],eax ;=ted_wnd_t mov [edit2.top],eax ;=ted_wnd_t
add dword[edit2.top],20 add dword[edit2.top],20
popad popad
ret ret
;input: ;input:
; ecx = 0x4000____ ; ecx = 0x4000____
@ -314,7 +278,7 @@ align 4
draw_but_icon: draw_but_icon:
push eax ebx push eax ebx
mov eax,8 ;êíîïêà mov eax,SF_DEFINE_BUTTON
push ecx edx esi push ecx edx esi
mov ebx,edx mov ebx,edx
mov edx,ecx mov edx,ecx
@ -330,11 +294,11 @@ draw_but_icon:
jge @f ;êíîïêà íå âëåçëà â îêíî jge @f ;êíîïêà íå âëåçëà â îêíî
mov esi,[sc.work_button] mov esi,[sc.work_button]
int 0x40 ;ñòàâèì êíîïêó int 0x40 ;ñòàâèì êíîïêó
mov eax,7 ;bmp mov eax,SF_PUT_IMAGE
@@: @@:
pop esi edx ecx pop esi edx ecx
cmp eax,7 cmp eax,SF_PUT_IMAGE
jne @f ;êíîïêà íå âëåçëà â îêíî jne @f ;êíîïêà íå âëåçëà â îêíî
mov ebx,[bmp_icon] mov ebx,[bmp_icon]
bt ecx,30 ;if (ecx & 0x40000000) bt ecx,30 ;if (ecx & 0x40000000)

View File

@ -20,7 +20,7 @@ end if
align 4 align 4
prop_start: prop_start:
pushad pushad
mcall 40,0xC0000027 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩ mcall SF_SET_EVENTS_MASK,0xC0000027 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩
inc byte[wnd_k_words_run] inc byte[wnd_k_words_run]
;­ áâனª  ᯨ᪠ ®¡ê¥ªâ®¢ ;­ áâனª  ᯨ᪠ ®¡ê¥ªâ®¢
@ -41,10 +41,8 @@ popad
align 4 align 4
prop_red_win: prop_red_win:
pushad pushad
mcall 12,1 mcall SF_REDRAW,SSF_BEGIN_DRAW
xor eax,eax
mov edi,txt_caption
mov bx,word[procinfo.box.left] mov bx,word[procinfo.box.left]
add bx,5 ;word[buf_0.l] add bx,5 ;word[buf_0.l]
shl ebx,16 shl ebx,16
@ -53,43 +51,31 @@ pushad
add cx,42 ;word[buf_0.t] add cx,42 ;word[buf_0.t]
shl ecx,16 shl ecx,16
mov cx,250 mov cx,250
mov edx,0xffffd0 mcall SF_CREATE_WINDOW,,,0x33ffffd0,,txt_caption
or edx,0x33000000
int 0x40
mov eax,8
mov ebx,(5 shl 16)+19
mov ecx,(5 shl 16)+19
mov edx,3
mov esi,[sc.work_button]
int 0x40
mcall SF_DEFINE_BUTTON,(5 shl 16)+19,(5 shl 16)+19,3,[sc.work_button]
add ebx,(25 shl 16) add ebx,(25 shl 16)
mov edx,4 mcall ,,,4
int 0x40
mov eax,7
mov ebx,[bmp_icon] mov ebx,[bmp_icon]
add ebx,7*IMAGE_TOOLBAR_ICON_SIZE add ebx,7*IMAGE_TOOLBAR_ICON_SIZE
mov ecx,(20 shl 16)+20 mcall SF_PUT_IMAGE,,(20 shl 16)+20,(5 shl 16)+5 ;­ ©â¨
mov edx,(5 shl 16)+5 ;­ ©â¨
int 0x40
sub ebx,2*IMAGE_TOOLBAR_ICON_SIZE sub ebx,2*IMAGE_TOOLBAR_ICON_SIZE
mov edx,(30 shl 16)+5 ;ª®¯¨à®¢ âì mov edx,(30 shl 16)+5 ;ª®¯¨à®¢ âì
int 0x40 int 0x40
mov dword[w_scr_t3.all_redraw],1 mov dword[w_scr_t3.all_redraw],1
stdcall [scrollbar_ver_draw],dword w_scr_t3 stdcall [scrollbar_ver_draw], w_scr_t3
stdcall [tl_draw], tree3 stdcall [tl_draw], tree3
stdcall [edit_box_draw], edit3 stdcall [edit_box_draw], edit3
mcall 12,2 mcall SF_REDRAW,SSF_END_DRAW
popad popad
;­¥ ®âà뢠âì íâã äã­ªæ¨î ®â ¯à¥¤ë¤ã饩 ;­¥ ®âà뢠âì íâã äã­ªæ¨î ®â ¯à¥¤ë¤ã饩
align 4 align 4
prop_still: prop_still:
mcall 10 mcall SF_WAIT_EVENT
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­  cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jz prop_red_win jz prop_red_win
@ -111,12 +97,12 @@ prop_still:
mov dword[tree3.data_img_sys],0 ;â. ª. ®­¨ ¥é¥ ¨á¯®«ì§ãîâìáï ¢ ¤à㣨å í«¥¬¥­â å mov dword[tree3.data_img_sys],0 ;â. ª. ®­¨ ¥é¥ ¨á¯®«ì§ãîâìáï ¢ ¤à㣨å í«¥¬¥­â å
stdcall dword[tl_data_clear], tree3 stdcall dword[tl_data_clear], tree3
mov byte[wnd_k_words_run],0 ;®¡­ã«ï¥¬ áç¥â稪 ®ª®­ mov byte[wnd_k_words_run],0 ;®¡­ã«ï¥¬ áç¥â稪 ®ª®­
mcall -1 ;§ ªàë⨥ ®ª­  ¯®¨áª  mcall SF_TERMINATE_PROCESS
align 4 align 4
prop_key: prop_key:
push eax push eax
mcall 2 mcall SF_GET_KEY
stdcall [edit_box_key], edit3 stdcall [edit_box_key], edit3
stdcall [tl_key], tree3 stdcall [tl_key], tree3
pop eax pop eax
@ -133,7 +119,7 @@ prop_mouse:
align 4 align 4
prop_button: prop_button:
pushad pushad
mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨ mcall SF_GET_BUTTON
cmp ah,1 cmp ah,1
je prop_still.exit je prop_still.exit
@ -153,14 +139,23 @@ prop_button:
stdcall str_instr, ebx,[edit3.text] stdcall str_instr, ebx,[edit3.text]
test al,al test al,al
jnz .end_add jnz .end_add
stdcall dword[tl_node_add], tree3, (0 shl 16), ebx ;ª«î祢®¥ á«®¢®
stdcall dword[tl_node_add], tree3, (1 shl 16), ebx
stdcall dword[tl_cur_next], tree3 stdcall dword[tl_cur_next], tree3
mov edx,[ebx+MAX_COLOR_WORD_LEN]
or edx,edx
jz .end_add
;á¯à ¢ª  ¯® ª«î祢®¬ã á«®¢ã
add edx,ted_help_text_f1
stdcall dword[tl_node_add], tree3, 1, edx
stdcall dword[tl_cur_next], tree3
.end_add: .end_add:
add ebx,MAX_COLOR_WORD_LEN+8 ;sizeof.TexColViv add ebx,MAX_COLOR_WORD_LEN+8 ;sizeof.TexColViv
loop .cycle_0 loop .cycle_0
stdcall dword[tl_cur_beg], tree3 stdcall dword[tl_cur_beg], tree3
stdcall dword[tl_draw], tree3 stdcall dword[tl_draw], tree3
jmp .no_select_0
@@: @@:
cmp ah,4 cmp ah,4
jne @f jne @f
@ -178,7 +173,7 @@ prop_button:
mov ecx,MAX_COLOR_WORD_LEN mov ecx,MAX_COLOR_WORD_LEN
cld cld
rep movsb rep movsb
mcall 54,2,12+MAX_COLOR_WORD_LEN,[tedit0.buffer] mcall SF_CLIPBOARD,SSF_WRITE_CB,12+MAX_COLOR_WORD_LEN,[tedit0.buffer]
.no_select_0: .no_select_0:
@@: @@:
@ -187,10 +182,8 @@ prop_button:
;¤¥à¥¢® á ®¡ê¥ªâ ¬¨ ¢ ¯®«ì§®¢ â¥«ì᪮¬ ä ©«¥ ;¤¥à¥¢® á ®¡ê¥ªâ ¬¨ ¢ ¯®«ì§®¢ â¥«ì᪮¬ ä ©«¥
align 4 align 4
tree3 tree_list MAX_COLOR_WORD_LEN,3,\ tree3 tree_list MAX_COLOR_WORD_LEN,3,tl_key_no_edit,\
tl_key_no_edit+tl_list_box_mode,\ 16,16, 0x8080ff,0x0000ff,0xffffff, 5,30,300,160, 16, 0,0, el_focus, w_scr_t3,0
16,16, 0x8080ff,0x0000ff,0xffffff, 5,30,300,160, 16, 0,0, el_focus,\
w_scr_t3,0
align 4 align 4
edit3 edit_box 80, 70, 8, 0xffffff, 0xff, 0x80ff, 0, 0x8000, MAX_COLOR_WORD_LEN+2, string1, mouse_dd, 0 edit3 edit_box 80, 70, 8, 0xffffff, 0xff, 0x80ff, 0, 0x8000, MAX_COLOR_WORD_LEN+2, string1, mouse_dd, 0