Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 7578 → Rev 7579

/programs/develop/libraries/box_lib/trunk/box_lib.asm
321,7 → 321,8
dd sz_ted_but_find, ted_but_find
dd sz_ted_but_replace, ted_but_replace
dd sz_ted_text_colored, ted_text_colored
dd sz_ted_version, 0x00000005
dd sz_ted_go_to_position, ted_go_to_position
dd sz_ted_version, 6
 
dd sz_Frame_draw, frame.draw
dd szVersion_frame, 0x00010001
434,6 → 435,7
sz_ted_but_find db 'ted_but_find',0
sz_ted_but_replace db 'ted_but_replace',0
sz_ted_text_colored db 'ted_text_colored',0
sz_ted_go_to_position db 'ted_go_to_position',0
sz_ted_version db 'version_text_edit',0
 
sz_Frame_draw db 'frame_draw',0
/programs/develop/libraries/box_lib/trunk/box_lib.mac
408,16 → 408,13
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_fun_on_key_ctrl_all equ dword[edi+198] ;㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,F,S,H,G
;+202,+206,+210 § à¥§¥à¢¨à®¢ ­®
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_draw_panels equ dword[edi+230] ;㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ¯®¨áª |...|ᨭ⠪á¨á 
ted_fun_save_err equ dword[edi+238] ;㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ á®åà ­¥­¨¥ ä ©«  § ª®­ç¨«®áì ­¥ã¤ ç­®
ted_increase_size equ dword[edi+242] ;ç¨á«® ᨬ¢®«®¢ ­  ª®â®àë¥ ¡ã¤¥â 㢥稢 âìáï ¯ ¬ïâì ¯à¨ ­¥å¢ âª¥
ted_ptr_free_symb equ dword[edi+246] ;㪠§ â¥«ì ­  ᢮¡®¤­ãî ¯ ¬ïâì, ¢ ª®â®àãî ¬®¦­® ¤®¡ ¢«ïâì ᨬ¢®« (¨á¯®«ì§ã¥âáï ¢­ãâà¨ í«¥¬¥­â  ¤«ï ã᪮७¨ï ¢áâ ¢ª¨ ⥪áâ )
/programs/develop/libraries/box_lib/trunk/doc/t_edit/t_edit.htm
37,6 → 37,7
<li><a href="#fun_open_file">ted_open_file</a></li>
<li><a href="#fun_text_add">ted_text_add</a></li>
<li><a href="#fun_text_colored">ted_text_colored</a></li>
<li><a href="#fun_go_to_position">ted_go_to_position</a></li>
</ul>
<p><a href="#syn_file">Ôîðìàò ôàéëà ïîäñâåòêè *.syn</a></p>
<p><a href="#struc_tedit">Ñòðóêòóðà tedit</a></p>
48,8 → 49,8
 
<h2>Âîçìîæíîñòè ýëåìåíòà</h2>
<ul>
<li>Îòêðûòèå (Ctrl+O)/Ñîõðàíåíèå ôàéëà.</li>
<li>Ðåäàêòèðîâàíèå: Ïîâòîð/Îòìåíà äåéñòâèÿ (Ctrl+Z), Âûðåçàòü/Êîïèðîâàòü (Ctrl+C)/Âñòàâèòü (Ctrl+V), Ïîèñê (Ctrl+F, F3).</li>
<li>Îòêðûòèå (Ctrl+O), Ñîõðàíåíèå ôàéëà (Ctrl+S, Ctrl+Shift+S).</li>
<li>Ðåäàêòèðîâàíèå: Ïîâòîð/Îòìåíà äåéñòâèÿ (Ctrl+Z), Âûðåçàòü, Êîïèðîâàòü (Ctrl+C), Âñòàâèòü (Ctrl+V), Ïîèñê (Ctrl+F, F3), Çàìåíà (Ctrl+H), Ïåðåõîä íà ñòðîêó (Ctrl+G).</li>
<li>Âûäåëåíèå öâåòîì ñëîâ, çàäàííûõ â ôàéëå ñèíòàêñèñà. Âûâîä ñïðàâêè ïî íèì, åñëè îíà åñòü (íàæàòèåì F1 êîãäà êóðñîð íà ñëîâå).</li>
</ul>
 
284,6 → 285,14
call [ted_text_colored]
pop edi</pre>
 
