2006-10-12 00:40:53 +04:00
|
|
|
button:
|
|
|
|
mcall 17
|
|
|
|
cmp al,0
|
|
|
|
jne still
|
|
|
|
shr eax,8
|
|
|
|
|
|
|
|
cmp [bot_mode],0
|
|
|
|
je @f
|
|
|
|
mov ebx,eax
|
|
|
|
mov al,3
|
|
|
|
call [bot_dlg_handler]
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
@@: mov esi,accel_table2
|
|
|
|
.acc: cmp eax,[esi]
|
|
|
|
jne @f
|
|
|
|
call dword[esi+4]
|
|
|
|
jmp still.skip_write
|
|
|
|
@@: add esi,8
|
|
|
|
cmp byte[esi],0
|
|
|
|
jne .acc
|
|
|
|
|
2007-01-10 09:03:39 +03:00
|
|
|
cmp eax,[tab_bar.Buttons.First]
|
|
|
|
jb @f
|
|
|
|
cmp eax,[tab_bar.Buttons.Last]
|
|
|
|
ja @f
|
|
|
|
|
|
|
|
;// TAB CONTROL BUTTONS
|
|
|
|
|
|
|
|
add eax,-1000
|
|
|
|
imul ebp,eax,sizeof.TABITEM
|
|
|
|
add ebp,[tab_bar.Items]
|
|
|
|
cmp ebp,[tab_bar.Current.Ptr]
|
|
|
|
je @f
|
|
|
|
call set_cur_tab
|
|
|
|
call align_editor_in_tab
|
|
|
|
call draw_editor
|
|
|
|
call draw_statusbar
|
|
|
|
call draw_tabctl
|
|
|
|
|
|
|
|
@@:
|
2006-10-12 00:40:53 +04:00
|
|
|
jmp still.skip_write
|
|
|
|
|
2007-01-10 09:03:39 +03:00
|
|
|
btn.vscroll_up:
|
|
|
|
dec [cur_editor.TopLeft.Y] ;! [top_line]
|
2006-10-12 00:40:53 +04:00
|
|
|
jns @f
|
2007-01-10 09:03:39 +03:00
|
|
|
inc [cur_editor.TopLeft.Y] ;! [top_line]
|
2007-01-03 21:22:05 +03:00
|
|
|
ret
|
2006-10-12 00:40:53 +04:00
|
|
|
@@: call check_inv_all.skip_check
|
|
|
|
ret
|
|
|
|
|
2007-01-10 09:03:39 +03:00
|
|
|
btn.vscroll_down:
|
|
|
|
inc [cur_editor.TopLeft.Y] ;! [top_line]
|
|
|
|
mov eax,[cur_editor.Lines.Count] ;! eax,[lines]
|
2006-10-12 00:40:53 +04:00
|
|
|
sub eax,[lines.scr]
|
2007-01-10 09:03:39 +03:00
|
|
|
cmp eax,[cur_editor.TopLeft.Y] ;! eax,[top_line]
|
2006-10-12 00:40:53 +04:00
|
|
|
jge @f
|
2007-01-10 09:03:39 +03:00
|
|
|
dec [cur_editor.TopLeft.Y] ;! [top_line]
|
2007-01-03 21:22:05 +03:00
|
|
|
ret
|
2006-10-12 00:40:53 +04:00
|
|
|
@@: call check_inv_all.skip_check
|
|
|
|
ret
|
|
|
|
|
2007-01-10 09:03:39 +03:00
|
|
|
btn.hscroll_up:
|
|
|
|
dec [cur_editor.TopLeft.X] ;! [left_col]
|
2006-10-12 00:40:53 +04:00
|
|
|
jns @f
|
2007-01-10 09:03:39 +03:00
|
|
|
inc [cur_editor.TopLeft.X] ;! [left_col]
|
2006-10-12 00:40:53 +04:00
|
|
|
ret;jmp still.skip_write
|
|
|
|
@@: call check_inv_all.skip_check
|
|
|
|
ret
|
|
|
|
|
2007-01-10 09:03:39 +03:00
|
|
|
btn.hscroll_down:
|
|
|
|
inc [cur_editor.TopLeft.X] ;! [left_col]
|
|
|
|
mov eax,[cur_editor.Columns.Count] ;! eax,[columns]
|
2006-10-12 00:40:53 +04:00
|
|
|
sub eax,[columns.scr]
|
2007-01-10 09:03:39 +03:00
|
|
|
cmp eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
|
2006-10-12 00:40:53 +04:00
|
|
|
jge @f
|
2007-01-10 09:03:39 +03:00
|
|
|
dec [cur_editor.TopLeft.X] ;! [left_col]
|
2007-01-03 21:22:05 +03:00
|
|
|
ret
|
2006-10-12 00:40:53 +04:00
|
|
|
@@: call check_inv_all.skip_check
|
|
|
|
ret
|
|
|
|
|
2007-01-10 09:03:39 +03:00
|
|
|
btn.tabctl_right:
|
|
|
|
call get_hidden_tabitems_number
|
|
|
|
or eax,eax
|
|
|
|
jz @f
|
|
|
|
inc [tab_bar.Items.Left]
|
|
|
|
call draw_tabctl
|
|
|
|
@@: ret
|
|
|
|
btn.tabctl_left:
|
|
|
|
dec [tab_bar.Items.Left]
|
|
|
|
jns @f
|
|
|
|
inc [tab_bar.Items.Left]
|
|
|
|
@@: call draw_tabctl
|
|
|
|
ret
|
|
|
|
|
2006-10-12 00:40:53 +04:00
|
|
|
btn.search:
|
|
|
|
key.f3:
|
|
|
|
call search
|
|
|
|
jc @f
|
|
|
|
call check_inv_all
|
|
|
|
@@: ret
|
|
|
|
|
|
|
|
|
|
|
|
func search
|
|
|
|
cld
|
2007-01-10 09:03:39 +03:00
|
|
|
mov ecx,[cur_editor.Caret.Y] ;! ecx,[pos.y]
|
2006-10-12 00:40:53 +04:00
|
|
|
mov edx,ecx
|
|
|
|
call get_line_offset
|
|
|
|
cmp word[esi],0
|
|
|
|
je .exit
|
|
|
|
call get_real_length
|
|
|
|
add esi,4
|
|
|
|
or eax,eax
|
|
|
|
jz .end_line.2
|
|
|
|
mov ecx,eax
|
2007-01-10 09:03:39 +03:00
|
|
|
sub ecx,[cur_editor.Caret.X] ;! ecx,[pos.x]
|
2006-10-12 00:40:53 +04:00
|
|
|
push esi
|
2007-01-10 09:03:39 +03:00
|
|
|
add esi,[cur_editor.Caret.X] ;! esi,[pos.x]
|
2006-10-12 00:40:53 +04:00
|
|
|
jmp @f
|
|
|
|
|
|
|
|
.next_line:
|
|
|
|
push esi
|
|
|
|
@@: sub ecx,[s_search.size]
|
|
|
|
inc ecx
|
|
|
|
|
|
|
|
.next_char:
|
|
|
|
dec ecx
|
|
|
|
js .end_line
|
|
|
|
xor edi,edi
|
|
|
|
|
|
|
|
.next_ok:
|
|
|
|
movzx eax,byte[edi+esi]
|
|
|
|
movzx ebx,byte[edi+s_search]
|
|
|
|
|
|
|
|
cmp al,$61
|
|
|
|
jb @f
|
|
|
|
add al,[eax+add_table-$61]
|
|
|
|
@@: cmp bl,$61
|
|
|
|
jb @f
|
|
|
|
add bl,[ebx+add_table-$61]
|
|
|
|
@@:
|
|
|
|
cmp al,bl
|
|
|
|
je @f
|
|
|
|
|
|
|
|
inc esi
|
|
|
|
jmp .next_char
|
|
|
|
@@:
|
|
|
|
inc edi
|
|
|
|
cmp edi,[s_search.size]
|
|
|
|
jne .next_ok
|
|
|
|
|
|
|
|
.found:
|
|
|
|
add esp,4
|
2007-01-10 09:03:39 +03:00
|
|
|
mov [cur_editor.Caret.Y],edx ;! [pos.y],edx
|
|
|
|
mov [cur_editor.SelStart.Y],edx ;! [sel.y],edx
|
2006-10-12 00:40:53 +04:00
|
|
|
mov ecx,edx
|
|
|
|
lea eax,[esi-4]
|
|
|
|
call get_line_offset
|
|
|
|
sub eax,esi
|
2007-01-10 09:03:39 +03:00
|
|
|
mov [cur_editor.SelStart.X],eax ;! [sel.x],eax
|
2006-10-12 00:40:53 +04:00
|
|
|
add eax,[s_search.size]
|
2007-01-10 09:03:39 +03:00
|
|
|
mov [cur_editor.Caret.X],eax ;! [pos.x],eax
|
2006-10-12 00:40:53 +04:00
|
|
|
mov [s_status],0
|
|
|
|
clc
|
|
|
|
ret
|
|
|
|
|
|
|
|
.end_line:
|
|
|
|
pop esi
|
|
|
|
.end_line.2:
|
|
|
|
movzx eax,word[esi-4]
|
|
|
|
add esi,eax;[esi-4]
|
|
|
|
inc edx
|
|
|
|
call get_real_length
|
|
|
|
mov ecx,eax
|
|
|
|
lodsd
|
|
|
|
or eax,eax
|
|
|
|
jnz .next_line
|
|
|
|
.exit:
|
|
|
|
mov [s_status],s_text_not_found
|
|
|
|
stc
|
|
|
|
ret
|
|
|
|
endf
|
|
|
|
|
|
|
|
btn.compile:
|
|
|
|
key.ctrl_f9:
|
2007-01-03 21:22:05 +03:00
|
|
|
mov bl,0
|
2006-10-12 00:40:53 +04:00
|
|
|
call start_fasm
|
2007-01-03 21:22:05 +03:00
|
|
|
ret
|
2006-10-12 00:40:53 +04:00
|
|
|
btn.compile_run:
|
|
|
|
key.f9:
|
2007-01-03 21:22:05 +03:00
|
|
|
mov bl,1
|
2006-10-12 00:40:53 +04:00
|
|
|
call start_fasm
|
2007-01-03 21:22:05 +03:00
|
|
|
ret
|
2006-10-12 00:40:53 +04:00
|
|
|
btn.debug_board:
|
|
|
|
call open_debug_board
|
2007-01-03 21:22:05 +03:00
|
|
|
ret
|
2006-10-12 00:40:53 +04:00
|
|
|
btn.sysfuncs_txt:
|
|
|
|
call open_sysfuncs_txt
|
2007-01-03 21:22:05 +03:00
|
|
|
ret
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
|
|
btn.load_file:
|
|
|
|
key.ctrl_l:
|
|
|
|
call load_file
|
|
|
|
jnc @f
|
|
|
|
ret
|
|
|
|
@@:
|
2007-01-03 21:22:05 +03:00
|
|
|
|
2006-10-12 00:40:53 +04:00
|
|
|
xor eax,eax
|
2007-01-10 09:03:39 +03:00
|
|
|
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
|
2006-10-12 00:40:53 +04:00
|
|
|
|
2007-01-10 09:03:39 +03:00
|
|
|
mov [cur_editor.Modified],al ;! [modified],al
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
|
|
; enable color syntax for ASM and INC files:
|
2007-01-10 09:03:39 +03:00
|
|
|
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'
|
2006-10-12 00:40:53 +04:00
|
|
|
jne @f
|
2007-01-10 09:03:39 +03:00
|
|
|
inc [cur_editor.AsmMode] ;! [asm_mode]
|
2006-10-12 00:40:53 +04:00
|
|
|
jmp .nocol
|
2007-01-10 09:03:39 +03:00
|
|
|
@@: cmp ecx,'inc'
|
2006-10-12 00:40:53 +04:00
|
|
|
jne .nocol
|
2007-01-10 09:03:39 +03:00
|
|
|
inc [cur_editor.AsmMode] ;! [asm_mode]
|
2006-10-12 00:40:53 +04:00
|
|
|
.nocol:
|
|
|
|
|
|
|
|
update_caption:
|
2007-01-10 09:03:39 +03:00
|
|
|
lea esi,[cur_editor.FilePath] ;! mov esi,f_info.path
|
2006-10-12 00:40:53 +04:00
|
|
|
mov edi,s_title
|
|
|
|
|
2007-01-03 21:22:05 +03:00
|
|
|
@@: lodsb
|
|
|
|
cmp al,0
|
|
|
|
je @f
|
|
|
|
stosb
|
|
|
|
jmp @b
|
|
|
|
@@:
|
2006-10-12 00:40:53 +04:00
|
|
|
;cld
|
2007-01-03 21:22:05 +03:00
|
|
|
;mov ecx,[f_info.length]
|
|
|
|
;jecxz @f
|
|
|
|
;rep movsb
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
|
|
mov dword[edi],' - '
|
|
|
|
add edi,3
|
|
|
|
@@: mov esi,htext
|
|
|
|
mov ecx,htext.size
|
2007-01-03 21:22:05 +03:00
|
|
|
cld
|
2006-10-12 00:40:53 +04:00
|
|
|
rep movsb
|
|
|
|
|
|
|
|
mov al,0
|
|
|
|
stosb
|
|
|
|
|
2007-01-03 21:22:05 +03:00
|
|
|
mcall 71,1,s_title
|
2006-10-12 00:40:53 +04:00
|
|
|
|
2007-01-03 21:22:05 +03:00
|
|
|
clc
|
|
|
|
ret
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
|
|
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
|
2006-12-30 20:44:05 +03:00
|
|
|
|
|
|
|
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
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
|
|
.close:
|
|
|
|
mov [main_closed],1
|
|
|
|
mcall -1
|