Copy/Paste
-
- Posts: 28
- Joined: Mon Apr 27, 2009 3:37 pm
- Location: Oxford UK
Copy/Paste
We have found a problem, where copy/paste does not work correctly if copying from one get to another, unless the get we are pasting to is a multiline get. We have testing this on an older version(10.06) of fivewin and works fine. When you paste it looks like only the first letter is pasted.
Any suggestions?
Regards
Gary
Any suggestions?
Regards
Gary
Re: Copy/Paste
Here copy paste is working fine. Tested with FWH ver 11.09
Regards
Anser
Code: Select all
#include "FiveWin.ch"
Function Main()
Local oDlg,oGet1,oGet2,cVar1:=Space(30),cVar2:=space(30)
DEFINE DIALOG oDlg TITLE "Testing Copy Paste"
@01,01 GET oGet1 VAR cVar1 SIZE 100,12
@03,01 GET oGet2 VAR cVar2 SIZE 100,12
ACTIVATE DIALOG oDlg
Return nil
Anser
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Re: Copy/Paste
Could this be a xHarbour.com & FWH 11.09 compatability issue?
Can anyone tell me the source code to check for differences between FW versions and also put debug statements in?
best regards,
Pete
Can anyone tell me the source code to check for differences between FW versions and also put debug statements in?
best regards,
Pete
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Re: Copy/Paste
If you are using resources make sure the field you want to paste to has ES_AUTOHSCROLL
CONTROL "", 208, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 54, 3, 70, 12 as an example
Hth
Richard
CONTROL "", 208, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 54, 3, 70, 12 as an example
Hth
Richard
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Re: Copy/Paste
The field I just tested it on has ES_AUTOHSCROLL - I know that not all of my fields in my app has this though.
If I compile my app with FW 10.06 it's fine, 11.09 fails - weird!!
If I compile my app with FW 10.06 it's fine, 11.09 fails - weird!!
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Copy/Paste
Peter,
We are working on unicode support for GETs and it seems as I may have emailed you a modified FiveHC.lib that has a change for unicode and thats where the problem is coming from.
Please check that in FWH\source\winapi\clpbrd.c you don't have this:
The bug seems to come from Windows EnumClipboardFormats() or maybe we are using it in a wrong way. I email you a modified FiveHC.lib
Thanks,
We are working on unicode support for GETs and it seems as I may have emailed you a modified FiveHC.lib that has a change for unicode and thats where the problem is coming from.
Please check that in FWH\source\winapi\clpbrd.c you don't have this:
Code: Select all
HB_FUNC( GETCLPDATA ) // GETCLIPBOARDDATA( nFormat ) --> uData
{
WORD wType = hb_parni( 1 );
HGLOBAL hMem;
// if( ( wType == CF_TEXT ) && ( EnumClipboardFormats( CF_TEXT ) != 0 ) )
// wType = CF_UNICODETEXT;
...
Thanks,
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Copy/Paste
We are changing the previous code into this:
It seems to be working fine now
Code: Select all
if( ( wType == CF_TEXT ) && ( EnumClipboardFormats( CF_TEXT ) == CF_UNICODETEXT ) )
wType = CF_UNICODETEXT;
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Copy/Paste
Nope, we have to remove it for now. After copying an unicode text and then a normal text, it keeps reporting unicode...
// if( ( wType == CF_TEXT ) && ( EnumClipboardFormats( 0 ) == CF_UNICODETEXT ) )
// wType = CF_UNICODETEXT;
// if( ( wType == CF_TEXT ) && ( EnumClipboardFormats( 0 ) == CF_UNICODETEXT ) )
// wType = CF_UNICODETEXT;
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
Re: Copy/Paste
I found another bug. I modified the sample this way:
First:
If you mark the text in the first get and try to insert another text from the clipboard, the old text should be replaced with the new one, but nothing happens. The old text is still there.
Second:
Write some text in the second get, mark this text and insert the text from the clipboard. The old text is not replaced, but the new one is appended to the old one.
Code: Select all
#include "FiveWin.ch"
Function Main()
Local oDlg,oGet1,oGet2,cVar1:="Test clipboard", cVar2:=space(30)
DEFINE DIALOG oDlg TITLE "Testing Copy Paste"
@01,01 GET oGet1 VAR cVar1 SIZE 100,12
@03,01 GET oGet2 VAR cVar2 SIZE 100,12
ACTIVATE DIALOG oDlg
Return nil
If you mark the text in the first get and try to insert another text from the clipboard, the old text should be replaced with the new one, but nothing happens. The old text is still there.
Second:
Write some text in the second get, mark this text and insert the text from the clipboard. The old text is not replaced, but the new one is appended to the old one.
kind regards
Stefan
Stefan
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Copy/Paste
Stefan,
Class TGet was not properly processing WM_PASTE when some text was previously selected.
This is the fix for it:
So this is the right code to use:
Thanks!
Class TGet was not properly processing WM_PASTE when some text was previously selected.
This is the fix for it:
So this is the right code to use:
Code: Select all
case nMsg == WM_PASTE
if GetFocus() == ::hWnd
CallWindowProc( ::nOldProc, ::hWnd, WM_PASTE, 0, 0 )
::oGet:Buffer = GetWindowText( ::hWnd )
::oGet:Pos = GetCaretPos()[ 2 ]
::oGet:Assign()
if ::bChange != nil
Eval( ::bChange,,, Self )
endif
endif
return 0
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Copy/Paste
It seems as this change is also required under some circunstances, anyhow I appreciate if you test it and provide your feedback, thanks
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Re: Copy/Paste
Any updates on this? The code change above didnt solve my problem i'm afraid
best regards,
Pete
best regards,
Pete
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Copy/Paste
Pete,
The posted code seems to work fine, maybe you have not updated your lib properly.
We can send you the modified libs if you want to, thanks
The posted code seems to work fine, maybe you have not updated your lib properly.
We can send you the modified libs if you want to, thanks
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Re: Copy/Paste
If you can send me the lib that would be great thanks
I'll let you know how I get on
regards,
Pete
I'll let you know how I get on
regards,
Pete