Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1456 → Rev 1449

/programs/other/t_edit/t_draw.inc
1,4 → 1,3
align 4
proc mouse_wnd_main, edit:dword
push eax ebx ecx edi
mcall 37,2 ;get mouse buttons
50,7 → 49,6
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
;description:
; ôóíêöèÿ âûçûâåòñÿ ïðè íàæàòèè êíîïêîé ìûøè è ïîïàäåíèè êóðñîðîì â îêíî ðåäàêòîðà
align 4
wnd_main_click:
push ecx edx
 
69,7 → 67,7
mov eax,[hScr.cur_area]
@@:
;dec eax
mov ted_cur_x,eax
mov [cur_x],eax
pop eax
 
push eax
86,21 → 84,20
mov eax,[wScr.cur_area]
@@:
dec eax
mov ted_cur_y,eax
mov [cur_y],eax
pop eax
 
cmp ted_drag_m,0
je @f
stdcall SelMove,edi
call SelMove
jmp .sel_move
@@:
mov ted_drag_m,1
stdcall SelStart,edi
call SelStart
.sel_move:
pop edx ecx
ret
 
align 4
wnd_main_mouse_scroll:
push eax ebx
mcall 37,7
125,11 → 122,9
pop ebx eax
ret
 
align 4
draw_but_toolbar: ;âíåøíÿÿ ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
push ebx ecx edx edi
mov edi,tedit0
draw_but_toolbar:
 
push ebx ecx edx
mov ecx,0x40000000
; mov edx,5*65536+25
mov edx,85*65536+2
140,7 → 135,7
mov edx,110*65536+2
call draw_but_icon
 
stdcall ted_can_save,edi
call CanSave
cmp al,1
je @f
and ecx,0xffff
155,7 → 150,7
mov edx,85*65536+25
call draw_but_icon
 
stdcall IsSel,edi
stdcall IsSel, tedit0
cmp al,0
jne @f
and ecx,0xffff
202,8 → 197,8
mov edx,235*65536+25
call draw_but_icon
 
mov ebx,ted_tim_undo
cmp ted_tim_ch,ebx
mov ebx,[tim_Undo]
cmp [ch_tim],ebx
jg @f
and ecx,0xffff
@@:
212,7 → 207,7
call draw_but_icon
or ecx,0x40000000
 
cmp ted_tim_undo,1
cmp [tim_Undo],1
jge @f
and ecx,0xffff
@@:
233,12 → 228,11
mov edx,450*65536+25
call draw_but_icon
 
pop edi edx ecx ebx
pop edx ecx ebx
ret
 
;input:
; clear_o - åñëè =1 î÷èñòèòü îäíó ñòðîêó, =0 î÷èñòèòü âñå ñòðîêè îêíà äî íèçó
align 4
proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
pushad
mov edi,dword[edit]
271,7 → 265,7
sub ebx,ted_rec_l
xor cx,cx
add ecx,ted_rec_h
mov edx,ted_color_wnd_work
mov edx,[WND_WORK_COLOR]
 
cmp dword[clear_o],0
je .pusto
284,11 → 278,11
stdcall IsSel,edi
cmp al,0
je @f
cmp ted_seln_y0,esi
cmp [seln.y0],esi
jg @f
cmp ted_seln_y1,esi
cmp [seln.y1],esi
jl @f
mov edx,ted_color_select ;draw selected line
mov edx,[SELECT_COLOR] ;draw selected line
@@:
 
mov eax,13 ;rect
301,10 → 295,10
mov al,13 ;rect
xor cx,cx
add ecx,ted_rec_h
cmp ted_seln_y0,esi
cmp [seln.y0],esi
jne @f
push bx
mov edx,ted_seln_x0 ; âåðõíÿÿ ïîëîñà (çàòèðàåò ñëåâà)
mov edx,[seln.x0] ; âåðõíÿÿ ïîëîñà (çàòèðàåò ñëåâà)
cmp edx,[hScr.position]
jle .in_wnd
sub edx,[hScr.position]
314,13 → 308,13
.in_wnd:
mov bx,0
.no_wnd:
mov edx,ted_color_wnd_work
mov edx,[WND_WORK_COLOR]
int 0x40
pop bx
@@:
cmp ted_seln_y1,esi
cmp [seln.y1],esi
jne @f
mov edx,ted_seln_x1 ; íèæíÿÿ ïîëîñà (çàòèðàåò ñïðàâà)
mov edx,[seln.x1] ; íèæíÿÿ ïîëîñà (çàòèðàåò ñïðàâà)
cmp edx,[hScr.position]
jle .in_wnd2
sub edx,[hScr.position]
330,7 → 324,7
add ebx,edx
.in_wnd2:
 
