forked from KolibriOS/kolibrios
't_edit' add commands [Ctrl]+[End], [Ctrl]+[A]
'msgbox' change select button use [Tab] key git-svn-id: svn://kolibrios.org@4988 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
bb0466488a
commit
0bcb04f0e3
@ -1,6 +1,6 @@
|
||||
; ¬ ªà®á ¤«ï á¨á⥬®© ¡¨¡«¨®â¥ª¨ box_lib.obj
|
||||
; í«¥¬¥â TextEditor ¤«ï Kolibri OS
|
||||
; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 27.06.2014 IgorA
|
||||
; ä ©« ¯®á«¥¤¨© à § ¨§¬¥ï«áï 28.06.2014 IgorA
|
||||
; ª®¤ ¯à¨¬¥¥ GPL2 «¨æ¥§¨ï
|
||||
|
||||
;input:
|
||||
@ -27,6 +27,7 @@ TED_PANEL_FIND equ 1 ;
|
||||
TED_PANEL_SYNTAX equ 2 ;¯ ¥«ì ¢ë¡®à ä ©«®¢ ¯®¤á¢¥âª¨
|
||||
TED_PANEL_WIDTH equ 150 ;è¨à¨ ¯ ¥«¨
|
||||
|
||||
TED_LINES_IN_NEW_FILE equ 30 ;ç¨á«® áâப ¢ ®¢®¬ ä ©«¥
|
||||
MAX_COLOR_WORD_LEN equ 40
|
||||
;------------------------------------------------------------------------------
|
||||
struct TexSelect
|
||||
@ -159,9 +160,9 @@ proc ted_init_scroll_bars, edit:dword, opt:dword
|
||||
bt dword[opt],2 ; ¨§¬¥¨«¨áì à §¬¥àë ¤®ªã¬¥â ?
|
||||
jae .doc_resize
|
||||
call ted_get_num_lines
|
||||
cmp eax,100
|
||||
cmp eax,TED_LINES_IN_NEW_FILE
|
||||
jge @f
|
||||
mov eax,100
|
||||
mov eax,TED_LINES_IN_NEW_FILE
|
||||
@@:
|
||||
mov dword[esi+sb_offs_max_area],eax
|
||||
.doc_resize:
|
||||
@ -243,6 +244,7 @@ proc ted_key, edit:dword, table:dword, control:dword
|
||||
|
||||
test esi,KM_CTRL ;Ctrl+...
|
||||
jz .key_Ctrl
|
||||
; *** ¢ë§®¢ ¢¥è¨å äãªæ¨© ª®â®àë¥ âॡãîâ ®ª ®âªàëâ¨ï/á®åà ¥¨ï/¯®¨áª /...
|
||||
cmp ah,24 ;Ctrl+O
|
||||
jne @f
|
||||
cmp ted_fun_on_key_ctrl_o,0
|
||||
@ -263,6 +265,17 @@ proc ted_key, edit:dword, table:dword, control:dword
|
||||
je @f
|
||||
call ted_fun_on_key_ctrl_f
|
||||
@@:
|
||||
cmp ah,49 ;Ctrl+N
|
||||
jne @f
|
||||
cmp ted_fun_on_key_ctrl_n,0
|
||||
je @f
|
||||
call ted_fun_on_key_ctrl_n
|
||||
@@:
|
||||
; *** ¢ë§®¢ ¢ãâ२å äãªæ¨©
|
||||
cmp ah,30 ;Ctrl+A
|
||||
jne @f
|
||||
call ted_sel_all
|
||||
@@:
|
||||
cmp ah,44 ;Ctrl+Z
|
||||
jne @f
|
||||
stdcall ted_but_undo,edi
|
||||
@ -275,16 +288,14 @@ proc ted_key, edit:dword, table:dword, control:dword
|
||||
jne @f
|
||||
stdcall ted_but_paste,edi
|
||||
@@:
|
||||
cmp ah,49 ;Ctrl+N
|
||||
jne @f
|
||||
cmp ted_fun_on_key_ctrl_n,0
|
||||
je @f
|
||||
call ted_fun_on_key_ctrl_n
|
||||
@@:
|
||||
cmp ah,199 ;Ctrl+Home
|
||||
jne @f
|
||||
call ted_key_ctrl_home
|
||||
@@:
|
||||
cmp ah,207 ;Ctrl+End
|
||||
jne @f
|
||||
call ted_key_ctrl_end
|
||||
@@:
|
||||
jmp .end_key_fun
|
||||
.key_Ctrl:
|
||||
|
||||
@ -645,6 +656,29 @@ proc ted_sel_move
|
||||
ret
|
||||
endp
|
||||
|
||||
;input:
|
||||
; edi = pointer to tedit struct
|
||||
;description:
|
||||
; ”ãªæ¨ï ¢ë§ë¢ ¥¬ ï ¯à¨ ¢ë¤¥«¥¨¨ ¢á¥£® ¤®ªã¬¥â
|
||||
align 4
|
||||
proc ted_sel_all
|
||||
push eax
|
||||
xor eax,eax
|
||||
mov ted_sel_x0,eax
|
||||
mov ted_sel_y0,eax
|
||||
|
||||
mov ted_sel_x1,eax ;???
|
||||
call ted_get_num_lines
|
||||
mov ted_sel_y1,eax
|
||||
pop eax
|
||||
stdcall ted_draw,edi
|
||||
cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy)
|
||||
je @f
|
||||
call ted_fun_draw_panel_buttons
|
||||
@@:
|
||||
ret
|
||||
endp
|
||||
|
||||
;input:
|
||||
; cl_al_mem = 1 - clear all memory
|
||||
align 4
|
||||
@ -851,9 +885,9 @@ proc ted_on_open_file
|
||||
@@:
|
||||
|
||||
call ted_get_num_lines
|
||||
cmp eax,100
|
||||
cmp eax,TED_LINES_IN_NEW_FILE
|
||||
jge @f
|
||||
mov eax,100
|
||||
mov eax,TED_LINES_IN_NEW_FILE
|
||||
@@:
|
||||
mov esi,ted_scr_w
|
||||
mov dword[esi+sb_offs_max_area],eax
|
||||
@ -1011,7 +1045,6 @@ ted_iterat_next_color_tag:
|
||||
jle @f
|
||||
jmp @b
|
||||
@@:
|
||||
;call ted_iterat_next
|
||||
ret
|
||||
|
||||
;input:
|
||||
@ -2848,6 +2881,30 @@ ted_key_ctrl_home:
|
||||
@@:
|
||||
ret
|
||||
|
||||
;input:
|
||||
; edi = pointer to tedit struct
|
||||
align 4
|
||||
ted_key_ctrl_end:
|
||||
push eax ebx
|
||||
call ted_get_num_lines
|
||||
mov ebx,ted_scr_w
|
||||
mov dword[ebx+sb_offs_position],eax ;áâ ¢¨¬ ¯®«§ã®ª ¯®á«¥¤îî áâப㠤®ªã¬¥â
|
||||
cmp eax,dword[ebx+sb_offs_cur_area]
|
||||
jle @f
|
||||
mov eax,dword[ebx+sb_offs_cur_area] ;¯®«ãç ¥¬ ç¨á«® áâப ¢« §ïé¨å ¢ ®ª®
|
||||
@@:
|
||||
sub dword[ebx+sb_offs_position],eax ;®â¨¬ ¥¬ ®â ¯®«§ãª ç¨á«® áâப ¢« §ïé¨å ¢ ®ª® (® ¥ ¡®«ìè¥ â¥å, çâ® ¥áâì ¢ ¤®ªã¬¥â¥)
|
||||
dec eax
|
||||
mov ted_cur_y,eax ;áâ ¢¨¬ ªãàá®à ¯®á«¥¤îî áâப㠤®ªã¬¥â
|
||||
pop ebx eax
|
||||
call ted_cur_move_x_last_char
|
||||
stdcall ted_draw,edi
|
||||
cmp ted_fun_draw_panel_buttons,0
|
||||
je @f
|
||||
call ted_fun_draw_panel_buttons
|
||||
@@:
|
||||
ret
|
||||
|
||||
;input:
|
||||
; edi = pointer to tedit struct
|
||||
align 4
|
||||
@ -3181,6 +3238,7 @@ proc ted_draw, edit:dword
|
||||
jmp @b
|
||||
.no_draw_text:
|
||||
|
||||
inc dword[line_num]
|
||||
stdcall ted_clear_line_before_draw,edi,ebx,0,dword[line_num]
|
||||
call ted_draw_line_numbers
|
||||
call ted_draw_main_cursor
|
||||
@ -3676,7 +3734,6 @@ proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_l
|
||||
cmp dword[clear_o],0
|
||||
jne @f
|
||||
add ebx,ted_rec_h
|
||||
inc esi
|
||||
ror ebx,16
|
||||
xor bx,bx
|
||||
add ebx,ted_wnd_l
|
||||
@ -3706,20 +3763,21 @@ proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_l
|
||||
jge @f
|
||||
.pusto:
|
||||
mov cx,ax
|
||||
jmp .no_select ;¥á«¨ ®ç¨á⪠®ª ¤® ¨§ã, â® ¢á¥£¤ ä®®¢ë¬ 梥⮬
|
||||
@@:
|
||||
|
||||
call ted_is_select
|
||||
cmp al,0
|
||||
je @f
|
||||
je .no_select
|
||||
cmp ted_seln_y0,esi
|
||||
jg @f
|
||||
jg .no_select
|
||||
cmp ted_seln_y1,esi
|
||||
jl @f
|
||||
jl .no_select
|
||||
mov edx,ted_color_select ;draw selected line
|
||||
@@:
|
||||
.no_select:
|
||||
|
||||
mov eax,13 ;rect
|
||||
int 0x40
|
||||
int 0x40 ;§ ªà ᪠¯®«®© áâப¨ 梥⮬ ä® ¨«¨ 梥⮬ ¢ë¤¥«¥¨ï
|
||||
|
||||
call ted_is_select
|
||||
cmp al,0
|
||||
@ -3748,7 +3806,8 @@ proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_l
|
||||
@@:
|
||||
cmp ted_seln_y1,esi
|
||||
jne @f
|
||||
push esi
|
||||
;push esi
|
||||
;¥á«¨ ¢ë¤¥«¥ ¢¥áì ä ©« âãâ ¬®¦® ᤥ« âì ¢ë室, ® ⮣¤ 㦮 ¢ëè¥ ã¡à âì jmp .no_select
|
||||
mov edx,ted_seln_x1 ; ¨¦ïï ¯®«®á (§ â¨à ¥â á¯à ¢ )
|
||||
mov esi,ted_scr_h
|
||||
cmp edx,dword[esi+sb_offs_position]
|
||||
@ -3759,10 +3818,9 @@ proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_l
|
||||
shl edx,16
|
||||
add ebx,edx
|
||||
.in_wnd2:
|
||||
|
||||
mov edx,ted_color_wnd_work
|
||||
int 0x40
|
||||
pop esi
|
||||
;pop esi
|
||||
@@:
|
||||
|
||||
.no_clear:
|
||||
|
@ -132,8 +132,12 @@ key:
|
||||
call MsgBoxDrawAllBut
|
||||
.no_left:
|
||||
|
||||
cmp ah,9 ;Tab
|
||||
je @f
|
||||
cmp ah,179 ;Right
|
||||
jne .no_right
|
||||
je @f
|
||||
jmp .no_right
|
||||
@@:
|
||||
mov al,[mb_key_max]
|
||||
add al,MB_FIRST_BUT_ID
|
||||
cmp [mb_key_foc],al
|
||||
|
Loading…
Reference in New Issue
Block a user