Copy / Paste Behaviour

Post Reply
wartiaga
Posts: 220
Joined: Wed May 25, 2016 1:04 am

Copy / Paste Behaviour

Post by wartiaga »

Hi, If I copy this caracters 01220036000106 and paste in another get I get this caracters 01220036000.
Any idea?

Thanks.
User avatar
Enrico Maria Giordano
Posts: 8784
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 9 times
Contact:

Re: Copy / Paste Behaviour

Post by Enrico Maria Giordano »

Add ES_AUTOHSCROLL style to the GET.

EMG
wartiaga
Posts: 220
Joined: Wed May 25, 2016 1:04 am

Re: Copy / Paste Behaviour

Post by wartiaga »

Enrico Maria Giordano wrote:Add ES_AUTOHSCROLL style to the GET.

EMG


Perfect! Thanks Enrico!
User avatar
Uwe.Diemer
Posts: 98
Joined: Mon Aug 09, 2010 11:00 am

Re: Copy / Paste Behaviour

Post by Uwe.Diemer »

can i set this global for all gets
TX
User avatar
Uwe.Diemer
Posts: 98
Joined: Mon Aug 09, 2010 11:00 am

Re: Copy / Paste Behaviour

Post by Uwe.Diemer »

Hmmmm

i have a lot of gets
User avatar
Otto
Posts: 6426
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 48 times
Been thanked: 14 times
Contact:

Re: Copy / Paste Behaviour

Post by Otto »

Hello Uwe,
you could change the get function and link it in.
Best regards,
Otto
User avatar
Antonio Linares
Site Admin
Posts: 42832
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 156 times
Been thanked: 121 times
Contact:

Re: Copy / Paste Behaviour

Post by Antonio Linares »

Dear Uwe,

Are all your GETs from resources or do you create them from source code ?

do you plan to modify all of them ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Uwe.Diemer
Posts: 98
Joined: Mon Aug 09, 2010 11:00 am

Re: Copy / Paste Behaviour

Post by Uwe.Diemer »

All are from resources

The fiels have a space of 30 C but it cuts after 17

tx
User avatar
Enrico Maria Giordano
Posts: 8784
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 9 times
Contact:

Re: Copy / Paste Behaviour

Post by Enrico Maria Giordano »

So it should be easy with a find and replace operation.

EMG
User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 11 times
Contact:

Re: Copy / Paste Behaviour

Post by nageswaragunupudi »

For Gets created by code, Get class adds ES_AUTOHSCROLL style.
For Gets created from RESOURCE, Get class automatically adds ES_AUTOHSCROLL style if not already included in the RC file.

So, you can be assured that all Gets do have the ES_AUTOHSCROLL style, whether you added the style in your RC file or not.

So no need to change your programs or rc files.

Your problem is not whether or not the Get has ES_AUTOHSCROLL.

Hi, If I copy this caracters 01220036000106 and paste in another get I get this caracters 01220036000.


The real problem is the width of the Get Variable. The width of the Get variable you have used must be 11.

Then the Get does not allow you to enter characters exceeding 11 or in case of Paste, it truncates the value to 11. That is what is happening in your case.

If you have an intention to paste larger values, create the Get with character variable of adequate width.

Don't worry about horizontal scrolling. That is automatically built into every Get.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 11 times
Contact:

Re: Copy / Paste Behaviour

Post by nageswaragunupudi »

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oDlg, oFont, oGet1, oGet2, oGet3
   local cVal1 := "ABCDEFGHIJK"
   local cVal2 := PADR( "EFGH", 15 )
   local cVal3 := PADR( "SCRL", 20 )

   SetGetColorFocus()

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-20
   DEFINE DIALOG oDlg SIZE 400,200 PIXEL TRUEPIXEL FONT oFont

   @  40, 40 GET oGet1 VAR cVal1 SIZE 200,30 PIXEL OF oDlg
   @  90, 40 GET oGet2 VAR cVal2 SIZE 200,30 PIXEL OF oDlg
   @ 140, 40 GET oGet3 VAR cVal3 SIZE 100,30 PIXEL OF oDlg


   @  40,270 SAY "VarLen-11" SIZE 100,30 PIXEL OF oDlg
   @  90,270 SAY "VarLen-15" SIZE 100,30 PIXEL OF oDlg
   @ 140,270 SAY "VarLen-20" SIZE 100,30 PIXEL OF oDlg


   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


Image
Regards

G. N. Rao.
Hyderabad, India
wartiaga
Posts: 220
Joined: Wed May 25, 2016 1:04 am

Re: Copy / Paste Behaviour

Post by wartiaga »

nageswaragunupudi wrote:

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oDlg, oFont, oGet1, oGet2, oGet3
   local cVal1 := "ABCDEFGHIJK"
   local cVal2 := PADR( "EFGH", 15 )
   local cVal3 := PADR( "SCRL", 20 )

   SetGetColorFocus()

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-20
   DEFINE DIALOG oDlg SIZE 400,200 PIXEL TRUEPIXEL FONT oFont

   @  40, 40 GET oGet1 VAR cVal1 SIZE 200,30 PIXEL OF oDlg
   @  90, 40 GET oGet2 VAR cVal2 SIZE 200,30 PIXEL OF oDlg
   @ 140, 40 GET oGet3 VAR cVal3 SIZE 100,30 PIXEL OF oDlg


   @  40,270 SAY "VarLen-11" SIZE 100,30 PIXEL OF oDlg
   @  90,270 SAY "VarLen-15" SIZE 100,30 PIXEL OF oDlg
   @ 140,270 SAY "VarLen-20" SIZE 100,30 PIXEL OF oDlg


   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


Image


Hi Mr. Nages,

What version of fivewin did you use to compile your example? The behavior I mentioned happens in a certain version of fivewin, 1811. The get variable size is correct, it was declared with size 14.
Thank you!
User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 11 times
Contact:

Re: Copy / Paste Behaviour

Post by nageswaragunupudi »

What version of fivewin did you use to compile your example? The behavior I mentioned happens in a certain version of fivewin, 1811. The get variable size is correct, it was declared with size 14.
Thank you!

Please take a little time copying the sample to your fwh1811 samples folder and test it. I am sure you did not have time to test it with fwh1811.

Even with fwh1811 also the behavior should be and in fact is EXACTLY the same.
Tested just now.

This has nothing to do with FWH.

It is the Clipper/Harbour GET class that does not allow entry of characters exceeding the length of the variable. This behavior is consistent from the first version of Clipper till today with (x)Harbour and we should all be familiar with it for years.
Regards

G. N. Rao.
Hyderabad, India
Post Reply