mov edx,ted_color_wnd_work
mov edx,[WND_WORK_COLOR]
int 0x40
@@:
 
339,7 → 333,7
ret
endp
 
align 4
 
proc draw_main_win, edit:dword
locals
line_num dd ?
348,8 → 342,9
mov edi,dword[edit]
 
mov eax,4 ;draw text
mov ecx,ted_text_colors
mov ecx,dword[ecx]
mov ecx,[tex_colors]
push dword[ecx]
pop ecx
 
mov ebx,ted_wnd_l
add ebx,ted_rec_l
358,11 → 353,11
add ebx,ted_rec_t
add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
 
stdcall SelNormalize,edi ;need before draw select
call SelNormalize ;need before draw select
mov esi,[wScr.position]
mov dword[line_num],esi
 
stdcall clear_line_before_draw, edi,ebx,1,esi
stdcall clear_line_before_draw, tedit0,ebx,1,esi
call GetFirstVisiblePos
cmp edx,0
je .no_draw_text
369,11 → 364,11
mov esi,1 ;äëèííà âûâîäèìîãî òåêñòà ïî 1-ìó ñèìâîëó
@@:
call IteratNext
cmp edx,ted_tex_1
cmp edx,[tex_1]
jle .no_draw_text
 
; *** öâåòîâàÿ ðàçìåòêà
cmp ted_mode_color,0
cmp byte[mode_colored],0
je .no_col_change
cmp byte[edx+1],0
je .no_col_change
382,11 → 377,10
 
cmp byte [edx],13
jne .no_13
cmp ted_mode_invis,1
cmp [invis],1
jne .no_invis
push edx
mov edx,edi
add edx,ted_offs_symbol_new_line
mov edx,symbol_new_line
int 0x40
pop edx
.no_invis:
405,7 → 399,7
inc ebx
ror ebx,16
inc dword[line_num] ;increment line number
stdcall clear_line_before_draw,edi,ebx,1,dword[line_num]
stdcall clear_line_before_draw, tedit0,ebx,1,dword[line_num]
call OptDrawLineLeft
jmp @b
.no_13:
424,9 → 418,9
jmp @b
.no_draw_text:
 
stdcall clear_line_before_draw,edi,ebx,0,dword[line_num]
stdcall draw_line_numbers,edi
stdcall draw_main_cursor,edi
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
478,12 → 472,11
;txtBDn db 25
;txtBRi db 26
;txtBLe db 27
align 4
proc draw_panel_find, edit:dword
push edi
mov edi,dword[edit]
 
cmp ted_panel_id,TE_PANEL_FIND ;if not panel
cmp byte[panel_id],TE_PANEL_FIND ;if not panel
jne @f
push eax ebx ecx edx
 
503,7 → 496,8
mov edx,txtFindCapt
int 0x40
 
stdcall [edit_box_draw], dword edit2
push dword edit2
call [edit_box_draw]
 
mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
mov ebx,TE_PANEL_WIDTH
548,13 → 542,11
ret
endp
 
 
align 4
proc draw_panel_syntax, edit:dword
push edi
mov edi,dword[edit]
 
cmp ted_panel_id,TE_PANEL_SYNTAX ;if not panel
cmp byte[panel_id],TE_PANEL_SYNTAX ;if not panel
jne @f
push eax ebx ecx edx
 
566,7 → 558,7
mov edx,[sc.work]
int 0x40 ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
 
stdcall dword[tl_draw], tree1
stdcall dword[tl_draw], dword tree1
mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà
stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox
 
621,8 → 613,6
ret
endp
 
 
align 4
proc draw_cur_line, edit:dword
pushad
mov edi,dword[edit]
630,7 → 620,7
mov ebx,ted_wnd_l
add ebx,ted_rec_l
shl ebx,16
mov eax,ted_cur_y
mov eax,[cur_y]
imul eax,ted_rec_h
mov bx,ax
add ebx,ted_wnd_t
637,8 → 627,8
add ebx,ted_rec_t ;ebx - êîîðäèíàòû äëÿ ïðÿìîóãîëüíèêà î÷èñòêè ëèíèè
add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
 