<h4><a name="fun_go_to_position">ted_go_to_position</a></h4>
<p>Ôóíêöèÿ äëÿ ïåðåõîäà íà óêàçàííóþ ïîçèöèþ. Ïðèíèìàåò 3 ïàðàìåòðà:</p>
<p>1) ñòðóêòóðà tedit,</p>
<p>2) íîìåð ñòðîêè,</p>
<p>3) íîìåð ñèìâîëà.</p>
<p>Ïðèìåð èñïîëüçîâàíèÿ:</p>
<pre>stdcall [ted_go_to_position], tedit0,50,3</pre>
 
<h2>Âíóòðåííèå ôóíêöèè:</h2>
<p><b>ted_get_text_perv_pos</b> - ïåðåõîä íà ïðåäûäóùèé ñèìâîë â öåïè (÷åðåç óêàçàòåëü 'perv')</p>
<p><b>ted_get_text_next_pos</b> - ïåðåõîä íà ñëåäóþùèé ñèìâîë â öåïè (÷åðåç óêàçàòåëü 'next')</p>
373,22 → 382,20
.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 but_ctrl_o ;+198 óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ ïðè íàæàòèè Ctrl+O (îòêðûòèå ôàéëà)
.fun_on_key_ctrl_f dd 0 ;+202 ... Ctrl+F (âûçîâà/ñêðûòèÿ ïàíåëè ïîèñêà)
.fun_on_key_ctrl_n dd but_ctrl_n ;+206 ... Ctrl+N (ñîçäàíèå íîâîãî äîêóìåíòà)
.fun_on_key_ctrl_s dd 0 ;+210 ... Ctrl+S
.buffer_size dd BUF_SIZE ;+214 ðàçìåð áóôåðà êîïèðîâàíèÿ/âñòàâêè
.fun_find_err dd 0 ;+218 óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ åñëè ïîèñê çàêîí÷èëñÿ íåóäà÷íî
.fun_on_key_ctrl_all dd but_ctrl_all ;+198 óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ ïðè íàæàòèè Ctrl+N,O,S,F,H,G
dd 0,0,0 ;çàðåçåðâèðîâàíî
.buffer_size dd BUF_SIZE ;+214 ðàçìåð áóôåðà êîïèðîâàíèÿ/âñòàâêè
.fun_find_err dd 0 ;+218 óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ åñëè ïîèñê çàêîí÷èëñÿ íåóäà÷íî
.fun_init_synt_err dd 0 ;+222 óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ ïðè îøèáî÷íîì îòêðûòèè ôàéëà ñèíòàêñèñà
.fun_draw_panel_buttons dd 0 ;+226 óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ñ êíîïêàìè
.fun_draw_panel_find dd 0 ;+230 óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ïîèñêà
.fun_draw_panel_syntax dd 0 ;+234 óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ñèíòàêñèñà
.fun_save_err dd 0 ;+238 óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ åñëè ñîõðàíåíèå ôàéëà çàêîí÷èëîñü íåóäà÷íî
.fun_draw_panels dd 0 ;+230 óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ïîèñêà/çàìåíû/ïåðåõîäà/ñèíòàêñèñà
dd 0 ;çàðåçåðâèðîâàíî
.fun_save_err dd 0 ;+238 óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ åñëè ñîõðàíåíèå ôàéëà çàêîí÷èëîñü íåóäà÷íî
.increase_size dd 225 ;+242 ÷èñëî ñèìâîëîâ íà êîòîðûå áóäåò óâå÷èâàòüñÿ ïàìÿòü ïðè íåõâàòêå
.ptr_free_symb dd ? ;+246 óêàçàòåëü íà ñâîáîäíóþ ïàìÿòü, â êîòîðóþ ìîæíî äîáàâëÿòü ñèìâîë (èñïîëüçóåòñÿ âíóòðè ýëåìåíòà äëÿ óñêîðåíèÿ âñòàâêè òåêñòà)
.font_s dd ? ;+250 ñòèëè äëÿ øðèôòà (îò 0 äî 7 ìíîæèòåëü äëÿ ðàçìåðà, +16 äëÿ âòîðîãî ñèñòåìíîãî øðèôòà)</pre>
<hr>
<p>Äîêóìåíòàöèÿ îáíîâëÿëàñü ïîñëåäíèé ðàç 21.01.19.</p>
<p>Äîêóìåíòàöèÿ îáíîâëÿëàñü ïîñëåäíèé ðàç 29.01.19.</p>
 
</body>
</html>
/programs/develop/libraries/box_lib/trunk/t_edit.asm
1,6 → 1,6
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 21.10.2018 IgorA
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 29.01.2019 IgorA
; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï
 
;input:
20,12 → 20,6
add out_reg,ted_key_words_data
}
 
