Tinypad - fix r.4487 for popup window.

git-svn-id: svn://kolibrios.org@4489 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2014-01-19 22:06:48 +00:00
parent de218dc14a
commit 30559d9cdb
3 changed files with 53 additions and 1 deletions

View File

@ -96,6 +96,8 @@ just_from_popup db ?
bot_mode db ? bot_mode db ?
bot_mode2 db ? bot_mode2 db ?
popup_valid_text db ?
align 4 align 4
bot_dlg_height dd ? bot_dlg_height dd ?

View File

@ -123,6 +123,55 @@ get_from_clipboard:
popad popad
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
check_clipboard_for_popup:
pushad
mov [popup_valid_text],0
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
mov [clipboard_buf],eax
; check contents of container
mov ebx,[eax+4]
; check for text
test ebx,ebx
jnz .remove_area
mov ebx,[eax+8]
; check for cp866
cmp bl,1
jnz .remove_area
.yes_valid_text:
mov [popup_valid_text],1
; remove unnecessary memory area
.remove_area:
xor eax,eax
stdcall mem.ReAlloc,[clipboard_buf],eax
mov [clipboard_buf],eax
;--------------------------------------
.exit:
popad
ret
;-----------------------------------------------------------------------------
convert_clipboard_buf_to_copy_buf: convert_clipboard_buf_to_copy_buf:
mov edi,[copy_buf] mov edi,[copy_buf]
mov ebx,edi mov ebx,edi

View File

@ -240,7 +240,8 @@ onshow:
.edit: .edit:
or byte[mm.Edit+2],0x01 or byte[mm.Edit+2],0x01
cmp [copy_size],0 call check_clipboard_for_popup
cmp [popup_valid_text],0
jne @f jne @f
and byte[mm.Edit+2],0xFE and byte[mm.Edit+2],0xFE
@@: or dword[mm.Edit+0],0x01000101 @@: or dword[mm.Edit+0],0x01000101