stdcall SelNormalize,edi ;need before draw select
mov ecx,ted_cur_y
call SelNormalize ;need before draw select
mov ecx,[cur_y]
add ecx,[wScr.position]
stdcall clear_line_before_draw, tedit0, ebx,1,ecx
 
645,7 → 635,7
mov esi,[hScr.position]
call GetPosByParam
 
cmp ted_gp_opt,2
cmp [gpOpt],2
jne .no_draw_text
; mov eax,4 ;draw text
call GetSymbColor
652,11 → 642,11
mov esi,1 ;draw 1 symbol
@@:
;call IteratNext
cmp edx,ted_tex_1
cmp edx,[tex_1]
jle .no_draw_text
 
; *** öâåòîâàÿ ðàçìåòêà
cmp ted_mode_color,0
cmp byte[mode_colored],0
je .no_col_change
cmp byte[edx+1],0
je .no_col_change
666,11 → 656,10
mov eax,4 ;draw text
cmp byte [edx],13
jne .no_13
cmp ted_mode_invis,1
cmp [invis],1
jne .no_draw_text
push edx
mov edx,edi
add edx,ted_offs_symbol_new_line
mov edx,symbol_new_line
int 0x40
pop edx
jmp .no_draw_text
688,7 → 677,7
jmp @b
.no_draw_text:
 
stdcall draw_main_cursor,edi
stdcall draw_main_cursor, tedit0
popad
ret
endp
696,7 → 685,6
MIN_M_WND_H equ 100
MIN_W_SCRL_ARE equ 3
MIN_H_SCRL_ARE equ 3
align 4
proc EvSize, edit:dword
push eax ecx edx edi
mov edi,dword[edit]
771,28 → 759,23
ret
endp
 
align 4
OnInitialUpdate:
mov [wScr.redraw],1
mov [hScr.redraw],1
ret
 
;input:
; edi = pointer to tedit struct
;output:
; ecx = íîâûé öâåò ñèìâîëà
; edx = pointer to symbol
; edx = 0 if text not in screen
align 4
GetFirstVisiblePos:
push ecx
mov edx,ted_tex
mov edx,[tex]
xor ecx,ecx
@@:
cmp ecx,[wScr.position]
je @f
call IteratNext
cmp edx,ted_tex_1
cmp edx,[tex_1]
jle @f
cmp byte [edx],13
jne @b
816,27 → 799,23
 
;input:
; edx = pointer to symbol
; edi = pointer to tedit struct
;output:
; ecx = íîâûé öâåò ñèìâîëà
; edx = óêàçàòåëü íà ïåðâûé ëåâûé ñèìâîë
align 4
proc OptDrawLineLeft
push ebx
 
mov ebx,[hScr.position]
cmp ebx,0
; edx = pointer to first left symbol
OptDrawLineLeft:
push ecx
mov ecx,[hScr.position]
cmp ecx,0
je .ret_f
push eax
mov eax,edx
 
cmp edx,ted_tex
cmp edx,[tex]
jne @f
call IteratNext
jmp .beg_cycle
@@:
 
cmp ebx,0
cmp ecx,0
je @f
 
cmp byte[edx],13
844,50 → 823,33
call IteratNext
.beg_cycle:
@@:
cmp edx,ted_tex_1
cmp edx,[tex_1]
jle @f
cmp byte[edx],13
je @f
cmp ebx,0
cmp ecx,0
je @f
;--------------------------------------
xor eax,eax ;eax áóäåò ìåíÿòüñÿ
mov al,byte[edx+1]
cmp al,0
je .no_color
cmp eax,ted_colors_text_count
jge .no_color
xor ecx,ecx
mov cl,byte[edx+1]
shl cx,2
add ecx,ted_text_colors
mov ecx,dword[ecx]
.no_color:
;--------------------------------------
mov eax,edx
call IteratNext
dec ebx
dec ecx
jmp @b
@@:
mov edx,eax
pop eax
.ret_f:
pop ecx
call GetSymbColor
pop ebx
ret
endp
 