TED_PANEL_NULL equ 0 ;­¥â ®âªàë⮩ ¯ ­¥«¨
TED_PANEL_FIND equ 1 ;¯ ­¥«ì ¯®¨áª 
TED_PANEL_SYNTAX equ 2 ;¯ ­¥«ì ¢ë¡®à  ä ©«®¢ ¯®¤á¢¥âª¨
TED_PANEL_REPLACE equ 3 ;¯ ­¥«ì § ¬¥­ë
TED_PANEL_WIDTH equ 150 ;è¨à¨­  ¯ ­¥«¨
 
TED_LINES_IN_NEW_FILE equ 30 ;ç¨á«® áâப ¢ ­®¢®¬ ä ©«¥
MAX_COLOR_WORD_LEN equ 40
;------------------------------------------------------------------------------
241,38 → 235,44
test esi,KM_CTRL ;Ctrl+...
jz .key_Ctrl
; *** ¢ë§®¢ ¢­¥è­¨å ä㭪権 ª®â®àë¥ âॡãîâ ®ª­  ®âªàëâ¨ï/á®åà ­¥­¨ï/¯®¨áª /...
cmp ted_fun_on_key_ctrl_all,0
je .end0
xor al,al
cmp ah,24 ;Ctrl+O
jne @f
cmp ted_fun_on_key_ctrl_o,0
je .end_key_fun
call ted_fun_on_key_ctrl_o
mov al,'O'
@@:
cmp ah,31 ;Ctrl+S
jne .end_ctrl_s
cmp ted_fun_on_key_ctrl_s,0
je .end_key_fun
xor eax,eax
test esi,KM_SHIFT
jz @f
inc eax
@@:
call ted_fun_on_key_ctrl_s
jmp .end_key_fun
.end_ctrl_s:
jne @f
mov al,'S'
@@:
cmp ah,33 ;Ctrl+F
jne @f
cmp ted_panel_id,TED_PANEL_FIND
je @f
cmp ted_fun_on_key_ctrl_f,0
je .end_key_fun
call ted_fun_on_key_ctrl_f
mov al,'F'
@@:
cmp ah,34 ;Ctrl+G
jne @f
mov al,'G'
@@:
cmp ah,35 ;Ctrl+H
jne @f
mov al,'H'
@@:
cmp ah,49 ;Ctrl+N
jne @f
cmp ted_fun_on_key_ctrl_n,0
je .end_key_fun
call ted_fun_on_key_ctrl_n
mov al,'N'
@@:
or al,al
jz .end0
and eax,0xff
test esi,KM_SHIFT
jz @f
or eax,0x100
@@:
stdcall ted_fun_on_key_ctrl_all, eax
jmp .end_key_fun
.end0:
 
; *** ¢ë§®¢ ¢­ãâ७­¨å ä㭪権
cmp ah,30 ;Ctrl+A
jne @f
441,7 → 441,7
 
cmp dword[table],0
je @f
stdcall KeyConvertToASCII, dword[table]
stdcall KeyConvertToASCII, [table]
@@:
 
;mov ted_drag_k,0 ;§ ª ­ç¨¢ ¥¬ ¢ë¤¥«¥­¨¥ ®â ª« ¢¨ âãàë
1157,7 → 1157,7
jg .no_cur_mov
inc ted_cur_x ;move cursor
;call ted_go_to_pos
cmp byte [esi],13
cmp byte[esi],13
jne .no_cur_mov
mov ted_cur_x,0
inc ted_cur_y
1169,11 → 1169,11
; *** ¢áâ ¢ª  ⥪ã饣® ᨬ¢®«  ¨§ áâப¨ ***
mov ecx,ted_opt_ed_change_time
not ecx
and dword[add_opt],ecx ;n_tim=false;
and [add_opt],ecx ;n_tim=false;
 
mov cl,byte [esi] ;tex[i].c=ta[ns];
mov byte [edx],cl
m2m dword [edx+10],ted_tim_ch ;tex[i].tc=ted_tim_ch;
mov cl,byte[esi] ;tex[i].c=ta[ns];
mov byte[edx],cl
m2m dword[edx+10],ted_tim_ch ;tex[i].tc=ted_tim_ch;
mov [edx+2],eax ;tex[i].perv=po_t;
 
mov ecx,eax
1180,7 → 1180,7
imul ecx,sizeof.symbol
add ecx,ted_tex ; *** ecx = tex[po_t] ***
add ecx,6 ; *** ecx = tex[po_t].next ***
m2m dword [edx+6],dword [ecx] ;tex[i].next=tex[po_t].next;
m2m dword[edx+6],dword[ecx] ;tex[i].next=tex[po_t].next;
 
