t_edit: add new options for toolbar to *.ini file

git-svn-id: svn://kolibrios.org@7488 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2018-10-19 19:27:02 +00:00
parent 89001f353c
commit 07093dfc10
4 changed files with 199 additions and 74 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,12 +4,18 @@ draw_but_toolbar: ;
mov edi,tedit0
mov ecx,0x40000000
mov edx,5*65536+25
call draw_but_icon
mov edx,(5 shl 16)+25
bt word[panel_but],0
jnc @f
call draw_but_icon ;New
@@:
inc cx
mov edx,30*65536+25
call draw_but_icon
bt word[panel_but+1],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Open
@@:
stdcall [ted_can_save],edi
cmp al,1
@ -17,69 +23,111 @@ draw_but_toolbar: ;
and ecx,0xffff
@@:
inc cx
mov edx,55*65536+25
call draw_but_icon
bt word[panel_but+2],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Save
@@:
or ecx,0x40000000
inc cx
mov edx,85*65536+25
call draw_but_icon
bt word[panel_but+3],0
jnc @f
add edx,30 shl 16
call draw_but_icon ;Select word
@@:
call [ted_is_select]
cmp al,0
jne @f
or al,al
jnz @f
and ecx,0xffff
@@:
inc cx ; Cut
mov edx,110*65536+25
call draw_but_icon
inc cx
bt word[panel_but+4],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Cut
@@:
inc cx ; Copy
mov edx,135*65536+25
call draw_but_icon
mov cx,10 ; Upper
mov edx,265*65536+25
call draw_but_icon
inc cx ; Lower
mov edx,290*65536+25
call draw_but_icon
inc cx ; reverse
mov edx,315*65536+25
call draw_but_icon
inc cx
bt word[panel_but+5],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Copy
@@:
or ecx,0x40000000
cmp dword[buf],0
jne @f
and ecx,0xffff
@@:
mov cx,6 ; Paste
mov edx,160*65536+25
call draw_but_icon
inc cx
bt word[panel_but+6],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Paste
@@:
or ecx,0x40000000
inc cx
mov edx,185*65536+25
call draw_but_icon
bt word[panel_but+7],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Found
@@:
inc cx
mov edx,210*65536+25
call draw_but_icon
bt word[panel_but+8],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Replace
@@:
inc cx
mov edx,235*65536+25
call draw_but_icon
bt word[panel_but+9],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Key words
@@:
call [ted_is_select]
or al,al
jnz @f
and ecx,0xffff
@@:
inc cx
bt word[panel_but+10],0
jnc @f
add edx,30 shl 16
call draw_but_icon ;Upper
@@:
inc cx
bt word[panel_but+11],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Lower
@@:
inc cx
bt word[panel_but+12],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Reverse
@@:
or ecx,0x40000000
mov ebx,ted_tim_undo
cmp ted_tim_ch,ebx
jg @f
and ecx,0xffff
@@:
mov cx,13
mov edx,345*65536+25
call draw_but_icon
inc cx
bt word[panel_but+13],0
jnc @f
add edx,30 shl 16
call draw_but_icon ;Undo
@@:
or ecx,0x40000000
cmp ted_tim_undo,1
@ -87,29 +135,47 @@ draw_but_toolbar: ;
and ecx,0xffff
@@:
inc cx
mov edx,370*65536+25
call draw_but_icon
bt word[panel_but+14],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Redo
@@:
or ecx,0x40000000
inc cx
mov edx,400*65536+25
call draw_but_icon
bt word[panel_but+15],0
jnc @f
add edx,30 shl 16
call draw_but_icon ;Invisible on|off
@@:
inc cx
mov edx,425*65536+25
call draw_but_icon
bt word[panel_but+16],0
jnc @f
add edx,25 shl 16
call draw_but_icon
@@:
mov cx,17 ;âûáîð ôàéëà ïîäñâåòêè
mov edx,450*65536+25
call draw_but_icon
inc cx
bt word[panel_but+17],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;Âûáîð ôàéëà ïîäñâåòêè
@@:
mov cx,18 ;cp 1251 -> 866
mov edx,480*65536+25
call draw_but_icon
inc cx
bt word[panel_but+18],0
jnc @f
add edx,30 shl 16
call draw_but_icon ;cp 1251 -> 866
@@:
mov cx,19 ;cp 866 -> 1251
mov edx,505*65536+25
call draw_but_icon
inc cx
bt word[panel_but+19],0
jnc @f
add edx,25 shl 16
call draw_but_icon ;cp 866 -> 1251
@@:
popad
ret
@ -309,9 +375,7 @@ draw_but_icon:
and ecx,0xffff
imul ecx,1200
add ebx,ecx
mov ecx,20
shl ecx,16
add ecx,20
mov ecx,(20 shl 16)+20
int 0x40 ;ñòàâèì ðèñóíîê íà êíîïêó
pop ecx
@@:

