45,6 → 45,10 |
call .draw_cursor |
@@: |
call .draw_text |
;;;;;;;;;;;;;;;;;;;;;;;;;; |
;¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å äãªæ¨© ¨ ¯®áâ ®¡à ¡®â稪®¢ |
;;;;;;;;;;;;;;;;;;;;;;;;;; |
.editbox_exit: |
edit_ex |
;========================================================== |
;=== ®¡à ¡®âª ª« ¢¨ âãàë ================================= |
52,7 → 56,7 |
.key: |
pusha |
test word ed_flags,ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
je .no_figure |
je .editbox_exit |
;஢¥àª ¦ â shift ? |
call .check_shift |
;---------------------------------------------------------- |
68,193 → 72,18 |
;஢¥àª ãáâ ®¢«¥ «¨ ä« £ ¯à¨ ª®â®à®¬ 㦮 ¢ë¢®¤¨âì ⮫쪮 æ¨äàë ¢ 㦮¬ ¡®ªá¥ ¥á«¨ â ª®©¥®¡å®¤¨¬®á⨠¥â 㦮 § ª®¬¥â¨à®¢ âì ¬ ªà®á |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
use_key_figures_only |
;¯à®¢¥àª shift |
@@: test word ed_flags,ed_shift_on |
je @f |
;å®¤ë¥ ¤ ë¥ edx=ed_size;ecx=ed_pos |
push eax |
mov edx,ed_size |
mov ecx,ed_pos |
pusha |
;clear |
; mov ebp,edx ;ed_size |
; call .clear_bg |
mov ebp,ed_color |
mov ebx,dword ed_shift_pos |
call .sh_cl_ |
|
.sh_nxt:popa |
call .del_char |
;;;; |
mov eax,dword ed_shift_pos |
mov ebx,ed_size |
sub ebx,eax |
mov ed_size,ebx |
pop eax |
; ¯à®¢¥à塞, 室¨âáï «¨ ªãàá®à ¢ ª®æ¥ |
@@: mov ecx,ed_size |
mov edx, ed_max |
test word ed_flags,ed_insert |
jne @f |
cmp ecx,edx |
jae .no_figure |
@@: mov ebx, ed_pos |
cmp ebx,edx |
jl @f ; ¥á«¨ ¬¥ìè¥ ¨«¨ à ¢® |
.no_figure: |
edit_ex |
.insert: test word ed_flags,ed_insert ;not word ed_insert |
je .insert_1 |
and word ed_flags,ed_insert_cl |
jmp .no_figure |
.insert_1: |
or word ed_flags,ed_insert |
jmp .no_figure |
.ins_v: |
dec dword [ebp+42];ed_size ;processing is insert |
sub esi,ecx |
add esi,ebx |
mov edi,esi |
;clear |
pusha |
mov edi,ebp |
mov ebp,ed_pos |
call .clear_bg |
popa |
jmp .In_k |
@@: ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à ¢¯à ¢® |
mov ecx,ed_size |
push edi eax |
mov ebp,edi |
mov esi,ed_text ; ª § â¥«ì ¡ãä¥à |
;㤥¬ à ¡®â âì á® áâப®© |
add esi,ecx ;add ed_size ¤®¡ ¢¨¬ max size |
mov edi,esi |
|
cmp ecx,ebx ;
᫨ ã á ¯®§¨æ¨ï ªãàá®à = ⥪ã饬ã à §¬¥àã ¯¥ç â ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®æ¥ |
je .In_k |
|
test word [ebp+40],ed_insert ;IF insert is enable â.ª. edi ¨§¬¥¥ ¤à¥á㥬 ç¥à¥§ ebp |
jne .ins_v |
;clear |
pusha |
mov edi,ebp |
mov ebp,ed_size |
call .clear_bg |
popa |
sub ecx,ebx ; ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥¨ï. |
inc edi ;¬¥á⨬ è¨ á¨¬¢®«ë ¢ ¯à ¢® |
std |
inc ecx |
@@: |
;-------- |
lodsb |
stosb |
;-------- |
loop @b |
.In_k: cld |
pop eax |
mov al,ah |
stosb |
pop edi |
; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à |
; 㢥«¨ç¨¢ ¥¬ § 票¥ à §¬¥à ¨ ¯®§¨æ¨¨ |
inc dword ed_size |
inc dword ed_pos |
call .draw_all2 |
jmp .shift;.draw_cursor_text |
.delete: |
mov edx,ed_size |
mov ecx,ed_pos |
cmp edx,ecx |
jg .bac_del |
test word ed_flags,ed_shift_on |
jne .del_bac |
edit_ex |
.bac_del: |
call .del_char |
jmp .draw_all |
|
;--- ¦ â ª« ¢¨è backspace --- |
.backspace: |
; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ? |
mov ecx,ed_pos |
test ecx,ecx |
jnz .del_bac |
test word ed_flags,ed_shift_on |
jne .bac_del |
|
edit_ex |
.del_bac: |
mov edx,ed_size |
cmp edx,ecx ;if ed_pos=ed_size |
je @f |
dec ecx |
call .del_char |
@@: test word ed_flags,ed_shift_on |
jne .bac_del |
dec dword ed_pos |
.draw_all: |
push .shift;.draw_cursor_text;eax |
|
test word ed_flags,ed_shift_on |
je @f |
mov eax,dword ed_shift_pos |
mov ebx,ed_size |
sub ebx,eax |
mov ed_size,ebx |
|
mov ebp,ed_color |
call .clear_cursor |
call .check_offset |
call .draw_bg |
ret |
@@: dec dword ed_size |
|
.draw_all2: |
and word ed_flags,ed_shift_cl |
mov ebp,ed_color |
call .clear_cursor |
call .check_offset |
mov ebp,ed_size |
call .clear_bg |
ret |
;--- ¦ â ª« ¢¨è left --- |
.left: mov ebx,ed_pos |
test ebx,ebx |
jz .sh_st_of |
or word ed_flags,ed_left_fl |
call .sh_first_sh |
dec dword ed_pos |
call .sh_enable |
jmp .draw_cursor_text |
;--- ¦ â ª« ¢¨è right --- |
.right: mov ebx,ed_pos |
cmp ebx,ed_size |
je .sh_st_of |
and word ed_flags,ed_right_fl |
call .sh_first_sh |
inc dword ed_pos |
call .sh_enable |
jmp .draw_cursor_text |
.home: |
mov ebx,ed_pos |
test ebx,ebx |
jz .sh_st_of |
call .sh_first_sh |
xor eax,eax |
mov ed_pos,eax |
call .sh_home_end |
jmp .draw_cursor_text |
.end: |
mov ebx,ed_pos |
cmp ebx,dword ed_size |
je .sh_st_of |
call .sh_first_sh |
mov eax,ed_size |
mov ed_pos,eax |
call .sh_home_end |
jmp .draw_cursor_text |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;¯à®¢¥àª shift ¡ë« «¨ ¦ â |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
are_key_shift_press |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; ¯à®¢¥à塞, 室¨âáï «¨ ªãàá®à ¢ ª®æ¥ + ¤ «ì¥©è ï ®¡à ¡®âª |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
are_key_cur_end |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;¡à ¡®âª ª« ¢¨è insert,delete.backspase,home,end,left,right |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
use_work_key |
;========================================================== |
;=== ®¡à ¡®âª ¬ëè¨ ======================================= |
;========================================================== |
273,7 → 102,7 |
and word ed_flags,ed_mouse_on_off |
xor ebx,ebx |
mov dword [mouse_flag],ebx |
edit_ex |
jmp .editbox_exit |
.mouse_left_button: |
;---------------------------------------------------------- |
;--- ¡«®ª¨à®¢ª ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ¨¨ ¨å ªãàá®à |
288,111 → 117,11 |
;--- ¯®«ãç ¥¬ ª®®à¤¨ âë ¬ëè¨ ®â®á¨â¥«ì® 0 â.¥ ¢á¥© ®¡« á⨠íªà |
;---------------------------------------------------------- |
@@: mcall 37,0 |
;---------------------------------------------------------- |
;--- ¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §ë¥ áâ®à®ë? |
;---------------------------------------------------------- |
test word ed_flags,ed_mouse_on |
jne .mouse_wigwag |
;---------------------------------------------------------- |
;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box ------------- |
;---------------------------------------------------------- |
mov ebx,[procinfo.box.top] |
add ebx,ed_top |
if scr_h eq |
else |
add ebx,scr_h |
end if |
cmp ax,bx |
jl ._blur;.mouse_end_no_focus |
|
add ebx,ed_height |
cmp ax,bx |
jg ._blur;.mouse_end_no_focus |
|
shr eax,16 |
|
mov ebx,[procinfo.box.left] |
add ebx,ed_left |
if scr_w eq |
else |
add ebx,scr_w |
end if |
cmp ax,bx |
jl ._blur;.mouse_end_no_focus |
|
add ebx,ed_width |
cmp ax,bx |
jg ._blur;.mouse_end_no_focus |
;--- ¨§¬¥ï¥¬ ¯®§¨æ¨î ªãàá®à --- |
push eax |
mov ebp,ed_color |
call .clear_cursor |
pop eax |
._mvpos: |
mov ebx,dword [procinfo.box.left] |
xor edx,edx |
sub eax,ed_left |
sub eax,ebx |
if scr_w eq |
else |
add ebx,scr_w |
sub eax,2 |
end if |
mov ebx,6 |
div bx |
add eax,ed_offset |
cmp eax,ed_size |
jna ._mshift |
mov eax,ed_size |
._mshift: |
;;;;;;; |
;;¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥¨ï ¯® shift |
;;;;;;; |
test word ed_flags,ed_shift_bac |
je @f |
mov ebp,dword ed_color |
mov ebx,dword ed_shift_pos |
push eax |
call .sh_cl_ |
and word ed_flags,ed_shift_bac_cl |
pop eax |
@@: |
test word ed_flags,ed_mouse_on |
jne @f |
|
mov dword ed_shift_pos,eax |
or word ed_flags,ed_mouse_on |
mov dword ed_pos,eax |
mov dword [mouse_flag],edi ;ãáâ ®¢¨¬ ¨¤¥â¨ä¨ª â®à |
bts word ed_flags,1 ;ãáâ ®¢ª 䮪ãá |
jmp .m_sh |
@@: |
cmp eax,dword ed_shift_pos ;¥á«¨ ¯®§¨æ¨¨ ¥ ¨§¬¥¨«¨áì |
je .mouse_ex |
mov ed_pos,eax |
mov ebp,dword shift_color |
mov ebx,dword ed_shift_pos |
call .sh_cl_ |
or word ed_flags,ed_mous_adn_b ;ãáâ ®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on + |
.m_sh: call .draw_text |
call .draw_cursor |
;---------------------------------------------------------- |
;--- ¯à®æ¥¤ãà ãáâ ®¢ª¨ 䮪ãá --------------------------- |
;---------------------------------------------------------- |
jmp .drc |
._blur: |
test word ed_flags,ed_always_focus |
jne .mouse_ex |
btr word ed_flags,1 ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
jnc .mouse_ex |
|
mov ebp,ed_color |
call .clear_cursor |
.drc: call .draw_border |
.mouse_ex: |
|
edit_ex |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;ãªæ¨ï ®¡à ¡®âª¨ ¬ë誨 ¯®«ã票¥ ª®®à¤¨ â ¨ ¯à®¢¥àª ¨å + ¢ë¤¥«¥¨ï |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
use_work_mause scr_h,scr_w |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;¡é¨¥ äãªæ¨¨ ®¡à ¡®âª¨ |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
use_general_func |
400,118 → 129,14 |
;ãªæ¨¨ ¤«ï à ¡®âë á key |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
use_key_func |
;---------------------------------------------------------- |
;--- ¯à®æ¥¤ãà à §¬ë¢ ¨ï 䮪ãá -------------------------- |
;---------------------------------------------------------- |
;.blur: |
;pusha |
;._blur: |
;btr ed_flags,1 |
;jnc @f |
;call .draw_border |
;call .clear_cursor |
;@@: |
;edit_ex |
|
;---------------------------------------------------------- |
;--- ¡à ¡®âª .mouse_wigwag |
;---------------------------------------------------------- |
.mouse_wigwag: |
shr eax,16 |
or word ed_flags,ed_shift_bac+ed_shift_on+ed_shift |
;;;;;;;;;;;;;;;;;; |
;;¯à®æ¥¤ãà ®¡à ¡®âª¨ ¯®«®¦¥¨ï ¢ë¤¥«¥®£® ⥪áâ , ª®£¤ ¯à®¨á室¨â ¢ë室 § ¯à¥¤¥«ë editbox |
;;;;;;;;;;;;;;;;;; |
mov ebx,[procinfo.box.left] |
add ebx,ed_left |
if scr_w eq |
else |
add ebx,scr_w |
end if |
cmp eax,ebx |
jb .mleft |
|
add ebx,ed_width |
cmp eax,ebx |
ja .mright |
|
sub ebx,ed_width |
|
xor edx,edx |
sub eax,ebx ; ¢ëç⨬ ¨§ ª®®à¤¨ â ¬ë誨 ¯® ®á¨ å ª®®à¤¨ âë ¤® editbox ¯® ®á¨ å |
mov ebx,6 |
div ebx |
;;;;;;;;;;;;;;;;;; |
;;¯à®æ¥¤ãà ®¡à ¡®âª¨ ¯®«®¦¥¨ï ¢ë¤¥«¥®£® ⥪áâ , ¢ ¯à¥¤¥« å ®¡« á⨠editbox |
;;;;;;;;;;;;;;;;;; |
;®«ã稫¨ ª®®à¤¨ âë ¢ eax ¬ë誨, â.¥. ªã¤ ® ¯¥à¥¬¥á⨫ áì |
;¨á®¢ ¨¥ § ªà è¥ëå ¯àאַ㣮«ì¨ª®¢ ¨ ®ç¨á⪠¨å |
add eax,ed_offset ;¤®¡ ¢¨¬ ᬥ饨¥ |
cmp eax,dword ed_size ;¥á«¨ ¢ë諨 § ¯à¥¤¥«ë, â® ¨ç¥£® ¥ ¤¥« âì |
ja .mwigvag |
.mdraw: |
mov dword ed_pos,eax ;á®åà ¨¬ ®¢®¥ § 票¥ |
;¨á®¢ ¨¥ § ªà è¥ëå ¯àאַ㣮«ì¨ª®¢ ¨ ®ç¨á⪠¨å |
mov ecx,dword ed_shift_pos |
mov ebx,dword ed_shift_pos_old |
mov dword ed_shift_pos_old,eax ;¢¥á¥¬ ®¢®¥ § 票¥ áâ ன ¯®§¨æ¨¨ ªãàá®à |
;¯à®¢¥àª ¨ à¨á®¢ ¨¥ § ªà è¥ëå ®¡« á⥩ |
cmp ecx,ebx ;¢ëïá塞 ªã¤ ¡ë«® ¤¢¨¦¥¨¥ ®¤¨ è £ § ¤ |
je .m1_shem ;¤¢¨¦¥¨ï ¥ ¡ë«® à ¥¥ |
jb .msmaller ;¤¢¨¦¥¨¥ ¡ë«® -> |
cmp ebx,eax ;¤¢¨¦¥¨¥ ¡ë«® ¤® í⮣® <- ¨ âãâ ¬ë ¯à®¢¥à塞 ᥩç á ªã¤ ¤¢¨¦¥¨¥ ¯à®¨á室¨â |
ja .m1_shem ;¥á«¨ ¡ë«® ¤¢¨¦¥¨¥ <- ⮠㦮 § ªà á¨âì ®¡« áâì |
je .mwigvag ;¥á«¨ ¨§¬¥¥¨ï ¥ ¡ë«®, â® ¨ç¥£® ¥ ¤¥« âì |
mov ebp,ed_color ;âãâ 㦮 ®ç¨áâ¨âì ®¡« áâì c ed_pos ed_shift_pos_old |
;¢å®¤ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos |
call .sh_cl_ |
jmp .mwigvag |
.msmaller: |
cmp ebx,eax |
jb .m1_shem |
mov ebp,ed_color |
;¢å®¤ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos |
call .sh_cl_ |
jmp .mwigvag |
;alike = |
.m1_shem: |
mov ebp,shift_color |
;¢å®¤ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos |
mov ebx,ecx |
call .sh_cl_ |
jmp .mwigvag |
.mwigvag: |
and word ed_flags,ed_shift_mcl |
jmp .draw_cursor_text |
; popa |
; ret |
.mleft: |
mov eax,ed_pos |
cmp eax,0 |
jbe .mwigvag |
dec eax |
call .check_offset |
push eax |
mov ebx,ed_shift_pos |
mov ebp,shift_color |
call .sh_cl_ |
pop eax |
jmp .mdraw |
.mright: |
mov eax,ed_pos |
mov ebx,ed_size |
cmp eax,ebx |
jae .mwigvag |
inc eax |
call .check_offset |
mov ebx,ed_shift_pos |
mov ebp,shift_color |
push eax |
call .sh_cl_ |
pop eax |
jmp .mdraw |
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;ãªæ¨¨ ¤«ï à ¡®âë á mouse |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
use_mouse_func scr_w |
} |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;Bit mask from editbox |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
ed_figure_only= 1000000000000000b ;®¤¨ ᨬ¢®«ë |
ed_always_focus= 100000000000000b |
ed_focus= 10b ;䮪ãá ¯à¨«®¦¥¨ï |