;input:
; edx = pointer to symbol
; edi = pointer to tedit struct
;output:
; edx = pointer to 13 symbol
align 4
proc OptDrawLineRight
OptDrawLineRight:
push eax
mov eax,edx
@@:
cmp edx,ted_tex_1
cmp edx,[tex_1]
jle @f
cmp byte[edx],13
je @f
896,13 → 858,10
jmp @b
@@:
mov edx,eax ;perv sumbol
pop eax
call GetSymbColor
 
pop eax
ret
endp
 
align 4
proc draw_main_cursor, edit:dword
pushad
mov edi,dword[edit]
910,11 → 869,11
mov eax,13 ;draw cursor
mov ecx,ted_wnd_t ;calc rect -> y0,y1
add ecx,ted_rec_t
mov edx,ted_cur_y
mov edx,[cur_y]
imul edx,ted_rec_h
add ecx,edx
 
cmp ted_cur_ins,1 ;ïðîâåðêà ðåæèìà ðàáîòû êóðñîðà (îáû÷íûé èëè âñòàâêà)
cmp [curMod],1 ;ïðîâåðêà ðåæèìà ðàáîòû êóðñîðà (îáû÷íûé èëè âñòàâêà)
jne @f
mov edx,ted_rec_h
inc edx ;1->1, 3->2, 5->3, ...
923,7 → 882,7
@@:
shl ecx,16
add ecx,ted_rec_h
cmp ted_cur_ins,1
cmp [curMod],1
jne @f
shr cx,1 ;äåëèì âûñîòó êóðñîðà íà 2
@@:
930,17 → 889,17
 
mov ebx,ted_wnd_l ;calc rect -> x0,x1
add ebx,ted_rec_l
mov edx,ted_cur_x
mov edx,[cur_x]
imul edx,ted_rec_w
add ebx,edx
shl ebx,16
add ebx,ted_rec_w
 
mov edx,ted_color_cursor
mov edx,[CURSOR_COLOR]
int 0x40 ;âûâîä êóðñîðà
 
call GetPos
cmp ted_gp_opt,2
cmp [gpOpt],2
jne @f
mov eax,4 ;draw text
mov esi,1
947,7 → 906,7
ror ecx,16
mov bx,cx
add ebx,0x10001
cmp ted_cur_ins,1
cmp [curMod],1
jne .no_up_tetx
mov ecx,ted_rec_h
inc cx ; 1->1, 3->2, 5->3, ...
954,7 → 913,7
shr cx,1
sub bx,cx
.no_up_tetx:
mov ecx,ted_color_cur_text
mov ecx,[CUR_TEXT_COLOR]
call ConvertInvisSymb
int 0x40
@@:
965,7 → 924,7
shl ebx,16
add ebx,ted_wnd_t
add ebx,3
mov ecx,ted_color_wnd_bord
mov ecx,[WND_BORD_COLOR]
or ecx,0x80000000
mov edx,txtRow
int 0x40 ;âûâîä ïîäïèñè 'Ñòðîêà'
974,7 → 933,7
mov edx,txtCol
int 0x40 ;âûâîä ïîäïèñè 'Çíàê'
 
cmp ted_tim_undo,0
cmp [tim_Undo],0
je @f
add ebx,0x500000
mov edx,txtOtm
983,10 → 942,10
@@:
 
stdcall draw_bufer,edi
stdcall draw_help_f1
stdcall draw_help_f1, edi
 
mov eax,47 ;draw cursor coords
mov esi,ted_color_wnd_bord
mov esi,[WND_BORD_COLOR]
or esi,0x40000000
 
mov edx,ebx
995,28 → 954,23
ror edx,16
;add edx,3
mov ebx,0x40000 ;Row=...
mov ecx,ted_cur_y
mov ecx,[cur_y]
inc ecx
add ecx,[wScr.position]
; edi <> tedit ----------------------------------------------------------------
mov edi,[WND_WORK_COLOR]
int 0x40
 
push edi
mov edi,ted_color_wnd_work
int 0x40 ;âûâîä ÷èñëà òåêóùåé ñòðîêè
pop edi
 
;mov ebx,0x40000 ;Col=...
mov ecx,ted_cur_x
mov ecx,[cur_x]
inc ecx
add ecx,[hScr.position]
add edx,0x500000
push edi
mov edi,ted_color_wnd_work
int 0x40 ;âûâîä ÷èñëà çíàêîâ
pop edi
int 0x40
 
