forked from KolibriOS/kolibrios
Tinypad 4.0.4 (put filename of current tab into open/save dialog)
git-svn-id: svn://kolibrios.org@327 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
a79e7c4171
commit
dfe81eb28d
@ -3,7 +3,7 @@
|
|||||||
; compiler: flat assembler 1.67.18
|
; compiler: flat assembler 1.67.18
|
||||||
; memory to compile: 3.0/9.0 MBytes (without/with size optimizations)
|
; memory to compile: 3.0/9.0 MBytes (without/with size optimizations)
|
||||||
; version: 4.0.4
|
; version: 4.0.4
|
||||||
; last update: 2007-02-01 (Feb 01, 2007)
|
; last update: 2007-02-08 (Feb 08, 2007)
|
||||||
; minimal kernel: revision #270 (svn://kolibrios.org/kernel)
|
; minimal kernel: revision #270 (svn://kolibrios.org/kernel)
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
|
; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
|
||||||
@ -25,6 +25,7 @@
|
|||||||
; - small drawing fix for gutter and line saved/modified markers
|
; - small drawing fix for gutter and line saved/modified markers
|
||||||
; (incorrect calculations)
|
; (incorrect calculations)
|
||||||
; - incorrect lines marking on Ctrl+V
|
; - incorrect lines marking on Ctrl+V
|
||||||
|
; - put filename of current tab into open/save dialog (noticed by Maxxxx32)
|
||||||
; changes:
|
; changes:
|
||||||
; - editor and other modifications to ease parts placement changing,
|
; - editor and other modifications to ease parts placement changing,
|
||||||
; including changes in look
|
; including changes in look
|
||||||
|
@ -536,15 +536,18 @@ func update_caption ;/////////////////////////////////////////////////////////
|
|||||||
lea esi,[cur_editor.FilePath]
|
lea esi,[cur_editor.FilePath]
|
||||||
mov edi,s_title
|
mov edi,s_title
|
||||||
|
|
||||||
|
xor ecx,ecx
|
||||||
@@: lodsb
|
@@: lodsb
|
||||||
cmp al,0
|
cmp al,0
|
||||||
je @f
|
je @f
|
||||||
stosb
|
stosb
|
||||||
|
inc ecx
|
||||||
jmp @b
|
jmp @b
|
||||||
@@:
|
@@:
|
||||||
|
push ecx
|
||||||
mov dword[edi],' - '
|
mov dword[edi],' - '
|
||||||
add edi,3
|
add edi,3
|
||||||
@@: mov esi,htext
|
mov esi,htext
|
||||||
mov ecx,htext.size
|
mov ecx,htext.size
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
@ -554,6 +557,19 @@ func update_caption ;/////////////////////////////////////////////////////////
|
|||||||
|
|
||||||
mcall 71,1,s_title
|
mcall 71,1,s_title
|
||||||
|
|
||||||
|
cmp [do_not_draw],0
|
||||||
|
jne @f
|
||||||
|
lea esi,[cur_editor.FilePath]
|
||||||
|
mov edi,tb_opensave.text
|
||||||
|
mov ecx,[esp]
|
||||||
|
cld
|
||||||
|
rep movsb
|
||||||
|
pop ecx
|
||||||
|
mov [tb_opensave.length],cl
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
add esp,4
|
||||||
clc
|
clc
|
||||||
ret
|
ret
|
||||||
endf
|
endf
|
||||||
|
@ -146,7 +146,7 @@ endf
|
|||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
func load_file ;//////////////////////////////////////////////////////////////
|
func load_file ;//////////////////////////////////////////////////////////////
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
cmp [tb_opensave.text],0
|
cmp [tb_opensave.length],0
|
||||||
jne @f
|
jne @f
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
@ -200,19 +200,23 @@ func load_file ;//////////////////////////////////////////////////////////////
|
|||||||
jne @f
|
jne @f
|
||||||
mov ebp,cur_editor
|
mov ebp,cur_editor
|
||||||
jmp .lp1
|
jmp .lp1
|
||||||
@@: call create_tab
|
@@: inc [do_not_draw]
|
||||||
|
call create_tab
|
||||||
|
dec [do_not_draw]
|
||||||
.lp1: push ecx esi edi
|
.lp1: push ecx esi edi
|
||||||
mov esi,tb_opensave.text
|
mov esi,tb_opensave.text
|
||||||
lea edi,[ebp+TABITEM.Editor.FilePath]
|
lea edi,[ebp+TABITEM.Editor.FilePath]
|
||||||
movzx ecx,[tb_opensave.length]
|
movzx ecx,[tb_opensave.length]
|
||||||
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
mov byte[edi],0
|
mov byte[edi],0
|
||||||
lea edi,[ebp+TABITEM.Editor.FilePath]
|
lea edi,[ebp+TABITEM.Editor.FilePath]
|
||||||
movzx ecx,[tb_opensave.length]
|
movzx ecx,[tb_opensave.length]
|
||||||
@@: cmp byte[edi+ecx-1],'/'
|
inc ecx
|
||||||
je @f
|
@@: dec ecx
|
||||||
dec ecx
|
jz @f
|
||||||
jmp @b
|
cmp byte[edi+ecx-1],'/'
|
||||||
|
jne @b
|
||||||
@@: mov [ebp+TABITEM.Editor.FileName],ecx
|
@@: mov [ebp+TABITEM.Editor.FileName],ecx
|
||||||
call flush_cur_tab
|
call flush_cur_tab
|
||||||
pop edi esi ecx
|
pop edi esi ecx
|
||||||
|
@ -137,14 +137,6 @@ func key.ctrl_o ;///// ENTER OPEN FILENAME ///////////////////////////////////
|
|||||||
mov [bot_dlg_handler],osdlg_handler
|
mov [bot_dlg_handler],osdlg_handler
|
||||||
mov [focused_tb],tb_opensave
|
mov [focused_tb],tb_opensave
|
||||||
|
|
||||||
mov ecx,[f_info.length]
|
|
||||||
mov [tb_opensave.length],cl
|
|
||||||
jecxz @f
|
|
||||||
mov esi,f_info.path
|
|
||||||
mov edi,tb_opensave.text
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
|
|
||||||
@@: mov al,[tb_opensave.length]
|
@@: mov al,[tb_opensave.length]
|
||||||
mov [tb_opensave.pos.x],al
|
mov [tb_opensave.pos.x],al
|
||||||
mov [tb_opensave.sel.x],0
|
mov [tb_opensave.sel.x],0
|
||||||
|
@ -574,10 +574,6 @@ func get_tab_size ;///// GET TAB WIDTH ///////////////////////////////////////
|
|||||||
jae .lp1
|
jae .lp1
|
||||||
lea eax,[ebp+TABITEM.Editor.FilePath]
|
lea eax,[ebp+TABITEM.Editor.FilePath]
|
||||||
add eax,[ebp+TABITEM.Editor.FileName]
|
add eax,[ebp+TABITEM.Editor.FileName]
|
||||||
cmp byte[eax],0
|
|
||||||
jne @f
|
|
||||||
int3
|
|
||||||
@@:
|
|
||||||
call strlen
|
call strlen
|
||||||
imul ebx,eax,6
|
imul ebx,eax,6
|
||||||
add ebx,9
|
add ebx,9
|
||||||
|
Loading…
Reference in New Issue
Block a user