8,6 → 8,7 |
edit_box: |
.draw: |
pushad |
.draw_1: |
;--- à¨á㥬 à ¬ªã --- |
mov edi,dword [esp+36] |
call .draw_border ; ãªæ¨ï áâ ¡¨«ì |
68,7 → 69,7 |
pop eax |
;-------------------------------------- |
;஢¥àª ¦ â shift ? |
call edit_box_key.check_shift |
call edit_box_key.check_shift_ctrl_alt |
;---------------------------------------------------------- |
;--- ¯à®¢¥à塞, çâ® ¦ â® -------------------------------- |
;---------------------------------------------------------- |
86,6 → 87,17 |
jz edit_box_key.end |
cmp ah,185 ;insert |
jz edit_box_key.insert |
; ª®¬¡¨ 樨 Ctrl + ª« ¢¨è |
test word ed_flags,ed_ctrl_on |
jz @f |
; ¯à®¢¥àª ᪠ª®¤ |
ror eax,8 |
cmp ah,46 ; Ctrl + C |
je edit_box_key.ctrl_c |
cmp ah,47 ; Ctrl + V |
je edit_box_key.ctrl_v |
rol eax,8 |
@@: |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; £«ãèª ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢¨§ â.¥. ¯à¨ ®¡ à㦥¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
779,12 → 791,22 |
;;;;;;;;;;;;;;;;;; |
;;஢¥àª ¦ â «¨ shift |
;;;;;;;;;;;;;;;;;; |
edit_box_key.check_shift: |
edit_box_key.check_shift_ctrl_alt: |
pusha ;á®åà ¨¬ ¢á¥ ॣ¨áâàë |
mcall 66,3 |
test al,0x03 |
test al,11b |
je @f |
or word ed_flags,ed_shift ;ãáâ ®¢¨¬ ä« £ |
or word ed_flags,ed_shift ;ãáâ ®¢¨¬ ä« £ Shift |
@@: |
and word ed_flags,ed_ctrl_off ; ®ç¨á⨬ ä« £ Ctrl |
test al,1100b |
je @f |
or word ed_flags,ed_ctrl_on ;ãáâ ®¢¨¬ ä« £ Ctrl |
@@: |
and word ed_flags,ed_alt_off ; ®ç¨á⨬ ä« £ Alt |
test al,110000b |
je @f |
or word ed_flags,ed_alt_on ;ãáâ ®¢¨¬ ä« £ Alt |
@@:edit_ex |
} |
|
1052,6 → 1074,112 |
mov ed_pos,eax |
call edit_box_key.sh_home_end |
jmp edit_box.draw_cursor_text |
;----------------------------------------------------------------------------- |
edit_box_key.ctrl_c: |
; add memory area |
mov ecx,ed_size |
add ecx,3*4 |
mcall 68,12 |
; building the clipboard slot header |
xor ecx,ecx |
mov [eax+4],ecx ; type 'text' |
inc ecx |
mov [eax+8],ecx ; cp866 text encoding |
mov ecx,ed_size |
add ecx,3*4 |
mov [eax],ecx |
sub ecx,3*4 |
; copy data |
mov esi,ed_text |
push edi |
mov edi,eax |
add edi,3*4 |
cld |
rep movsb |
pop edi |
; put slot to the kernel clipboard |
mov edx,eax |
mov ecx,[edx] |
push eax |
mcall 54,2 |
pop ecx |
; remove unnecessary memory area |
mcall 68,13 |
;-------------------------------------- |
.exit: |
jmp edit_box.editbox_exit |
;----------------------------------------------------------------------------- |
edit_box_key.ctrl_v: |
mcall 54,0 |
; no slots of clipboard ? |
test eax,eax |
jz .exit |
; main list area not found ? |
inc eax |
test eax,eax |
jz .exit |
|
sub eax,2 |
mov ecx,eax |
mcall 54,1 |
; main list area not found ? |
inc eax |
test eax,eax |
jz .exit |
; error ? |
sub eax,2 |
test eax,eax |
jz .exit |
|
inc eax |
; check contents of container |
mov ebx,[eax+4] |
; check for text |
test ebx,ebx |
jnz .no_valid_text |
|
mov ebx,[eax+8] |
; check for cp866 |
cmp bl,1 |
jnz .no_valid_text |
|
mov ecx,[eax] |
sub ecx,3*4 |
cmp ecx,ed_max |
jb @f |
|
mov ecx,ed_max |
@@: |
mov esi,eax |
add esi,3*4 |
mov ed_size,ecx |
mov ed_pos,ecx |
push eax edi |
mov edi,ed_text |
cld |
@@: |
lodsb |
cmp al,0x0d ; EOS (end of string) |
je .replace |
|
cmp al,0x0a ; EOS (end of string) |
jne .continue |
.replace: |
mov al,0x20 ; space |
.continue: |
stosb |
dec ecx |
jnz @b |
; rep movsb |
pop edi eax |
;-------------------------------------- |
.no_valid_text: |
; remove unnecessary memory area |
mov ecx,eax |
mcall 68,13 |
;-------------------------------------- |
.exit: |
jmp edit_box.draw_1 |
} |
|
macro use_mouse_func |