call ted_get_text_arr_index ;*** eax = i ***
mov [ecx],eax ;tex[po_t].next=i; // áá뫪¨ ¯¥à¥­ ¯à ¢«ï¥¬
1968,7 → 1968,7
call ted_iterat_next
cmp edx,ted_tex_1
jle @f
cmp byte [edx],13
cmp byte[edx],13
jne @b
inc eax
jmp @b
2046,7 → 2046,39
ret
endp
 
;description:
; ¯¥à¥å®¤ ­  㪠§ ­­ãî ¯®§¨æ¨î
;input:
; row = ­®¬¥à áâப¨
; col = ᨬ¢®«
align 16
proc ted_go_to_position uses ecx edx edi, edit:dword, row:dword, col:dword
mov edi,[edit]
; ¯®¤£®â®¢ª  áâப¨
mov edx,[row]
call ted_get_num_lines
cmp edx,eax
jle @f
mov edx,eax ;®£à ­¨ç¥­¨¥ ¯® áâப¥ max
@@:
dec edx
cmp edx,0
jge @f
xor edx,edx ;®£à ­¨ç¥­¨¥ ¯® áâப¥ min
@@:
; ¯®¤£®â®¢ª  ᨬ¢®« 
mov ecx,[col]
dec ecx
cmp ecx,0
jge @f
xor ecx,ecx
@@:
call ted_go_to_pos
stdcall ted_draw,edi
ret
endp
 
;input:
; ecx = Col
; edx = Row
; edi = pointer to tedit struct
3498,14 → 3530,10
inc bx
int 0x40
 
cmp ted_fun_draw_panel_find,0
cmp ted_fun_draw_panels,0
je @f
call ted_fun_draw_panel_find
stdcall ted_fun_draw_panels, edi
@@:
cmp ted_fun_draw_panel_syntax,0
je @f
call ted_fun_draw_panel_syntax
@@:
popad
ret
endp
3515,7 → 3543,6
align 16
proc ted_draw_main_cursor
pushad
 
mov eax,SF_DRAW_RECT ;draw cursor
mov ecx,ted_wnd_t ;calc rect -> y0,y1
add ecx,ted_rec_t
3811,8 → 3838,7
align 16
proc KeyConvertToASCII uses ebx, table:dword
mov ebx,[table] ;convert scan to ascii
ror ax,8
xor ah,ah
shr ax,8
add bx,ax ;? ebx,eax
mov ah,byte[ebx]
ret
/programs/network/ftpc/gui.inc
1025,16 → 1025,14
.mode_color db 1 ;+195
.mode_invis db 0 ;+196
.gp_opt db 0 ;+197
dd 0;.fun_on_key_ctrl_o dd but_ctrl_o ;+198
.fun_on_key_ctrl_f dd 0 ;+202 ... Ctrl+F
dd 0;.fun_on_key_ctrl_n dd but_ctrl_n ;+206 ... Ctrl+N
.fun_on_key_ctrl_s dd 0 ;+210 ... Ctrl+S
dd 0 ;.fun_on_key_ctrl_all dd but_ctrl_all ;+198
dd 0,0,0 ;reserved
.buffer_size dd 4096 ;+214
.fun_find_err dd 0 ;+218
.fun_init_synt_err dd 0 ;+222
.fun_draw_panel_buttons dd 0 ;+226
.fun_draw_panel_find dd 0 ;+230
.fun_draw_panel_syntax dd 0 ;+234
dd 0 ;+234 reserved
.fun_save_err dd 0 ;+238
.increase_size dd 1000 ;+242
.ptr_free_symb dd ? ;+246
1161,6 → 1159,8
ted_but_find, 'ted_but_find', \
ted_but_replace, 'ted_but_replace', \
ted_text_colored, 'ted_text_colored', \
ted_text_colored, 'ted_text_colored', \
ted_go_to_position, 'ted_go_to_position', \
progressbar_draw, 'progressbar_draw'
 
import libimg, \
/programs/other/t_edit/strlen.inc
89,4 → 89,77
stosb
mov byte[edi],0 ;в конец строки ставим 0, что-бы не вылазил мусор
@@:
ret
ret
 
;input:
; buf - указатель на строку, число должно быть в 10 или 16 ричном виде
;output:
; eax - число
align 4
proc conv_str_to_int, buf:dword
xor eax,eax
push ebx ecx esi
xor ebx,ebx
mov esi,[buf]
;определение отрицательных чисел
xor ecx,ecx
inc ecx
cmp byte[esi],'-'
jne @f
dec ecx
inc esi
@@:
 