View File

@ -66,7 +66,7 @@ mov ebp,lib0
;---------------------------------------------------------------------
stdcall [ted_init], tedit0
stdcall dword[tl_data_init], tree1
stdcall [tl_data_init], tree1
; OpenDialog initialisation
stdcall [OpenDialog_Init],OpenDialog_data
@ -171,54 +171,95 @@ mov ebp,lib0
cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
je .filter
;0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
stdcall dword[tl_node_add], tree1,0x10000,eax
stdcall dword[tl_cur_next], tree1
stdcall [tl_node_add], tree1,0x10000,eax
stdcall [tl_cur_next], tree1
.filter:
add eax,304
loop @b
stdcall dword[tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
stdcall [tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
.end_dir_init:
;--- load ini file ---
copy_path ini_name,sys_path,file_name,0
;window startup pozition
stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
stdcall [ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
mov word[wnd_s_pos+2],ax
stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
stdcall [ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
mov word[wnd_s_pos],ax
stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
stdcall [ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
mov word[wnd_s_pos+6],ax
stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
stdcall [ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
mov word[wnd_s_pos+4],ax
;scrool type
stdcall dword[ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
stdcall [ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
mov [wScr.type],eax
mov [hScr.type],eax
mov [ws_dir_lbox.type],eax
mov [w_scr_t3.type],eax
;symbol size
stdcall dword[ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
mov dword[tedit0.rec.width],eax
stdcall dword[ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
mov dword[tedit0.rec.height],eax
;lea eax,[eax+eax*2]
;mov dword[tedit0.rec.top],eax
;font size
stdcall dword[ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
stdcall [ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
shl eax,24
mov dword[tedit0.font_size],eax
;ª­®¯ª¨ ­  ¯ ­¥«¨
stdcall [ini_get_int],file_name,ini_sec_window,key_but_new,1
mov byte[panel_but],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_open,1
mov byte[panel_but+1],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_save,1
mov byte[panel_but+2],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_select,1
mov byte[panel_but+3],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_cut,1
mov byte[panel_but+4],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_copy,1
mov byte[panel_but+5],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_paste,1
mov byte[panel_but+6],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_find,1
mov byte[panel_but+7],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_replace,1
mov byte[panel_but+8],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_key_words,1
mov byte[panel_but+9],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_upper,1
mov byte[panel_but+10],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_lower,1
mov byte[panel_but+11],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_reverse,1
mov byte[panel_but+12],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_undo,1
mov byte[panel_but+13],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_redo,1
mov byte[panel_but+14],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_invisible,1
mov byte[panel_but+15],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_syntax_list,1
mov byte[panel_but+16],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_syntax_mode,1
mov byte[panel_but+17],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_convert_1251_866,1
mov byte[panel_but+18],al
stdcall [ini_get_int],file_name,ini_sec_window,key_but_convert_866_1251,1
mov byte[panel_but+19],al
;ä ©«®¢ë¥ à áè¨à¥­¨ï
xor edx,edx
mov ebx,synt_auto_open
@@:
;¡¥à¥¬ ¨¬ï ä ©« 
stdcall dword[ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
cmp byte[ebx],0
je @f
inc byte[key_synt_file.numb]
add ebx,32
;¡¥à¥¬ à áè¨à¥­¨ï
stdcall dword[ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
inc byte[key_synt_ext.numb]
add ebx,32
inc edx

View File

@ -7,6 +7,26 @@ symbol_w=8
symbol_h=16
font_s=16
scroll_type=0
but_new=1
but_open=1
but_save=1
but_select=1
but_cut=1
but_copy=1
but_paste=1
but_find=1
but_replace=0
but_key_words=1
but_upper=1
but_lower=1
but_reverse=0
but_undo=1
but_redo=1
but_invisible=1
but_syntax_list=1
but_syntax_mode=1
but_convert_1251_866=1
but_convert_866_1251=1
[Options]
syntax_0=asm.syn
ext_0=asm