Tinypad: integer zoom feature

git-svn-id: svn://kolibrios.org@5838 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2015-10-11 12:17:37 +00:00
parent 466bcbef1e
commit ffaece082b
8 changed files with 407 additions and 368 deletions

View File

@ -37,3 +37,5 @@ define mm.Options.AutoIndents set_opt.auto_indents
define mm.Options.SmartTabs 0 define mm.Options.SmartTabs 0
define mm.Options.OptimalFill set_opt.optimal_fill define mm.Options.OptimalFill set_opt.optimal_fill
define mm.Options.LineNumbers set_opt.line_numbers define mm.Options.LineNumbers set_opt.line_numbers
define mm.Options.ZoomIn key.ctrl_plus
define mm.Options.ZoomOut key.ctrl_minus

View File

@ -2,10 +2,11 @@
vscrl_capt dd -1 vscrl_capt dd -1
hscrl_capt dd -1 hscrl_capt dd -1
body_capt dd -1 body_capt dd -1
ins_mode db 1
s_status dd 0 s_status dd 0
lineHeight dd LINEH
charWidth dd 6
scale db 0
ins_mode db 1
sz app_fasm ,'/rd/1/develop/fasm',0 sz app_fasm ,'/rd/1/develop/fasm',0
sz app_board ,'/rd/1/develop/board',0 sz app_board ,'/rd/1/develop/board',0

View File

@ -161,45 +161,53 @@ popup_res mm.Encoding,\
@!,<'KOI8-R ',0x1A,' CP1251'>,'',KOI8R.CP1251 @!,<'KOI8-R ',0x1A,' CP1251'>,'',KOI8R.CP1251
popup_res mm.Options,\ popup_res mm.Options,\
ru,'く・隴ィゥ 「ィ、...' ,'',Appearance ,\ ru,'討・ォィ遞粮' ,'Ctrl +',ZoomIn ,\
ru,'闘・ュ<EFBDA5>ィ粮' ,'Ctrl -',ZoomOut ,\
ru,'-','',,\ ru,'-','',,\
ru,'紺ャ・燿 矮牋ェ' ,'',LineNumbers ,\
ru,'<27>¥§®¯ á­®¥ ¢ë¤¥«¥­¨¥' ,'',SecureSel ,\ ru,'<27>¥§®¯ á­®¥ ¢ë¤¥«¥­¨¥' ,'',SecureSel ,\
ru,'€¢â®¬ â¨ç¥áª¨¥ ᪮¡ª¨' ,'',AutoBrackets,\ ru,'€¢â®¬ â¨ç¥áª¨¥ ᪮¡ª¨' ,'',AutoBrackets,\
ru,'€¢â®¬ â¨ç¥áª¨© ®âáâã¯' ,'',AutoIndents ,\ ru,'€¢â®¬ â¨ç¥áª¨© ®âáâã¯' ,'',AutoIndents ,\
ru,'“¬­ ï â ¡ã«ïæ¨ï' ,'',SmartTabs ,\ ru,'“¬­ ï â ¡ã«ïæ¨ï' ,'',SmartTabs ,\
ru,'Ž¯â¨¬ «ì­®¥ á®åà ­¥­¨¥' ,'',OptimalFill ,\ ru,'Ž¯â¨¬ «ì­®¥ á®åà ­¥­¨¥' ,'',OptimalFill ,\
ru,'-','',,\ ru,'-','',,\
ru,'紺ャ・燿 矮牋ェ' ,'',LineNumbers ,\ ru,'く・隴ィゥ 「ィ、...' ,'',Appearance ,\
\ \
en,'Appearance...' ,'',Appearance ,\ en,'Zoom in' ,'Ctrl +',ZoomIn ,\
en,'Zoom out' ,'Ctrl -',ZoomOut ,\
en,'-','',,\ en,'-','',,\
en,'Line numbers' ,'',LineNumbers ,\
en,'Secure selection' ,'',SecureSel ,\ en,'Secure selection' ,'',SecureSel ,\
en,'Automatic brackets' ,'',AutoBrackets,\ en,'Automatic brackets' ,'',AutoBrackets,\
en,'Automatic indents' ,'',AutoIndents ,\ en,'Automatic indents' ,'',AutoIndents ,\
en,'Smart tabulation' ,'',SmartTabs ,\ en,'Smart tabulation' ,'',SmartTabs ,\
en,'Optimal fill on saving' ,'',OptimalFill ,\ en,'Optimal fill on saving' ,'',OptimalFill ,\
en,'-','',,\ en,'-','',,\
en,'Line numbers' ,'',LineNumbers ,\ en,'Appearance...' ,'',Appearance ,\
\ \
et,'V舁imus...' ,'',Appearance ,\ et,'Zoom in' ,'Ctrl +',ZoomIn ,\
et,'Zoom out' ,'Ctrl -',ZoomOut ,\
et,'-','',,\ et,'-','',,\
et,'Rea numbrid' ,'',LineNumbers ,\
et,'Turvaline valimine' ,'',SecureSel ,\ et,'Turvaline valimine' ,'',SecureSel ,\
et,'Automaatsed sulud' ,'',AutoBrackets,\ et,'Automaatsed sulud' ,'',AutoBrackets,\
et,'Automaatsed taandread' ,'',AutoIndents ,\ et,'Automaatsed taandread' ,'',AutoIndents ,\
et,'Tark tabulatsioon' ,'',SmartTabs ,\ et,'Tark tabulatsioon' ,'',SmartTabs ,\
et,'Optimaalne täitmine salvestamisel','',OptimalFill,\ et,'Optimaalne täitmine salvestamisel','',OptimalFill,\
et,'-','',,\ et,'-','',,\
et,'Rea numbrid' ,'',LineNumbers ,\ et,'V舁imus...' ,'',Appearance ,\
\ \
sp,'Apariencia...' ,'',Appearance ,\ sp,'Zoom in' ,'Ctrl +',ZoomIn ,\
sp,'Zoom out' ,'Ctrl -',ZoomOut ,\
sp,'-','',,\ sp,'-','',,\
sp,'N伹eros en l匤eas' ,'',LineNumbers ,\
sp,'Selección segura' ,'',SecureSel ,\ sp,'Selección segura' ,'',SecureSel ,\
sp,'Paréntesis automáticos' ,'',AutoBrackets,\ sp,'Paréntesis automáticos' ,'',AutoBrackets,\
sp,'Identación automática' ,'',AutoIndents ,\ sp,'Identación automática' ,'',AutoIndents ,\
sp,'Tabulación inteligente' ,'',SmartTabs ,\ sp,'Tabulación inteligente' ,'',SmartTabs ,\
sp,'Llenado óptimo al guardar','',OptimalFill ,\ sp,'Llenado óptimo al guardar','',OptimalFill ,\
sp,'-','',,\ sp,'-','',,\
sp,'N伹eros en l匤eas' ,'',LineNumbers sp,'Apariencia...' ,'',Appearance
lsz s_defname,\ lsz s_defname,\
en,<'Untitled',0>,\ en,<'Untitled',0>,\