cmp word[esi],'0x'
je .load_digit_16
 
.load_digit_10: ;считывание 10-тичных цифр
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'9'
jg @f
sub bl,'0'
imul eax,10
add eax,ebx
inc esi
jmp .load_digit_10
jmp @f
 
.load_digit_16: ;считывание 16-ричных цифр
add esi,2
.cycle_16:
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'f'
jg @f
cmp bl,'9'
jle .us1
cmp bl,'A'
jl @f ;отсеиваем символы >'9' и <'A'
.us1: ;составное условие
cmp bl,'F'
jle .us2
cmp bl,'a'
jl @f ;отсеиваем символы >'F' и <'a'
sub bl,32 ;переводим символы в верхний регистр, для упрощения их последущей обработки
.us2: ;составное условие
sub bl,'0'
cmp bl,9
jle .cor1
sub bl,7 ;convert 'A' to '10'
.cor1:
shl eax,4
add eax,ebx
inc esi
jmp .cycle_16
@@:
cmp ecx,0 ;если число отрицательное
jne @f
sub ecx,eax
mov eax,ecx
@@:
pop esi ecx ebx
ret
endp
/programs/other/t_edit/t_button.inc
137,7 → 137,7
@@:
cmp ah,ID_BUT_SYNTAX_MODE
jne @f
stdcall but_panel_choose_syntax, tedit0
call but_panel_choose_syntax
jmp still
@@:
cmp ah,ID_BUT_CONVERT_1251_866
172,10 → 172,15
jmp still
.no_change:
cmp ah,203 ;§ ¬¥­¨âì ¢á¥
jne .no_change_a
jne @f
call but_replace_all
jmp still
.no_change_a:
@@:
cmp ah,204 ;¯¥à¥©â¨ ­  áâபã
jne @f
call but_goto_line
jmp still
@@:
 
cmp ah,1
jne @f
258,6 → 263,13
ret
endp
 
align 4
proc but_goto_line uses eax
stdcall conv_str_to_int, buf_goto
stdcall [ted_go_to_position], tedit0,eax,1
ret
endp
 
;input:
; al = ª®¤ ®è¨¡ª¨
align 4
367,6 → 379,44
endp
 
;description:
; äã­ªæ¨ï ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,F,S,H,G
align 4
proc ted_but_ctrl_all uses eax, opt_key:dword
mov eax,[opt_key]
cmp al,'N' ;Ctrl+N
jne @f
call ted_but_new_file
jmp .end0
@@:
cmp al,'O' ;Ctrl+O
jne @f
call ted_but_open_file
jmp .end0
@@:
cmp al,'S' ;Ctrl+S
jne @f
shr eax,8
call ted_but_save_file
jmp .end0
@@:
cmp al,'F' ;Ctrl+F
jne @f
call but_panel_find
jmp .end0
@@:
cmp al,'G' ;Ctrl+G
jne @f
call but_panel_goto
jmp .end0
@@:
cmp al,'H' ;Ctrl+H
jne .end0
call but_panel_replace
.end0:
ret
endp
 
;description:
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
align 4
ted_but_open_file:
598,20 → 648,18
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
align 4
proc but_panel_find uses edi
mov edi,tedit0
proc but_panel_find
stdcall on_panel_change, tedit0,TED_PANEL_FIND
;or word[edit_find.flags],ed_focus
ret
endp
 
cmp ted_panel_id,TED_PANEL_NULL
je @f
mov ted_panel_id,TED_PANEL_NULL
mov ted_wnd_l,0
jmp .e_if
@@:
mov ted_panel_id,TED_PANEL_FIND
mov ted_wnd_l,TED_PANEL_WIDTH
.e_if:
call EvSize
stdcall [ted_draw],edi
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯¥à¥å®¤ 
align 4
proc but_panel_goto
stdcall on_panel_change, tedit0,TED_PANEL_GOTO
;or word[edit_goto.flags],ed_focus
ret
endp
 
618,20 → 666,9
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ § ¬¥­ë
align 4
proc but_panel_replace uses edi
mov edi,tedit0
 
cmp ted_panel_id,TED_PANEL_NULL
je @f
mov ted_panel_id,TED_PANEL_NULL
mov ted_wnd_l,0
jmp .e_if
@@:
mov ted_panel_id,TED_PANEL_REPLACE
mov ted_wnd_l,TED_PANEL_WIDTH
.e_if:
call EvSize
stdcall [ted_draw],edi
proc but_panel_replace
stdcall on_panel_change, tedit0,TED_PANEL_REPLACE
;or word[edit_find.flags],ed_focus
ret
endp
 