cmp ted_tim_undo,0
cmp [tim_Undo],0
je @f
mov ecx,ted_tim_undo
mov ecx,[tim_Undo]
add edx,0x500000
int 0x40
@@:
1025,7 → 979,6
ret
endp
 
align 4
proc draw_bufer, edit:dword
pushad
mov edi,dword[edit]
1038,9 → 991,9
shl ebx,16
add ebx,ted_wnd_t
add ebx,3
mov ecx,ted_color_wnd_bord
mov ecx,[WND_BORD_COLOR]
or ecx,0x40000000
mov edi,ted_color_wnd_work
mov edi,[WND_WORK_COLOR]
mov edx,txtBuf
mov esi,buf
1067,11 → 1020,9
ret
endp
 
;input:
; edi = pointer to tedit struct
align 4
proc draw_help_f1
proc draw_help_f1, edit:dword
pushad
mov edi,dword[edit]
 
mov eax,13 ;clear place before draw help
mov ebx,ted_wnd_l
1083,12 → 1034,12
add ecx,13
shl ecx,16
add ecx,ted_rec_h
mov edx,ted_color_wnd_capt
mov edx,[WND_CAPT_COLOR]
int 0x40
 
cmp ted_help_id,-1
cmp [help_id],-1
je @f
mov eax,ted_help_id
mov eax,[help_id]
ColToIndexOffset eax,edx
 
;SetCoordinates
1102,23 → 1053,24
xor eax,eax
mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
shl ax,2
mov ecx,ted_text_colors
mov ecx,[tex_colors]
add ecx,eax
mov ecx,dword[ecx]
push dword[ecx]
pop ecx
or ecx,0xc0000000 ;SetTextStyles
mov esi,edi
mov edi,ted_color_wnd_work
mov edi,[WND_WORK_COLOR]
; edi <> edit -----------------------------------------------------------------
mov eax,4
int 0x40
mov edi,esi
 
;*** draw help string ***
mov ecx,ted_color_wnd_bord
mov ecx,[WND_BORD_COLOR]
or ecx,0x80000000
mov edx,dword[edx+MAX_COLOR_WORD_LEN]
cmp edx,0
mov edi,dword[edx+MAX_COLOR_WORD_LEN]
cmp edi,0
je @f
add edx,ted_help_text_f1
add edi,dword[tex_help_f1]
mov edx,edi
add ebx,0x500000
int 0x40
@@:
1126,7 → 1078,6
ret
endp
 
align 4
proc draw_line_numbers, edit:dword
pushad
mov edi,dword[edit]
1137,12 → 1088,12
shl ebx,16
add ebx,ted_wnd_w
; sub ebx,ted_rec_l
mov edx,ted_color_wnd_work
mov edx,[WND_WORK_COLOR]
mov ecx,ted_wnd_t
shl ecx,16
add ecx,ted_rec_t
mov eax,13
mov edx,ted_color_wnd_capt
mov edx,[WND_CAPT_COLOR]
int 0x40
 
;line numbers
1166,12 → 1117,12
mov cx,dx
rol ecx,16
mov eax,13
mov edx,ted_color_wnd_capt
mov edx,[WND_CAPT_COLOR]
int 0x40 ;ðèñóåì ïðÿìîóãîëüíèê ïîä íîìåðîì ñòðîêè
pop edx ecx ebx
 
mov eax,47
mov esi,ted_color_wnd_bord
mov esi,[WND_BORD_COLOR]
int 0x40 ;ðèñóåì íîìåð ñòðîêè
inc ecx
add edx,ted_rec_h
1189,7 → 1140,6
endp
;this function need to optimize output
align 4
proc draw_cursor_sumb, edit:dword
push eax ecx edx edi
mov edi,dword[edit]
1197,7 → 1147,7
mov eax,13 ;rect
mov ebx,ted_wnd_l
add ebx,ted_rec_l
mov edx,ted_cur_x
mov edx,[cur_x]
imul edx,ted_rec_w
add ebx,edx
shl ebx,16
1205,44 → 1155,44
 