View File

@ -83,6 +83,8 @@ accel_table_main dd \
0x00010150,key.shift_down ,\ ; Shift+Down 0x00010150,key.shift_down ,\ ; Shift+Down
0x00010151,key.shift_pgdn ,\ ; Shift+PageDown 0x00010151,key.shift_pgdn ,\ ; Shift+PageDown
0x00010153,key.del ,\ ; Shift+Delete 0x00010153,key.del ,\ ; Shift+Delete
0x0002000C,key.ctrl_minus ,\ ; Ctrl+Minus
0x0002000D,key.ctrl_plus ,\ ; Ctrl+Plus
0x0002000F,key.ctrl_tab ,\ ; Ctrl+Tab 0x0002000F,key.ctrl_tab ,\ ; Ctrl+Tab
0x00020015,key.ctrl_y ,\ ; Ctrl+Y 0x00020015,key.ctrl_y ,\ ; Ctrl+Y
0x00020018,key.ctrl_o ,\ ; Ctrl+O 0x00020018,key.ctrl_o ,\ ; Ctrl+O
@ -108,6 +110,7 @@ accel_table_main dd \
\;0x00020150,key.ctrl_down ,\ ; Ctrl+Down \;0x00020150,key.ctrl_down ,\ ; Ctrl+Down
0x00020151,key.ctrl_pgdn ,\ ; Ctrl+PageDown 0x00020151,key.ctrl_pgdn ,\ ; Ctrl+PageDown
0x00020153,key.del ,\ ; Ctrl+Del 0x00020153,key.del ,\ ; Ctrl+Del
0x0003000D,key.ctrl_plus ,\ ; Ctrl+Plus
0x0003000F,key.shift_ctrl_tab ,\ ; Shift+Ctrl+Tab 0x0003000F,key.shift_ctrl_tab ,\ ; Shift+Ctrl+Tab
0x0003001F,key.shift_ctrl_s ,\ ; Shift+Ctrl+S 0x0003001F,key.shift_ctrl_s ,\ ; Shift+Ctrl+S
0x00030147,key.shift_ctrl_home ,\ ; Shift+Ctrl+Home 0x00030147,key.shift_ctrl_home ,\ ; Shift+Ctrl+Home

View File

@ -38,7 +38,8 @@ proc drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
cld cld
rep movsd rep movsd
cmp [p_info.client_box.height],LINEH mov eax,[lineHeight]
cmp [p_info.client_box.height],eax
jl .exit.2 jl .exit.2
mov [tab_bar.Bounds.Left],0 mov [tab_bar.Bounds.Left],0
@ -61,21 +62,6 @@ proc drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
call draw_bottom_dialog call draw_bottom_dialog
; mov [do_not_draw],1 ; do_not_draw = true
; mov ebx,eax
; sub ebx,[top_ofs]
; sub ebx,SCRLW*3+AMINS+5
; js .no_draw
; dec [do_not_draw] ; do_not_draw = false
; sub eax,SCRLW+3
; sub eax,[top_ofs]
; cdq
; mov ebx,LINEH
; div ebx
; mov [lines.scr],eax
inc [top_ofs] inc [top_ofs]
call draw_main_menu call draw_main_menu
@ -91,7 +77,7 @@ proc drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
push eax push eax
add eax,-2-SCRLW add eax,-2-SCRLW
cdq cdq
mov ebx,LINEH mov ebx,[lineHeight]
idiv ebx idiv ebx
mov [lines.scr],eax mov [lines.scr],eax
pop eax pop eax
@ -104,13 +90,13 @@ proc drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
dec eax dec eax
cdq cdq
mov ebx,LINEH mov ebx,[lineHeight]
idiv ebx idiv ebx
mov [lines.scr],eax mov [lines.scr],eax
mov eax,[p_info.client_box.width] mov eax,[p_info.client_box.width]
cdq cdq
mov ebx,6 mov ebx,[charWidth]
idiv ebx idiv ebx
mov [columns.scr],eax mov [columns.scr],eax
@@: @@:

View File