638,20 → 675,37
;description:
; ¢ë§®¢/áªàë⨥ ¯ ­¥«¨ á ä ©« ¬¨ ᨭ⠪á¨á 
align 4
proc but_panel_choose_syntax uses edi, edit:dword
proc but_panel_choose_syntax
stdcall on_panel_change, tedit0,TED_PANEL_SYNTAX
ret
endp
 
align 4
proc on_panel_change uses eax edi, edit:dword, new_id:dword
mov edi,[edit]
mov eax,[new_id]
 
cmp ted_panel_id,TED_PANEL_NULL
je @f
;if(panel_id==new_id) panel_id=0, draw all
cmp ted_panel_id,al
jne @f
mov ted_panel_id,TED_PANEL_NULL
mov ted_wnd_l,0
jmp .e_if
@@:
mov ted_panel_id,TED_PANEL_SYNTAX
;elseif(panel_id==0) panel_id=new_id, draw all
cmp ted_panel_id,TED_PANEL_NULL
jne @f
mov ted_panel_id,al
mov ted_wnd_l,TED_PANEL_WIDTH
.e_if:
call EvSize
stdcall [ted_draw],edi
jmp .end0
;else panel_id=new_id, draw panel
@@:
mov ted_panel_id,al
stdcall draw_panels,edi
.end0:
ret
endp
 
692,7 → 746,7
jne @f
pushad
mcall SF_CREATE_THREAD,1,prop_start,thread_coords
mov dword[wnd_k_words_run],eax
mov [wnd_k_words_run],eax
popad
@@:
ret
701,7 → 755,7
; ¢ë¤¥«¥­¨¥/áªàë⨥ ­¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
align 4
proc but_sumb_invis uses edi, edit:dword
mov edi,dword[edit]
mov edi,[edit]
 
xor ted_mode_invis,1
call draw_but_toolbar
713,7 → 767,7
; ¢ë¤¥«¥­¨¥/áªàë⨥ ª«î祢ëå á«®¢
align 4
proc but_use_syntax uses edi, edit:dword
mov edi,dword[edit]
mov edi,[edit]
 
xor ted_mode_color,1
cmp ted_mode_color,0
/programs/other/t_edit/t_data.inc
146,6 → 146,7
@@ -212,6 +213,7 @@
@@ -348,10 +350,11 @@
@@ -411,16 +414,14 @@
@@ -517,6 +518,8 @@
@@ -589,6 +592,8 @@
/programs/other/t_edit/t_draw.inc
216,10 → 216,9
;txtBRi db 26
;txtBLe db 27
 
;input:
; edi = pointer to tedit struct
align 4
proc draw_panel_find
proc draw_panels uses edi, edit:dword
mov edi,[edit]
cmp ted_panel_id,TED_PANEL_FIND
jne @f
call p_find
230,10 → 229,22
call p_replace
jmp .end_f
@@:
cmp ted_panel_id,TED_PANEL_GOTO
jne @f
call p_goto
jmp .end_f
@@:
cmp ted_panel_id,TED_PANEL_SYNTAX
jne @f
call p_syntax
jmp .end_f
@@:
push eax edx
mcall SF_DEFINE_BUTTON,,,0x80000000+201
mcall SF_DEFINE_BUTTON,,,0x80000000+200
mcall ,,,0x80000000+201
mcall ,,,0x80000000+202
mcall ,,,0x80000000+203
mcall ,,,0x80000000+204
pop edx eax
.end_f:
ret
256,7 → 267,7
sub cx,20+15-1 ; 15 - height text box
mcall ,,,[sc.work]
 
stdcall [edit_box_draw], edit2
stdcall [edit_box_draw], edit_find
 
mov ecx,ted_wnd_t
shl ecx,16
296,8 → 307,8
sub cx,20+15-1 ; 15 - height text box
mcall ,,,[sc.work]
 
stdcall [edit_box_draw], edit1
stdcall [edit_box_draw], edit2
stdcall [edit_box_draw], edit_replace
stdcall [edit_box_draw], edit_find
 
mov ecx,ted_wnd_t
shl ecx,16
327,12 → 338,48
pop edx ecx ebx eax
ret
 
align 4
p_goto:
push eax ebx ecx edx
mov ecx,ted_wnd_t
shl ecx,16
mov cx,20
mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
 
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 ,,,[sc.work]
 
stdcall [edit_box_draw], edit_goto
 
mov ecx,ted_wnd_t
shl ecx,16
add ecx,(40 shl 16)+20
mcall SF_DEFINE_BUTTON,(5 shl 16)+85,,204,[sc.work_button]
 