mov ecx,ted_wnd_t ;calc rect -> y0,y1
add ecx,ted_rec_t
mov edx,ted_cur_y
mov edx,[cur_y]
imul edx,ted_rec_h
add ecx,edx
shl ecx,16
add ecx,ted_rec_h
 
mov edx,ted_color_wnd_work
mov edx,[WND_WORK_COLOR]
push ecx
stdcall SelNormalize,edi
call SelNormalize
 
mov ecx,[wScr.position]
sub ted_seln_y0,ecx
sub ted_seln_y1,ecx
sub [seln.y0],ecx
sub [seln.y1],ecx
 
mov ecx,ted_cur_y
cmp ecx,ted_seln_y0
mov ecx,[cur_y]
cmp ecx,[seln.y0]
jl .no_cur_sel
cmp ecx,ted_seln_y1
cmp ecx,[seln.y1]
jg .no_cur_sel
mov edx,ted_color_select
mov edx,[SELECT_COLOR]
cmp ecx,ted_seln_y0
cmp ecx,[seln.y0]
jne @f
mov ecx,ted_cur_x
mov ecx,[cur_x]
add ecx,[hScr.position]
cmp ecx,ted_seln_x0
cmp ecx,[seln.x0]
jge @f
mov edx,ted_color_wnd_work
mov edx,[WND_WORK_COLOR]
@@:
 
mov ecx,ted_cur_y
cmp ecx,ted_seln_y1
mov ecx,[cur_y]
cmp ecx,[seln.y1]
jne .no_cur_sel
mov ecx,ted_cur_x
mov ecx,[cur_x]
add ecx,[hScr.position]
cmp ecx,ted_seln_x1
cmp ecx,[seln.x1]
jl .no_cur_sel
mov edx,ted_color_wnd_work
mov edx,[WND_WORK_COLOR]
 
.no_cur_sel:
pop ecx
1249,7 → 1199,7
int 0x40
 
call GetPos
cmp ted_gp_opt,2
cmp [gpOpt],2
jne @f
push esi
mov eax,4 ;draw text
1257,6 → 1207,7
ror ecx,16
mov bx,cx
add ebx,0x10001
;mov ecx,[WND_TEXT_COLOR]
call GetSymbColor
call ConvertInvisSymb
int 0x40
1269,36 → 1220,37
 
 
;input:
; edx -> pointer to text
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
; edx = pointer to text
;output:
; ecx = color
; if ted_mode_color=0 then ecx=ted_color_wnd_text
align 4
; if mode_colored=0 then ecx=WND_TEXT_COLOR
GetSymbColor:
mov ecx,ted_color_wnd_text ;çàäàåì öâåò òåêñòà ïî óìîë÷àíèþ
mov ecx,[WND_TEXT_COLOR]
 
push eax edx
cmp ted_mode_color,0
cmp byte[mode_colored],0
je .exit
jmp .on_first
@@:
call IteratPerv
cmp edx,ted_tex_1
cmp edx,[tex_1]
jle .exit
.on_first:
xor eax,eax
mov al,byte[edx+1]
cmp al,0 ;åñëè al=0 òî öâåò íå ìåíÿåòñÿ
cmp al,0
je @b
 
cmp eax,ted_colors_text_count
;cmp al,0xff
;je .exit
cmp eax,[ColColor]
jge .exit
 
shl ax,2 ;óìíîæàåì èíäåêñ öâåòà íà 4 áàéòà
mov ecx,ted_text_colors ;ïðèáàâëÿåì ñìåùåíèå 1-ãî öâåòà
shl ax,2 ;*4
mov ecx,[tex_colors]
add ecx,eax
mov ecx,dword[ecx] ;óñòàíàâëèâàåì òåêóùèé öâåò òåêñòà ïî ñìåùåíèþ
push dword[ecx]
pop ecx
.exit:
pop edx eax
ret
1305,15 → 1257,12
 
;input:
; edx = pointer to text
; edi = pointer to tedit struct
align 4
ConvertInvisSymb:
cmp ted_mode_invis,1
cmp [invis],1
jne @f
cmp byte [edx],13
jne @f
mov edx,edi
add edx,ted_offs_symbol_new_line
mov edx,symbol_new_line
@@:
ret
 
1321,7 → 1270,6
; ecx = 0x4000____
; cx = icon index
; edx = x*2^16+y
align 4
draw_but_icon:
push eax ebx