@ -29,7 +29,7 @@ proc draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
cmp eax,3 cmp eax,3
jae @f jae @f
mov eax,3 mov eax,3
@@: imul eax,6 @@: imul eax,[charWidth]
add eax,8 add eax,8
.lp1: mov [cur_editor.Gutter.Width],eax .lp1: mov [cur_editor.Gutter.Width],eax
mov [left_ofs],eax mov [left_ofs],eax
@ -40,7 +40,7 @@ proc draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
sub eax,SCRLW+LCHGW+4 sub eax,SCRLW+LCHGW+4
js .exit js .exit
cdq cdq
mov ebx,6 mov ebx,[charWidth]
div ebx div ebx
mov [columns.scr],eax mov [columns.scr],eax
@ -50,7 +50,7 @@ proc draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
sub eax,SCRLW+3 sub eax,SCRLW+3
js .exit js .exit
cdq cdq
mov ebx,LINEH mov ebx,[lineHeight]
div ebx div ebx
mov [lines.scr],eax mov [lines.scr],eax
@ -106,11 +106,16 @@ proc draw_editor_gutter ;///// DRAW EDITOR GUTTER (LEFT PANEL) ///////////////
mov esi,edi mov esi,edi
pop edi edx eax pop edi edx eax
sub esi,edx sub esi,edx
imul eax,esi,6*65536 mov eax,esi
imul eax,[charWidth]
shl eax,16
sub ebx,eax sub ebx,eax
mcall 4,,edi mov cl, [scale]
shl ecx,24
or ecx,edi
mcall 4
popad popad
add ebx,LINEH add ebx,[lineHeight]
inc ecx inc ecx
cmp ecx,[cur_editor.Lines.Count] cmp ecx,[cur_editor.Lines.Count]
jg @f jg @f
@ -353,7 +358,7 @@ proc draw_editor_text.part ;///// DRAW EDITOR TEXT (PARTLY) //////////////////
@@: push eax @@: push eax
mov eax,[cur_editor.Bounds.Bottom] mov eax,[cur_editor.Bounds.Bottom]
sub eax,[cur_editor.Bounds.Top] sub eax,[cur_editor.Bounds.Top]
cmp eax,LINEH cmp eax,[lineHeight]
pop eax pop eax
jge @f jge @f
ret ret
@ -404,7 +409,7 @@ proc draw_editor_text.part ;///// DRAW EDITOR TEXT (PARTLY) //////////////////
mov ebx,[top_ofs] mov ebx,[top_ofs]
add ebx,[left_ofs-2] add ebx,[left_ofs-2]
sub eax,[cur_editor.TopLeft.Y] sub eax,[cur_editor.TopLeft.Y]
imul eax,LINEH imul eax,[lineHeight]
add ebx,eax add ebx,eax
imul ebp,[cur_editor.TopLeft.X],6*65536 imul ebp,[cur_editor.TopLeft.X],6*65536
@ -425,7 +430,7 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
ret ret
@@: mov eax,[cur_editor.Bounds.Bottom] @@: mov eax,[cur_editor.Bounds.Bottom]
sub eax,[cur_editor.Bounds.Top] sub eax,[cur_editor.Bounds.Top]
cmp eax,LINEH cmp eax,[lineHeight]
jge @f jge @f
ret ret
@@: @@:
@ -466,7 +471,7 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
mov ecx,ebx mov ecx,ebx
shl ecx,16 shl ecx,16
mov cl,LINEH mov cl,byte[lineHeight]
mov ebx,[cur_editor.Bounds.Right] mov ebx,[cur_editor.Bounds.Right]
add ebx,-SCRLW add ebx,-SCRLW
add ebx,[left_ofs-2] add ebx,[left_ofs-2]
@ -492,7 +497,7 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
jle .lp6.2 jle .lp6.2
cmp eax,[columns.scr] cmp eax,[columns.scr]
jge .lp6 jge .lp6
imul eax,6 imul eax,[charWidth]
pushad pushad
sub bx,ax sub bx,ax
rol ebx,16 rol ebx,16
@ -514,7 +519,7 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
jle .lp6 jle .lp6
cmp eax,[columns.scr] cmp eax,[columns.scr]
jg .lp6.2 jg .lp6.2
imul eax,6 imul eax,[charWidth]
pushad pushad
sub bx,ax sub bx,ax
rol ebx,16 rol ebx,16
@ -539,11 +544,11 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
cmp eax,[sel.end.x] cmp eax,[sel.end.x]
je .lp6 je .lp6
sub eax,[cur_editor.TopLeft.X] sub eax,[cur_editor.TopLeft.X]
imul eax,6 imul eax,[charWidth]
pushad pushad
mov ebx,[sel.end.x] mov ebx,[sel.end.x]
sub ebx,[sel.begin.x] sub ebx,[sel.begin.x]
imul ebx,6 imul ebx,[charWidth]
sal ebx,16 sal ebx,16
dec eax dec eax
add eax,[left_ofs] add eax,[left_ofs]
@ -607,7 +612,9 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
pop ebx pop ebx
push ecx push ecx
mov ecx,eax mov cl, [scale]
shl ecx,24
or ecx,eax
push esi ebx push esi ebx
mov eax,ebx mov eax,ebx
@ -624,7 +631,8 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
xor eax,eax xor eax,eax
jmp .qqq2 jmp .qqq2
.qqq: .qqq:
imul eax,6*65536 imul eax,[charWidth]
shl eax,16
.qqq2: .qqq2:
and ebx,0x0000FFFF and ebx,0x0000FFFF
add eax,[left_ofs-2] add eax,[left_ofs-2]
@ -663,12 +671,14 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
sub [esp+4],ecx sub [esp+4],ecx
@@: sub eax,esi @@: sub eax,esi
add edx,esi add edx,esi
imul esi,6 imul esi,[charWidth]
rol ebx,16 rol ebx,16
add bx,si add bx,si
rol ebx,16 rol ebx,16
mov esi,eax mov esi,eax
mov ecx,[color_tbl.text.sel] mov cl, [scale]
shl ecx,24
or ecx,[color_tbl.text.sel]
mcall 4 mcall 4
popad popad
jmp .draw_t jmp .draw_t
@ -693,12 +703,15 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
pop ebx pop ebx
pushad pushad
mov esi,eax mov esi,eax
mov ecx,[color_tbl.text.sel] mov cl, [scale]
shl ecx,24
or ecx,[color_tbl.text.sel]
mcall 4 mcall 4
popad popad
sub esi,eax sub esi,eax
add edx,eax add edx,eax
imul eax,6*65536 imul eax,[charWidth]
shl eax,16
add ebx,eax add ebx,eax
jmp .draw_t jmp .draw_t
;----------------------------------------------)- ;----------------------------------------------)-
@ -726,16 +739,20 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
sub eax,esi sub eax,esi
pushad pushad
add edx,esi add edx,esi
imul esi,6*65536 imul esi,[charWidth]
shl esi,16
add ebx,esi add ebx,esi
mov esi,[sel.end.x] mov esi,[sel.end.x]
sub esi,[sel.begin.x] sub esi,[sel.begin.x]
mov ecx,[color_tbl.text.sel] mov cl, [scale]
shl ecx,24
or ecx,[color_tbl.text.sel]
sub eax,esi sub eax,esi
push eax push eax
mcall 4 mcall 4
add edx,esi add edx,esi
imul esi,6*65536 imul esi,[charWidth]
shl esi,16
add ebx,esi add ebx,esi
pop esi pop esi
mov ecx,[esp+4*6] mov ecx,[esp+4*6]
@ -748,14 +765,16 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
cmp eax,[sel.end.x] cmp eax,[sel.end.x]
jge .ya2 jge .ya2
;---[ block inside selection ]-----------------(- ;---[ block inside selection ]-----------------(-
.ya4: mov ecx,[color_tbl.text.sel] .ya4: mov cl, [scale]
shl ecx,24
or ecx,[color_tbl.text.sel]
;----------------------------------------------)- ;----------------------------------------------)-
.draw_t: .draw_t:
mcall 4 mcall 4
.skip_t: .skip_t:
pop eax eax ; ebx esi pop eax eax ; ebx esi
imul eax,6 imul eax,[charWidth]
add [esp+4*2+2],ax add [esp+4*2+2],ax
pop ecx esi pop ecx esi
cmp ecx,[cur_line_len] cmp ecx,[cur_line_len]
@ -764,7 +783,7 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
pop ebx ecx pop ebx ecx
and ebx,0x0000FFFF and ebx,0x0000FFFF
add ebx,[left_ofs-2] add ebx,[left_ofs-2]
add ebx,LINEH add ebx,[lineHeight]
add esi,[cur_line_len] add esi,[cur_line_len]
inc dword[esp] inc dword[esp]
dec ecx dec ecx
@ -785,12 +804,13 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
mov edx,[color_tbl.back] mov edx,[color_tbl.back]
mov eax,13 mov eax,13
mov ecx,[esp-8] mov ecx,[esp-8]
add ecx,LINEH add ecx,[lineHeight]
shl ecx,16 shl ecx,16
mov cx,word[cur_editor.Bounds.Bottom] mov cx,word[cur_editor.Bounds.Bottom]
sub cx,[esp-8] sub cx,[esp-8]
add cx,-SCRLW-LINEH sub cx,word[lineHeight]
jle @f sub cx,SCRLW
js @f
mcall mcall
@@: mov ecx,[cur_editor.Bounds.Top-2] @@: mov ecx,[cur_editor.Bounds.Top-2]
mov cx,2 mov cx,2
@ -938,7 +958,7 @@ proc draw_editor_caret ;///// DRAW EDITOR TEXT CARET /////////////////////////
js @f js @f
cmp ebx,[columns.scr] cmp ebx,[columns.scr]
ja @f ja @f
imul ebx,6 imul ebx,[charWidth]
add ebx,[left_ofs] add ebx,[left_ofs]
dec ebx dec ebx
push bx push bx
@ -949,11 +969,12 @@ proc draw_editor_caret ;///// DRAW EDITOR TEXT CARET /////////////////////////
js @f js @f
cmp eax,[lines.scr] cmp eax,[lines.scr]
jge @f jge @f
imul eax,LINEH imul eax,[lineHeight]
add eax,[top_ofs] add eax,[top_ofs]
mov esi,eax mov esi,eax
shl esi,16 shl esi,16
add eax,LINEH-2 add eax,[lineHeight]
sub eax,2
mov si,ax mov si,ax
mov ecx,2 mov ecx,2
cmp [ins_mode],0 cmp [ins_mode],0