mov ebx,(23 shl 16)+7
add ebx,ted_wnd_t
mov ecx,[sc.work_text]
or ecx,0x80000000
mcall SF_DRAW_TEXT,,,txtGotoCapt
 
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mov ebx,(15 shl 16)+47
add ebx,ted_wnd_t
mcall ,,,txtGoto
pop edx ecx ebx eax
ret
 
;input:
; edi = pointer to tedit struct
align 4
proc draw_panel_syntax
cmp ted_panel_id,TED_PANEL_SYNTAX ;if not panel
jne @f
p_syntax:
pushad
 
mov ecx,ted_wnd_t
378,15 → 425,7
mcall ,,,txtFormatApply
 
popad
jmp .end_f
@@:
push eax edx
mov edx,0x80000000+200
mcall SF_DEFINE_BUTTON ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó
pop edx eax
.end_f:
ret
endp
 
MIN_M_WND_H equ 100 ;ìèíèìàëüíàÿ âûñîòà ãëàâíîãî îêíà
;input:
421,10 → 460,12
mov tl_box_top,eax ;=ted_wnd_t
add tl_box_top,20
 
mov [edit2.top],eax ;=ted_wnd_t
add dword[edit2.top],20
mov [edit1.top],eax ;=ted_wnd_t
add dword[edit1.top],113
mov [edit_find.top],eax ;=ted_wnd_t
add dword[edit_find.top],20
mov [edit_replace.top],eax
add dword[edit_replace.top],113
mov [edit_goto.top],eax
add dword[edit_goto.top],20
popad
ret
 
/programs/other/t_edit/t_edit.asm
241,13 → 241,13
;¯à®¢¥àª  ¡®ª®¢ëå ¯ ­¥«¥©
cmp byte[tedit0.panel_id],TED_PANEL_FIND
jne @f
stdcall [edit_box_mouse], edit2
stdcall [edit_box_mouse], edit_find
stdcall [option_box_mouse], opt_grlist1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_REPLACE
jne @f
stdcall [edit_box_mouse], edit2
stdcall [edit_box_mouse], edit1
stdcall [edit_box_mouse], edit_find
stdcall [edit_box_mouse], edit_replace
stdcall [option_box_mouse], opt_grlist1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX
254,6 → 254,10
jne @f
stdcall [tl_mouse], tree1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_GOTO
jne @f
stdcall [edit_box_mouse], edit_goto
@@:
ret
;---------------------------------------------------------------------
 
262,8 → 266,7
align 16
proc KeyConvertToASCII uses ebx, table:dword
mov ebx,dword[table] ;convert scan to ascii
ror ax,8
xor ah,ah
shr ax,8
add bx,ax
mov ah,byte[ebx]
ret
274,7 → 277,7
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
xor esi,esi
mov ecx,1
test al,0x03 ;[Shift]
test al,3 ;[Shift]
jz @f
mov cl,2
or esi,KM_SHIFT
297,7 → 300,7
mcall SF_GET_KEY
stdcall [tl_key], tree1
 
