Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 296 → Rev 297

/programs/develop/tinypad/trunk/tp-button.asm
37,46 → 37,47
call draw_editor
call draw_statusbar
call draw_tabctl
call update_caption
 
@@:
jmp still.skip_write
 
btn.vscroll_up:
dec [cur_editor.TopLeft.Y] ;! [top_line]
dec [cur_editor.TopLeft.Y]
jns @f
inc [cur_editor.TopLeft.Y] ;! [top_line]
inc [cur_editor.TopLeft.Y]
ret
@@: call check_inv_all.skip_check
@@: call editor_check_for_changes
ret
 
btn.vscroll_down:
inc [cur_editor.TopLeft.Y] ;! [top_line]
mov eax,[cur_editor.Lines.Count] ;! eax,[lines]
inc [cur_editor.TopLeft.Y]
mov eax,[cur_editor.Lines.Count]
sub eax,[lines.scr]
cmp eax,[cur_editor.TopLeft.Y] ;! eax,[top_line]
cmp eax,[cur_editor.TopLeft.Y]
jge @f
dec [cur_editor.TopLeft.Y] ;! [top_line]
dec [cur_editor.TopLeft.Y]
ret
@@: call check_inv_all.skip_check
@@: call editor_check_for_changes
ret
 
btn.hscroll_up:
dec [cur_editor.TopLeft.X] ;! [left_col]
dec [cur_editor.TopLeft.X]
jns @f
inc [cur_editor.TopLeft.X] ;! [left_col]
ret;jmp still.skip_write
@@: call check_inv_all.skip_check
inc [cur_editor.TopLeft.X]
ret
@@: call editor_check_for_changes
ret
 
btn.hscroll_down:
inc [cur_editor.TopLeft.X] ;! [left_col]
mov eax,[cur_editor.Columns.Count] ;! eax,[columns]
inc [cur_editor.TopLeft.X]
mov eax,[cur_editor.Columns.Count]
sub eax,[columns.scr]
cmp eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
cmp eax,[cur_editor.TopLeft.X]
jge @f
dec [cur_editor.TopLeft.X] ;! [left_col]
dec [cur_editor.TopLeft.X]
ret
@@: call check_inv_all.skip_check
@@: call editor_check_for_changes
ret
 
btn.tabctl_right:
93,17 → 94,16
@@: call draw_tabctl
ret
 
btn.search:
key.f3:
call search
jc @f
call check_inv_all
@@: ret
btn.debug_board:
call open_debug_board
ret
btn.sysfuncs_txt:
call open_sysfuncs_txt
ret
 
 
func search
cld
mov ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
mov ecx,[cur_editor.Caret.Y]
mov edx,ecx
call get_line_offset
cmp word[esi],0
113,9 → 113,9
or eax,eax
jz .end_line.2
mov ecx,eax
sub ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
sub ecx,[cur_editor.Caret.X]
push esi
add esi,[cur_editor.Caret.X] ;! esi,[pos.x]
add esi,[cur_editor.Caret.X]
jmp @f
 
.next_line:
151,15 → 151,15
 
.found:
add esp,4
mov [cur_editor.Caret.Y],edx ;! [pos.y],edx
mov [cur_editor.SelStart.Y],edx ;! [sel.y],edx
mov [cur_editor.Caret.Y],edx
mov [cur_editor.SelStart.Y],edx
mov ecx,edx
lea eax,[esi-4]
call get_line_offset
sub eax,esi
mov [cur_editor.SelStart.X],eax ;! [sel.x],eax
mov [cur_editor.SelStart.X],eax
add eax,[s_search.size]
mov [cur_editor.Caret.X],eax ;! [pos.x],eax
mov [cur_editor.Caret.X],eax
mov [s_status],0
clc
ret
168,7 → 168,7
pop esi
.end_line.2:
movzx eax,word[esi-4]
add esi,eax;[esi-4]
add esi,eax
inc edx
call get_real_length
mov ecx,eax
180,111 → 180,3
stc
ret
endf
 
btn.compile:
key.ctrl_f9:
mov bl,0
call start_fasm
ret
btn.compile_run:
key.f9:
mov bl,1
call start_fasm
ret
btn.debug_board:
call open_debug_board
ret
btn.sysfuncs_txt:
call open_sysfuncs_txt
ret
 
btn.load_file:
key.ctrl_l:
call load_file
jnc @f
ret
@@:
 
xor eax,eax
mov [cur_editor.TopLeft.Y],eax ;! [top_line],eax
mov [cur_editor.TopLeft.X],eax ;! [left_col],eax
mov [cur_editor.Caret.X],eax ;! [pos.x],eax
mov [cur_editor.Caret.Y],eax ;! [pos.y],eax
mov [cur_editor.SelStart.X],eax ;! [sel.x],eax
mov [cur_editor.SelStart.Y],eax ;! [sel.y],eax
 
mov [cur_editor.Modified],al ;! [modified],al
 
; enable color syntax for ASM and INC files:
mov [cur_editor.AsmMode],al ;! [asm_mode],al
 
; mov eax,[f_info.length]
; add eax,f_info.path
; mov byte[eax],0
lea ebx,[cur_editor.FilePath]
mov eax,ebx
call strlen
mov ecx,dword[ebx+eax-3]
or ecx,0x202020
cmp ecx,'asm'
jne @f
inc [cur_editor.AsmMode] ;! [asm_mode]
jmp .nocol
@@: cmp ecx,'inc'
jne .nocol
inc [cur_editor.AsmMode] ;! [asm_mode]
.nocol:
 
update_caption:
lea esi,[cur_editor.FilePath] ;! mov esi,f_info.path
mov edi,s_title
 
@@: lodsb
cmp al,0
je @f
stosb
jmp @b
@@:
;cld
;mov ecx,[f_info.length]
;jecxz @f
;rep movsb
 
mov dword[edi],' - '
add edi,3
@@: mov esi,htext
mov ecx,htext.size
cld
rep movsb
 
mov al,0
stosb
 
mcall 71,1,s_title
 
clc
ret
 
btn.close_main_window:
key.alt_x:
mov esi,self_path
mov byte[esi+PATHL-1],0
mov edi,f_info.path
cld
@@: lodsb
stosb
or al,al
jnz @b
 
mov [f_info70+0],2
mov [f_info70+4],0
mov [f_info70+8],0
mov [f_info70+12],TINYPAD_END
mov [f_info70+16],0
mov byte[f_info70+20],0
mov [f_info70+21],f_info.path
mcall 70,f_info70
 
.close:
mov [main_closed],1
mcall -1