View File

@ -69,7 +69,7 @@ key:
.lp0: test al,0x80 .lp0: test al,0x80
jnz still.skip_write jnz still.skip_write
;-------------------------------------- ;--------------------------------------
; it is CAPS LOCK correct processing for chars ; CAPS LOCK correct processing for chars
test [shi], 0x00000040 ; CAPS LOCK is on? test [shi], 0x00000040 ; CAPS LOCK is on?
jz .no_caps_lock jz .no_caps_lock
cmp ecx,1 cmp ecx,1
@ -81,13 +81,11 @@ key:
jnz .no_caps_lock jnz .no_caps_lock
dec ecx dec ecx
.no_caps_lock: .no_caps_lock:
;--------------------------------------
; alt gr pressed? ; alt gr pressed?
test [shi], 0x00000020 test [shi], 0x00000020
jz .no_alt_gr jz .no_alt_gr
mov ecx, 3 mov ecx, 3
.no_alt_gr: .no_alt_gr:
;--------------------------------------
push eax push eax
mcall 26,2,,key1 mcall 26,2,,key1
pop eax pop eax
@ -164,9 +162,9 @@ key:
mov eax,1 mov eax,1
jmp key.tab.direct jmp key.tab.direct
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_a ;///// SELECT ALL DOCUMENT /////////////////////////////////// proc key.ctrl_a ;///// SELECT ALL DOCUMENT /////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
xor eax,eax xor eax,eax
mov [cur_editor.SelStart.X],eax mov [cur_editor.SelStart.X],eax
mov [cur_editor.SelStart.Y],eax mov [cur_editor.SelStart.Y],eax
@ -180,9 +178,9 @@ proc key.ctrl_a ;///// SELECT ALL DOCUMENT ///////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_o ;///// ENTER OPEN FILENAME /////////////////////////////////// proc key.ctrl_o ;///// ENTER OPEN FILENAME /////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov [bot_mode2],0 mov [bot_mode2],0
.direct: .direct:
@ -207,9 +205,9 @@ proc key.ctrl_o ;///// ENTER OPEN FILENAME ///////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_s ;///// ENTER SAVE FILENAME /////////////////////////////////// proc key.ctrl_s ;///// ENTER SAVE FILENAME /////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
cmp [cur_editor.FilePath], 0 cmp [cur_editor.FilePath], 0
je key.shift_ctrl_s je key.shift_ctrl_s
cmp [cur_editor.Modified],0 cmp [cur_editor.Modified],0
@ -224,16 +222,16 @@ proc key.ctrl_s ;///// ENTER SAVE FILENAME ///////////////////////////////////
jmp key.ctrl_o.direct jmp key.ctrl_o.direct
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_n ;///// CREATE NEW FILE (TAB) ///////////////////////////////// proc key.ctrl_n ;///// CREATE NEW FILE (TAB) ///////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call create_tab call create_tab
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_f ;///// ENTER KEYWORD TO FIND ///////////////////////////////// proc key.ctrl_f ;///// ENTER KEYWORD TO FIND ///////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov [bot_mode2],0 mov [bot_mode2],0
mov [bot_dlg_height],16*2+4*2-1 mov [bot_dlg_height],16*2+4*2-1
@ -260,42 +258,39 @@ proc key.ctrl_f ;///// ENTER KEYWORD TO FIND /////////////////////////////////
ret ret
endp endp
;---------------------------------------------------------------
proc key.ctrl_h proc key.ctrl_h
;---------------------------------------------------------------
mov [bot_mode2],1 mov [bot_mode2],1
mov [bot_dlg_height],16*3+4*2+1 mov [bot_dlg_height],16*3+4*2+1
mov [s_status],s_enter_text_to_replace mov [s_status],s_enter_text_to_replace
jmp key.ctrl_f.direct jmp key.ctrl_f.direct
endp endp
;---------------------------------------------------------------
proc key.ctrl_g proc key.ctrl_g
;---------------------------------------------------------------
ret ret
@^ ; mov [bot_mode2],0
mov [bot_mode2],0 ; mov [bot_dlg_height],16*2+4*2-1
mov [bot_dlg_height],16*2+4*2-1 ; mov [bot_mode],1
; mov [bot_dlg_handler],gotodlg_handler
mov [bot_mode],1 ; mov [focused_tb],tb_gotorow
mov [bot_dlg_handler],gotodlg_handler ; mov al,[tb_gotorow.length]
mov [focused_tb],tb_gotorow ; mov [tb_gotorow.pos.x],al
; mov [tb_gotorow.sel.x],0
mov al,[tb_gotorow.length] ; mov [tb_casesen],0
mov [tb_gotorow.pos.x],al ; call drawwindow
mov [tb_gotorow.sel.x],0 ; ret
mov [tb_casesen],0
call drawwindow
ret
^@
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_left ;///// GO TO PREVIOUS WORD //////////////////////////////// proc key.ctrl_left ;///// GO TO PREVIOUS WORD //////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_ctrl_left: ; GO TO PREVIOUS WORD, WITH SELECTION
key.shift_ctrl_left: ;///// GO TO PREVIOUS WORD, WITH SELECTION ///////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov ebx,[cur_editor.Caret.Y] mov ebx,[cur_editor.Caret.Y]
mov edx,[cur_editor.Caret.X] mov edx,[cur_editor.Caret.X]
cld cld
@ -381,14 +376,13 @@ proc key.ctrl_left ;///// GO TO PREVIOUS WORD ////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_right ;///// GO TO NEXT WORD /////////////////////////////////// proc key.ctrl_right ;///// GO TO NEXT WORD /////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_ctrl_right: ;/ GO TO NEXT WORD, WITH SELECTION //
key.shift_ctrl_right: ;///// GO TO NEXT WORD, WITH SELECTION //////////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov ebx,[cur_editor.Caret.Y] mov ebx,[cur_editor.Caret.Y]
mov edx,[cur_editor.Caret.X] mov edx,[cur_editor.Caret.X]
cld cld
@ -470,8 +464,9 @@ proc key.ctrl_right ;///// GO TO NEXT WORD ///////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_x proc key.ctrl_x ;///// CUT /////////////////////////////////////
;---------------------------------------------------------------
cmp [sel.selected],0 cmp [sel.selected],0
je @f je @f
call key.ctrl_c call key.ctrl_c
@ -480,8 +475,9 @@ proc key.ctrl_x
@@: ret @@: ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_c proc key.ctrl_c ;///// COPY ////////////////////////////////////
;---------------------------------------------------------------
mov [copy_size],0 mov [copy_size],0
cmp [sel.selected],0 cmp [sel.selected],0
je .exit je .exit
@ -582,8 +578,9 @@ proc key.ctrl_c
jmp @b jmp @b
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_v proc key.ctrl_v ;///// PASTE ///////////////////////////////////
;---------------------------------------------------------------
cmp [replace_mode],0 cmp [replace_mode],0
jne @f jne @f
call get_from_clipboard call get_from_clipboard
@ -690,9 +687,9 @@ proc key.ctrl_v
pop eax pop eax
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_d ;///// INSERT SEPARATOR ////////////////////////////////////// proc key.ctrl_d ;///// INSERT SEPARATOR ////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov eax,90+sizeof.EDITOR_LINE_DATA mov eax,90+sizeof.EDITOR_LINE_DATA
call editor_realloc_lines call editor_realloc_lines
@ -729,9 +726,9 @@ proc key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_y ;///// DELETE CURRENT LINE /////////////////////////////////// proc key.ctrl_y ;///// DELETE CURRENT LINE /////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov eax,[cur_editor.Caret.Y] mov eax,[cur_editor.Caret.Y]
inc eax inc eax
cmp eax,[cur_editor.Lines.Count] cmp eax,[cur_editor.Lines.Count]
@ -766,14 +763,15 @@ proc key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.up ;///// GO TO PREVIOUS LINE /////////////////////////////////////// proc key.up ;///// GO TO PREVIOUS LINE /////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call key.shift_up call key.shift_up
jmp clear_selection jmp clear_selection
;-----------------------------------------------------------------------------
key.shift_up: ;///// GO TO PREVIOUS LINE, WITH SELECTION //////////////// ;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_up: ;/// GO TO PREVIOUS LINE, WITH SELECTION ////
;---------------------------------------------------------------
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
dec ecx dec ecx
js .exit js .exit
@ -787,14 +785,15 @@ proc key.up ;///// GO TO PREVIOUS LINE ///////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.down ;///// GO TO NEXT LINE ///////////////////////////////////////// proc key.down ;///// GO TO NEXT LINE ///////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call key.shift_down call key.shift_down
jmp clear_selection jmp clear_selection
;-----------------------------------------------------------------------------
key.shift_down: ;///// GO TO NEXT LINE, WITH SELECTION ////////////////// ;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_down: ;//// GO TO NEXT LINE, WITH SELECTION /////
;---------------------------------------------------------------
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
inc ecx inc ecx
cmp [cur_editor.Lines.Count],ecx cmp [cur_editor.Lines.Count],ecx
@ -809,14 +808,15 @@ proc key.down ;///// GO TO NEXT LINE /////////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.left ;///// GO TO PREVIOUS CHAR ///////////////////////////////////// proc key.left ;///// GO TO PREVIOUS CHAR ///////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call key.shift_left call key.shift_left
jmp clear_selection jmp clear_selection
;-----------------------------------------------------------------------------
key.shift_left: ;///// GO TO PREVIOUS CHAR, WITH SELECTION ////////////// ;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_left: ;// GO TO PREVIOUS CHAR, WITH SELECTION ///
;---------------------------------------------------------------
mov eax,[cur_editor.Caret.X] mov eax,[cur_editor.Caret.X]
dec eax dec eax
jns @f jns @f
@ -832,14 +832,15 @@ proc key.left ;///// GO TO PREVIOUS CHAR /////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.right ;///// GO TO NEXT CHAR //////////////////////////////////////// proc key.right ;///// GO TO NEXT CHAR //////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call key.shift_right call key.shift_right
jmp clear_selection jmp clear_selection
;-----------------------------------------------------------------------------
key.shift_right: ;///// GO TO NEXT CHAR, WITH SELECTION ///////////////// ;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_right: ;//// GO TO NEXT CHAR, WITH SELECTION ////
;---------------------------------------------------------------
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
call get_line_offset call get_line_offset
mov eax,[cur_editor.Caret.X] mov eax,[cur_editor.Caret.X]
@ -857,14 +858,13 @@ proc key.right ;///// GO TO NEXT CHAR ////////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.pgup ;///// GO TO PREVIOUS PAGE ///////////////////////////////////// proc key.pgup ;///// GO TO PREVIOUS PAGE ///////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_pgup: ;// GO TO PREVIOUS PAGE, WITH SELECTION ///
key.shift_pgup: ;///// GO TO PREVIOUS PAGE, WITH SELECTION ////////////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov edx,[lines.scr] mov edx,[lines.scr]
dec edx dec edx
mov eax,[cur_editor.Caret.Y] mov eax,[cur_editor.Caret.Y]
@ -885,14 +885,13 @@ proc key.pgup ;///// GO TO PREVIOUS PAGE /////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.pgdn ;///// GO TO NEXT PAGE ///////////////////////////////////////// proc key.pgdn ;///// GO TO NEXT PAGE ///////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_pgdn: ;//// GO TO NEXT PAGE, WITH SELECTION /////
key.shift_pgdn: ;///// GO TO NEXT PAGE, WITH SELECTION ////////////////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov edx,[lines.scr] mov edx,[lines.scr]
dec edx dec edx
mov eax,[cur_editor.Caret.Y] mov eax,[cur_editor.Caret.Y]
@ -913,14 +912,13 @@ proc key.pgdn ;///// GO TO NEXT PAGE /////////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.home ;///// GO TO LINE START //////////////////////////////////////// proc key.home ;///// GO TO LINE START //////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_home: ;//// GO TO LINE START, WITH SELECTION ////
key.shift_home: ;///// GO TO LINE START, WITH SELECTION ///////////////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov [cur_editor.Caret.X],0 mov [cur_editor.Caret.X],0
test [chr],KM_SHIFT test [chr],KM_SHIFT
jnz @f jnz @f
@ -931,14 +929,13 @@ proc key.home ;///// GO TO LINE START ////////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.end ;///// GO TO LINE END /////////////////////////////////////////// proc key.end ;///// GO TO LINE END /////////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_end: ;///// GO TO LINE END, WITH SELECTION //////
key.shift_end: ;///// GO TO LINE END, WITH SELECTION //////////////////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
call get_line_offset call get_line_offset
call get_real_length call get_real_length
@ -952,14 +949,13 @@ proc key.end ;///// GO TO LINE END ///////////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_home ;///// GO TO PAGE START /////////////////////////////////// proc key.ctrl_home ;///// GO TO PAGE START /////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_ctrl_home: ;/ GO TO PAGE START, WITH SELECTION //
key.shift_ctrl_home: ;///// GO TO PAGE START, WITH SELECTION //////////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov eax,[cur_editor.TopLeft.Y] mov eax,[cur_editor.TopLeft.Y]
mov ecx,eax mov ecx,eax
test [chr],KM_SHIFT test [chr],KM_SHIFT
@ -972,14 +968,13 @@ proc key.ctrl_home ;///// GO TO PAGE START ///////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_end ;///// GO TO PAGE END ////////////////////////////////////// proc key.ctrl_end ;///// GO TO PAGE END ////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_ctrl_end: ;/// GO TO PAGE END, WITH SELECTION ///
key.shift_ctrl_end: ;///// GO TO PAGE END, WITH SELECTION /////////////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov ecx,[cur_editor.TopLeft.Y] mov ecx,[cur_editor.TopLeft.Y]
mov eax,[lines.scr] mov eax,[lines.scr]
cmp eax,[cur_editor.Lines.Count] cmp eax,[cur_editor.Lines.Count]
@ -997,14 +992,13 @@ proc key.ctrl_end ;///// GO TO PAGE END //////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_pgup ;///// GO TO DOCUMENT START /////////////////////////////// proc key.ctrl_pgup ;///// GO TO DOCUMENT START /////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_ctrl_pgup: ; GO TO DOCUMENT START, WITH SELECTION
key.shift_ctrl_pgup: ;///// GO TO DOCUMENT START, WITH SELECTION //////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
xor eax,eax xor eax,eax
mov [cur_editor.TopLeft.Y],eax mov [cur_editor.TopLeft.Y],eax
mov [cur_editor.Caret.Y],eax mov [cur_editor.Caret.Y],eax
@ -1017,14 +1011,13 @@ proc key.ctrl_pgup ;///// GO TO DOCUMENT START ///////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_pgdn ;///// GO TO DOCUMENT END ///////////////////////////////// proc key.ctrl_pgdn ;///// GO TO DOCUMENT END ///////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call clear_selection call clear_selection
;---------------------------------------------------------------
;----------------------------------------------------------------------------- key.shift_ctrl_pgdn: ; GO TO DOCUMENT END, WITH SELECTION /
key.shift_ctrl_pgdn: ;///// GO TO DOCUMENT END, WITH SELECTION ////////// ;---------------------------------------------------------------
;-----------------------------------------------------------------------------
mov eax,[cur_editor.Lines.Count] mov eax,[cur_editor.Lines.Count]
mov [cur_editor.Caret.Y],eax mov [cur_editor.Caret.Y],eax
sub eax,[lines.scr] sub eax,[lines.scr]
@ -1041,9 +1034,9 @@ proc key.ctrl_pgdn ;///// GO TO DOCUMENT END /////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.del ;///// DELETE NEXT CHAR OR SELECTION //////////////////////////// proc key.del ;///// DELETE NEXT CHAR OR SELECTION //////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call delete_selection call delete_selection
jnc .exit jnc .exit
@ -1182,9 +1175,9 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ins ;///// TOGGLE INSERT/OVERWRITE MODE ///////////////////////////// proc key.ins ;///// TOGGLE INSERT/OVERWRITE MODE ///////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
xor [ins_mode],1 xor [ins_mode],1
mov eax,[cur_editor.Caret.Y] mov eax,[cur_editor.Caret.Y]
mov ebx,eax mov ebx,eax
@ -1193,9 +1186,9 @@ proc key.ins ;///// TOGGLE INSERT/OVERWRITE MODE /////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION //////////////////// proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION //////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call delete_selection call delete_selection
jnc key.del.exit jnc key.del.exit
@ -1256,9 +1249,9 @@ proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////////////////////
jmp key.del.line_up jmp key.del.line_up
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.tab ;///// TABULATE ///////////////////////////////////////////////// proc key.tab ;///// TABULATE ///////////////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call delete_selection call delete_selection
mov eax,[cur_editor.Caret.X] mov eax,[cur_editor.Caret.X]
@ -1341,9 +1334,9 @@ proc key.tab ;///// TABULATE /////////////////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.return ;///// CARRIAGE RETURN /////////////////////////////////////// proc key.return ;///// CARRIAGE RETURN /////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
call delete_selection call delete_selection
; unknown how many times the user wants to press "Enter", ; unknown how many times the user wants to press "Enter",
; so you should do a little more value ; so you should do a little more value
@ -1478,9 +1471,9 @@ proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_tab ;///// SWITCH TO NEXT TAB ////////////////////////////////// proc key.ctrl_tab ;///// SWITCH TO NEXT TAB ////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
cmp [tab_bar.Items.Count],1 cmp [tab_bar.Items.Count],1
je .exit je .exit
xor eax,eax xor eax,eax
@ -1505,9 +1498,9 @@ proc key.ctrl_tab ;///// SWITCH TO NEXT TAB //////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.shift_ctrl_tab ;///// SWITCH TO PREVIOUS TAB //////////////////////// proc key.shift_ctrl_tab ;///// SWITCH TO PREVIOUS TAB //////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
cmp [tab_bar.Items.Count],1 cmp [tab_bar.Items.Count],1
je .exit je .exit
xor eax,eax xor eax,eax
@ -1533,9 +1526,9 @@ proc key.shift_ctrl_tab ;///// SWITCH TO PREVIOUS TAB ////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_f4 ;///// CLOSE CURRENT TAB //////////////////////////////////// proc key.ctrl_f4 ;///// CLOSE CURRENT TAB //////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
cmp [cur_editor.Modified],0 cmp [cur_editor.Modified],0
je .close je .close
mov [bot_mode2],2 mov [bot_mode2],2
@ -1557,9 +1550,9 @@ proc key.ctrl_f4 ;///// CLOSE CURRENT TAB ////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.shift_f9 ;///// SET DEFAULT TAB ///////////////////////////////////// proc key.shift_f9 ;///// SET DEFAULT TAB ///////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov eax,[tab_bar.Current.Ptr] mov eax,[tab_bar.Current.Ptr]
cmp eax,[tab_bar.Default.Ptr] cmp eax,[tab_bar.Default.Ptr]
jne @f jne @f
@ -1575,36 +1568,36 @@ proc key.shift_f9 ;///// SET DEFAULT TAB /////////////////////////////////////
ret ret
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.f3 ;///// FIND NEXT MATCH /////////////////////////////////////////// proc key.f3 ;///// FIND NEXT MATCH /////////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
jmp search jmp search
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.ctrl_f9 ;///// COMPILE ////////////////////////////////////////////// proc key.ctrl_f9 ;///// COMPILE ////////////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov bl,0 mov bl,0
jmp start_fasm jmp start_fasm
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.f9 ;///// COMPILE AND RUN /////////////////////////////////////////// proc key.f9 ;///// COMPILE AND RUN /////////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov bl,1 mov bl,1
jmp start_fasm jmp start_fasm
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.f10 ;///// COMPILE AND RUN UNDER DEBUG ////////////////////////////// proc key.f10 ;///// COMPILE AND RUN UNDER DEBUG ////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov bl,2 mov bl,2
jmp start_fasm jmp start_fasm
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc key.alt_x ;///// EXIT PROGRAM /////////////////////////////////////////// proc key.alt_x ;///// EXIT PROGRAM /////////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
mov [main_closing],1 mov [main_closing],1
mov eax,[tab_bar.Items] mov eax,[tab_bar.Items]
mov [exit_tab_item],eax mov [exit_tab_item],eax
@ -1624,9 +1617,33 @@ proc key.alt_x ;///// EXIT PROGRAM ///////////////////////////////////////////
mcall -1 mcall -1
endp endp
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
proc try_to_close_tabs ;///// FIND TABS TO BE SAVED BEFORE CLOSE ///////////// proc key.ctrl_plus ;///// ZOOM IN //////////////////////////////
;----------------------------------------------------------------------------- ;---------------------------------------------------------------
cmp [scale],7
jz @f
inc [scale]
add [lineHeight],LINEH
add [charWidth],6
jmp draw_editor
endp
;---------------------------------------------------------------
proc key.ctrl_minus ;///// ZOOM OUT ////////////////////////////
;---------------------------------------------------------------
cmp [scale],0
jz @f
dec [scale]
sub [lineHeight],LINEH
sub [charWidth],6
jmp draw_editor
@@:
ret
endp
;---------------------------------------------------------------
proc try_to_close_tabs ;// FIND TABS TO BE SAVED BEFORE CLOSE //
;---------------------------------------------------------------
push ecx ebp push ecx ebp
call flush_cur_tab call flush_cur_tab
mov ebp,[exit_tab_item] ; [tab_bar.Items] mov ebp,[exit_tab_item] ; [tab_bar.Items]

View File

@ -12,7 +12,8 @@ proc check_mouse_in_edit_area
sub [__rc+0x8],SCRLW+6 sub [__rc+0x8],SCRLW+6
mov ecx,[cur_editor.Gutter.Width] mov ecx,[cur_editor.Gutter.Width]
add [__rc+0x0],ecx add [__rc+0x0],ecx
imul ecx,[lines.scr],LINEH mov ecx,[lines.scr]
imul ecx,[lineHeight]
dec ecx dec ecx
add [__rc+0xC],ecx add [__rc+0xC],ecx
mov ecx,__rc mov ecx,__rc
@ -188,13 +189,13 @@ mouse:
push eax push eax
mov eax,ebx mov eax,ebx
cdq cdq
mov ecx,LINEH mov ecx,[lineHeight]
idiv ecx idiv ecx
@@: add eax,[cur_editor.TopLeft.Y] @@: add eax,[cur_editor.TopLeft.Y]
mov ebx,eax mov ebx,eax
pop eax pop eax
cdq cdq
mov ecx,6 mov ecx,[charWidth]
idiv ecx idiv ecx
@@: add eax,[cur_editor.TopLeft.X] @@: add eax,[cur_editor.TopLeft.X]
mov ecx, ebx mov ecx, ebx