test word [edit1.flags],10b ;ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
test word[edit_replace.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
313,10 → 316,10
je still
 
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit1
stdcall [edit_box_key], edit_replace
jmp still
@@:
test word [edit2.flags],10b ;ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
test word[edit_find.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
332,16 → 335,36
je still
 
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit2
stdcall [edit_box_key], edit_find
jmp still
@@:
test word[edit_goto.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
 
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit_goto
jmp still
@@:
 
stdcall [ted_key], tedit0, conv_tabl,esi
jmp still
 
align 4
edit1 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
edit2 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
edit_replace edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
edit_find edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
edit_goto edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 10, buf_goto, mouse_dd, 0
 
unpac_mem dd 0
 
405,6 → 428,7
buf rb BUF_SIZE ;¡ãä¥à ¤«ï ª®¯¨à®¢ ­¨ï ¨ ¢áâ ¢ª¨
buf_find rb 302 ;¡ãä¥à ¤«ï ¯®¨áª  ⥪áâ 
buf_replace rb 302 ;¡ãä¥à ¤«ï § ¬¥­ë ⥪áâ 
buf_goto rb 12 ;¡ãä¥à ¤«ï ¯¥à室  ­  áâபã
sc system_colors
IncludeUGlobals
align 16
/programs/other/t_edit/t_edit.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/other/t_edit_synt/te_data.inc
130,6 → 130,7
sz_ted_but_reverse db 'ted_but_reverse',0
sz_ted_but_find db 'ted_but_find',0
sz_ted_text_colored db 'ted_text_colored',0
sz_ted_go_to_position db 'ted_go_to_position',0
 
sz_PathShow_prepare db 'PathShow_prepare',0
sz_PathShow_draw db 'PathShow_draw',0
223,16 → 224,14
.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 but_ctrl_o ;+198 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+O (®âªàë⨥ ä ©« )
.fun_on_key_ctrl_f dd 0 ;+202 ... Ctrl+F (¢ë§®¢ /áªàëâ¨ï ¯ ­¥«¨ ¯®¨áª )
.fun_on_key_ctrl_n dd but_ctrl_n ;+206 ... Ctrl+N (ᮧ¤ ­¨¥ ­®¢®£® ¤®ªã¬¥­â )
.fun_on_key_ctrl_s dd 0 ;+210 ... Ctrl+S
.fun_on_key_ctrl_all dd ted_but_ctrl_all ;+198 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,S,F,G,H
dd 0,0,0
.buffer_size dd BUF_SIZE ;+214 à §¬¥à ¡ãä¥à  ª®¯¨à®¢ ­¨ï/¢áâ ¢ª¨
.fun_find_err dd 0 ;+218 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ ¯®¨áª § ª®­ç¨«áï ­¥ã¤ ç­®
.fun_init_synt_err dd 0 ;+222 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¯à¨ ®è¨¡®ç­®¬ ®âªàë⨨ ä ©«  ᨭ⠪á¨á 
.fun_draw_panel_buttons dd 0 ;+226 㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ á ª­®¯ª ¬¨
.fun_draw_panel_find dd 0 ;+230 㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ¯®¨áª 
.fun_draw_panel_syntax dd 0 ;+234 㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ᨭ⠪á¨á 
.fun_draw_panels dd 0 ;+230 㪠§ â¥«ì ­  äã­ªæ¨î à¨á®¢ ­¨ï ¯ ­¥«¨ ¯®¨áª |...|ᨭ⠪á¨á 
dd 0
.fun_save_err dd 0 ;+238 㪠§ â¥«ì ­  äã­ªæ¨î ¢ë§ë¢ ¥¬ãî ¥á«¨ á®åà ­¥­¨¥ ä ©«  § ª®­ç¨«®áì ­¥ã¤ ç­®
.increase_size dd 1000 ;+242 ç¨á«® ᨬ¢®«®¢ ­  ª®â®àë¥ ¡ã¤¥â 㢥稢 âìáï ¯ ¬ïâì ¯à¨ ­¥å¢ âª¥
.ptr_free_symb dd ? ;+246 㪠§ â¥«ì ­  ᢮¡®¤­ãî ¯ ¬ïâì, ¢ ª®â®àãî ¬®¦­® ¤®¡ ¢«ïâì ᨬ¢®« (¨á¯®«ì§ã¥âáï ¢­ãâà¨ í«¥¬¥­â  ¤«ï ã᪮७¨ï ¢áâ ¢ª¨ ⥪áâ )
/programs/other/t_edit_synt/te_syntax.asm
198,8 → 198,7
proc KeyConvertToASCII, table:dword
push ebx
mov ebx,dword[table] ;convert scan to ascii
ror ax,8
xor ah,ah
shr ax,8
add bx,ax
mov ah,byte[ebx]
pop ebx
294,7 → 293,29
stdcall [ted_save_file], tedit0,run_file_70,[edit1.text]
ret
 
;description:
; äã­ªæ¨ï ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,F,S,H,G
align 4
proc ted_but_ctrl_all uses eax, opt_key:dword
mov eax,[opt_key]
cmp al,'N' ;Ctrl+N
jne @f
call but_ctrl_n
jmp .end0
@@:
cmp al,'O' ;Ctrl+O
jne @f
call but_ctrl_o
@@:
;cmp al,'S' ;Ctrl+S
;cmp al,'F' ;Ctrl+F
;cmp al,'G' ;Ctrl+G
;cmp al,'H' ;Ctrl+H
.end0:
ret
endp
 
align 4
but_ctrl_o:
push eax
call get_wnd_in_focus
332,7 → 353,7
;@@:
ret
 
hed db 'TextEditor syntax file converter 23.01.19',0 ;¯®¤¯¨áì ®ª­ 
hed db 'TextEditor syntax file converter 29.01.19',0 ;¯®¤¯¨áì ®ª­ 
conv_tabl rb 128 ; â ¡«¨æ  ¤«ï ª®­¢¥àâ¨à®¢ ­¨ï scan-ª®¤  ¢ ascii-ª®¤
 
txt_load_f db '‡ £à. ä ©«',0