forked from KolibriOS/kolibrios
add select word by double click
git-svn-id: svn://kolibrios.org@6239 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
b28721dd10
commit
d112b67c4c
@ -1,13 +1,3 @@
|
|||||||
struct FileInfoBlock
|
|
||||||
Function dd ?
|
|
||||||
Position dd ?
|
|
||||||
Flags dd ?
|
|
||||||
Count dd ?
|
|
||||||
Buffer dd ?
|
|
||||||
db ?
|
|
||||||
FileName dd ?
|
|
||||||
ends
|
|
||||||
|
|
||||||
struct symbol
|
struct symbol
|
||||||
c db ? ; +0 ᨬ¢®«
|
c db ? ; +0 ᨬ¢®«
|
||||||
col db ? ; +1 梥â
|
col db ? ; +1 梥â
|
||||||
@ -412,22 +402,19 @@ but_find_key_w:
|
|||||||
;description:
|
;description:
|
||||||
; ¢ë¤¥«¥¨¥/áªàë⨥ ¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
|
; ¢ë¤¥«¥¨¥/áªàë⨥ ¥¯¥ç â ¥¬ëå ᨬ¢®«®¢
|
||||||
align 4
|
align 4
|
||||||
proc but_sumb_invis, edit:dword
|
proc but_sumb_invis uses edi, edit:dword
|
||||||
push edi
|
|
||||||
mov edi,dword[edit]
|
mov edi,dword[edit]
|
||||||
|
|
||||||
xor ted_mode_invis,1
|
xor ted_mode_invis,1
|
||||||
call draw_but_toolbar
|
call draw_but_toolbar
|
||||||
stdcall [ted_draw],edi
|
stdcall [ted_draw],edi
|
||||||
pop edi
|
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;description:
|
;description:
|
||||||
; ¢ë¤¥«¥¨¥/áªàë⨥ ª«î祢ëå á«®¢
|
; ¢ë¤¥«¥¨¥/áªàë⨥ ª«î祢ëå á«®¢
|
||||||
align 4
|
align 4
|
||||||
proc but_k_words_show, edit:dword
|
proc but_k_words_show uses edi, edit:dword
|
||||||
push edi
|
|
||||||
mov edi,dword[edit]
|
mov edi,dword[edit]
|
||||||
|
|
||||||
xor ted_mode_color,1
|
xor ted_mode_color,1
|
||||||
@ -437,15 +424,13 @@ proc but_k_words_show, edit:dword
|
|||||||
@@:
|
@@:
|
||||||
call draw_but_toolbar
|
call draw_but_toolbar
|
||||||
stdcall [ted_draw],edi
|
stdcall [ted_draw],edi
|
||||||
pop edi
|
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;description:
|
;description:
|
||||||
; ¢ë§®¢/áªàë⨥ ¯ ¥«¨ á ä ©« ¬¨ á¨â ªá¨á
|
; ¢ë§®¢/áªàë⨥ ¯ ¥«¨ á ä ©« ¬¨ á¨â ªá¨á
|
||||||
align 4
|
align 4
|
||||||
proc but_synt_show, edit:dword
|
proc but_synt_show uses edi, edit:dword
|
||||||
push edi
|
|
||||||
mov edi,[edit]
|
mov edi,[edit]
|
||||||
|
|
||||||
cmp ted_panel_id,TED_PANEL_NULL
|
cmp ted_panel_id,TED_PANEL_NULL
|
||||||
@ -459,6 +444,5 @@ proc but_synt_show, edit:dword
|
|||||||
.e_if:
|
.e_if:
|
||||||
call EvSize
|
call EvSize
|
||||||
stdcall [ted_draw],edi
|
stdcall [ted_draw],edi
|
||||||
pop edi
|
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
@ -14,11 +14,9 @@ maxSyntaxFileSize equ 410000
|
|||||||
TOOLBAR_ICONS_SIZE equ 1200*20
|
TOOLBAR_ICONS_SIZE equ 1200*20
|
||||||
|
|
||||||
include '../../proc32.inc'
|
include '../../proc32.inc'
|
||||||
;include '../../config.inc'
|
|
||||||
include '../../macros.inc'
|
include '../../macros.inc'
|
||||||
include '../../dll.inc'
|
|
||||||
include '../../KOSfuncs.inc'
|
include '../../KOSfuncs.inc'
|
||||||
include '../../develop/libraries/box_lib/load_lib.mac'
|
include '../../load_img.inc'
|
||||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||||
include '../../system/skincfg/trunk/kglobals.inc'
|
include '../../system/skincfg/trunk/kglobals.inc'
|
||||||
include '../../system/skincfg/trunk/unpacker.inc'
|
include '../../system/skincfg/trunk/unpacker.inc'
|
||||||
@ -33,50 +31,6 @@ include 'wnd_k_words.inc'
|
|||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||||
|
|
||||||
|
|
||||||
;Œ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥¨© á ¨á¯®«ì§®¢ ¨¥¬ ¡¨¡«¨®â¥ª¨ libimg.obj
|
|
||||||
;¤«ï ¨á¯®«ì§®¢ ¨ï ¬ ªà®á ã¦ë ¯¥à¥¬¥ë¥:
|
|
||||||
; - run_file_70 FileInfoBlock
|
|
||||||
; - image_data dd 0
|
|
||||||
macro load_image_file path,buf,size
|
|
||||||
{
|
|
||||||
;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
|
|
||||||
if path eqtype '' ;¯à®¢¥à塞 § ¤ «¨ áâப®© ¯ à ¬¥âà path
|
|
||||||
jmp @f
|
|
||||||
local .path_str
|
|
||||||
.path_str db path ;ä®à¬¨à㥬 «®ª «ìãî ¯¥à¥¬¥ãî
|
|
||||||
db 0
|
|
||||||
@@:
|
|
||||||
;32 - áâ ¤ àâë© ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥ ¡ëâì ¡ãä¥à á á¨áâ¥¬ë¬ ¯ã⥬
|
|
||||||
copy_path .path_str,[32],file_name,0
|
|
||||||
else
|
|
||||||
copy_path path,[32],file_name,0 ;ä®à¬¨à㥬 ¯®«ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ® ¢ ®¤®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
|
|
||||||
end if
|
|
||||||
|
|
||||||
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥¨ï
|
|
||||||
mov [buf],eax
|
|
||||||
|
|
||||||
mov [run_file_70.Function], SSF_READ_FILE
|
|
||||||
mov [run_file_70.Position], 0
|
|
||||||
mov [run_file_70.Flags], 0
|
|
||||||
mov [run_file_70.Count], dword size
|
|
||||||
m2m [run_file_70.Buffer], eax
|
|
||||||
mov byte[run_file_70+20], 0
|
|
||||||
mov [run_file_70.FileName], file_name
|
|
||||||
mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥¨ï
|
|
||||||
cmp ebx,0xffffffff
|
|
||||||
je @f
|
|
||||||
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥ë© ¡ãä¥à image_data
|
|
||||||
stdcall dword[img_decode], dword[buf],ebx,0
|
|
||||||
mov dword[image_data],eax
|
|
||||||
;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥¨¥ ª ä®à¬ âã rgb
|
|
||||||
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
|
|
||||||
;㤠«ï¥¬ ¢à¥¬¥ë© ¡ãä¥à image_data
|
|
||||||
stdcall dword[img_destroy], dword[image_data]
|
|
||||||
@@:
|
|
||||||
}
|
|
||||||
|
|
||||||
image_data dd 0 ;㪠§ â¥«ì ¢à¥¬¥ãî ¯ ¬ïâì. ¤«ï 㦥 ¯à¥®¡à §®¢ ¨ï ¨§®¡à ¦¥¨ï
|
|
||||||
icon_tl_sys dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï åà ¥¨ï á¨á⥬ëå ¨ª®®ª
|
icon_tl_sys dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï åà ¥¨ï á¨á⥬ëå ¨ª®®ª
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
@ -190,18 +144,18 @@ mov ebp,lib0
|
|||||||
stdcall [ksubmenu_add], [main_menu], eax
|
stdcall [ksubmenu_add], [main_menu], eax
|
||||||
|
|
||||||
; init toolbar file
|
; init toolbar file
|
||||||
load_image_file 'te_icon.png', bmp_icon,TOOLBAR_ICONS_SIZE*2 ;㬮¦¥¨¥ 2 ¤«ï á¥àëå ª®¯®ª
|
load_image_file 'te_icon.png', bmp_icon,,,6 ;6 ¤«ï á¥àëå ª®¯®ª
|
||||||
mov eax,[bmp_icon]
|
mov eax,[bmp_icon]
|
||||||
add eax,TOOLBAR_ICONS_SIZE
|
add eax,TOOLBAR_ICONS_SIZE
|
||||||
stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
|
stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
; ç¨â ¥¬ ä ©« á ªãàá®à ¬¨ ¨ «¨¨ï¬¨
|
; ç¨â ¥¬ ä ©« á ªãàá®à ¬¨ ¨ «¨¨ï¬¨
|
||||||
load_image_file 'tl_sys_16.png', icon_tl_sys,54+3*256*13
|
load_image_file 'tl_sys_16.png', icon_tl_sys
|
||||||
mov eax,dword[icon_tl_sys]
|
mov eax,dword[icon_tl_sys]
|
||||||
mov dword[tree1.data_img_sys],eax
|
mov dword[tree1.data_img_sys],eax
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
; ç¨â ¥¬ ä ©« á ¨ª®ª ¬¨ 㧫®¢
|
; ç¨â ¥¬ ä ©« á ¨ª®ª ¬¨ 㧫®¢
|
||||||
load_image_file 'tl_nod_16.png', icon_tl_sys,54+3*256*2
|
load_image_file 'tl_nod_16.png', icon_tl_sys
|
||||||
mov eax,dword[icon_tl_sys]
|
mov eax,dword[icon_tl_sys]
|
||||||
mov dword[tree1.data_img],eax
|
mov dword[tree1.data_img],eax
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
@ -282,11 +236,11 @@ mov ebp,lib0
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
align 4
|
align 16
|
||||||
red_win:
|
red_win:
|
||||||
call draw_window
|
call draw_window
|
||||||
|
|
||||||
align 4
|
align 16
|
||||||
still:
|
still:
|
||||||
mcall SF_WAIT_EVENT
|
mcall SF_WAIT_EVENT
|
||||||
cmp dword[exit_code],1
|
cmp dword[exit_code],1
|
||||||
@ -304,7 +258,7 @@ still:
|
|||||||
@@:
|
@@:
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
align 4
|
align 16
|
||||||
draw_window:
|
draw_window:
|
||||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||||
|
|
||||||
@ -326,25 +280,39 @@ draw_window:
|
|||||||
mcall SF_REDRAW,SSF_END_DRAW
|
mcall SF_REDRAW,SSF_END_DRAW
|
||||||
ret
|
ret
|
||||||
|
|
||||||
align 4
|
align 16
|
||||||
mouse:
|
mouse:
|
||||||
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
|
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
|
||||||
|
|
||||||
|
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||||
|
cmp word[tedit0.wnd.top],ax
|
||||||
|
jg .no_edit
|
||||||
|
shr eax,16
|
||||||
|
cmp word[tedit0.wnd.left],ax
|
||||||
|
jg .no_edit
|
||||||
|
mcall SF_MOUSE_GET,SSF_BUTTON_EXT
|
||||||
|
bt eax,24 ;¤¢®©®© 饫çñª «¥¢®© ª®¯ª®©
|
||||||
|
jnc @f
|
||||||
|
stdcall [ted_but_select_word], tedit0
|
||||||
|
jmp still
|
||||||
|
@@:
|
||||||
stdcall [ted_mouse], tedit0
|
stdcall [ted_mouse], tedit0
|
||||||
|
.no_edit:
|
||||||
|
|
||||||
cmp byte[tedit0.panel_id],TED_PANEL_FIND ;if not panel
|
cmp byte[tedit0.panel_id],TED_PANEL_FIND ;if not panel
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [edit_box_mouse], dword edit2
|
stdcall [edit_box_mouse], edit2
|
||||||
@@:
|
@@:
|
||||||
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX ;if not panel
|
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX ;if not panel
|
||||||
jne .mouse_end
|
jne @f
|
||||||
stdcall [tl_mouse], tree1
|
stdcall [tl_mouse], tree1
|
||||||
.mouse_end:
|
@@:
|
||||||
jmp still
|
jmp still
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
|
|
||||||
;output:
|
;output:
|
||||||
; ah = symbol
|
; ah = symbol
|
||||||
align 4
|
align 16
|
||||||
proc KeyConvertToASCII uses ebx, table:dword
|
proc KeyConvertToASCII uses ebx, table:dword
|
||||||
mov ebx,dword[table] ;convert scan to ascii
|
mov ebx,dword[table] ;convert scan to ascii
|
||||||
ror ax,8
|
ror ax,8
|
||||||
@ -354,7 +322,7 @@ proc KeyConvertToASCII uses ebx, table:dword
|
|||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
align 4
|
align 16
|
||||||
key:
|
key:
|
||||||
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
|
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
|
||||||
xor esi,esi
|
xor esi,esi
|
||||||
@ -405,98 +373,119 @@ key:
|
|||||||
stdcall [ted_key], tedit0, conv_tabl,esi
|
stdcall [ted_key], tedit0, conv_tabl,esi
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
align 4
|
align 16
|
||||||
button:
|
button:
|
||||||
|
|
||||||
mcall SF_GET_BUTTON
|
mcall SF_GET_BUTTON
|
||||||
cmp ah,3
|
cmp ah,3
|
||||||
jne @f
|
jne @f
|
||||||
call ted_but_new_file
|
call ted_but_new_file
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,4
|
cmp ah,4
|
||||||
jne @f
|
jne @f
|
||||||
call ted_but_open_file
|
call ted_but_open_file
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,5
|
cmp ah,5
|
||||||
jne @f
|
jne @f
|
||||||
call ted_but_save_file
|
call ted_but_save_file
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,6
|
cmp ah,6
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_select_word], tedit0
|
stdcall [ted_but_select_word], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,7
|
cmp ah,7
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_cut], tedit0
|
stdcall [ted_but_cut], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,8
|
cmp ah,8
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_copy], tedit0
|
stdcall [ted_but_copy], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,9
|
cmp ah,9
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_paste], tedit0
|
stdcall [ted_but_paste], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,10
|
cmp ah,10
|
||||||
jne @f
|
jne @f
|
||||||
call ted_but_find
|
call ted_but_find
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,11
|
cmp ah,11
|
||||||
jne @f
|
jne @f
|
||||||
call but_replace
|
call but_replace
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,12
|
cmp ah,12
|
||||||
jne @f
|
jne @f
|
||||||
call but_find_key_w
|
call but_find_key_w
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,13
|
cmp ah,13
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_sumb_upper], tedit0
|
stdcall [ted_but_sumb_upper], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,14
|
cmp ah,14
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_sumb_lover], tedit0
|
stdcall [ted_but_sumb_lover], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,15
|
cmp ah,15
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_reverse], tedit0
|
stdcall [ted_but_reverse], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,16
|
cmp ah,16
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_undo], tedit0
|
stdcall [ted_but_undo], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,17
|
cmp ah,17
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_redo], tedit0
|
stdcall [ted_but_redo], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,18
|
cmp ah,18
|
||||||
jne @f
|
jne @f
|
||||||
stdcall but_sumb_invis, tedit0
|
stdcall but_sumb_invis, tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,19
|
cmp ah,19
|
||||||
jne @f
|
jne @f
|
||||||
stdcall but_k_words_show, tedit0
|
stdcall but_k_words_show, tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,20
|
cmp ah,20
|
||||||
jne @f
|
jne @f
|
||||||
stdcall but_synt_show, tedit0
|
stdcall but_synt_show, tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,21
|
cmp ah,21
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_convert_by_table],tedit0,tbl_1251_866
|
stdcall [ted_but_convert_by_table],tedit0,tbl_1251_866
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,22
|
cmp ah,22
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_convert_by_table],tedit0,tbl_866_1251
|
stdcall [ted_but_convert_by_table],tedit0,tbl_866_1251
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
cmp ah,200
|
cmp ah,200
|
||||||
jne @f
|
jne @f
|
||||||
stdcall ted_but_open_syntax, tedit0
|
stdcall ted_but_open_syntax, tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,201
|
cmp ah,201
|
||||||
jne @f
|
jne @f
|
||||||
stdcall [ted_but_find_next], tedit0
|
stdcall [ted_but_find_next], tedit0
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
cmp ah,1
|
cmp ah,1
|
||||||
|
Loading…
Reference in New Issue
Block a user