Page 1 of 1

Copy / Paste Behaviour

PostPosted: Mon Apr 25, 2022 1:29 am
by wartiaga
Hi, If I copy this caracters 01220036000106 and paste in another get I get this caracters 01220036000.
Any idea?

Thanks.

Re: Copy / Paste Behaviour

PostPosted: Mon Apr 25, 2022 7:35 am
by Enrico Maria Giordano
Add ES_AUTOHSCROLL style to the GET.

EMG

Re: Copy / Paste Behaviour

PostPosted: Tue Apr 26, 2022 3:10 am
by wartiaga
Enrico Maria Giordano wrote:Add ES_AUTOHSCROLL style to the GET.

EMG


Perfect! Thanks Enrico!

Re: Copy / Paste Behaviour

PostPosted: Tue Apr 26, 2022 6:13 am
by Uwe.Diemer
can i set this global for all gets
TX

Re: Copy / Paste Behaviour

PostPosted: Tue Apr 26, 2022 7:32 am
by Enrico Maria Giordano
No, as far as I know.

EMG

Re: Copy / Paste Behaviour

PostPosted: Wed Apr 27, 2022 7:40 am
by Uwe.Diemer
Hmmmm

i have a lot of gets

Re: Copy / Paste Behaviour

PostPosted: Wed Apr 27, 2022 8:31 am
by Otto
Hello Uwe,
you could change the get function and link it in.
Best regards,
Otto

Re: Copy / Paste Behaviour

PostPosted: Wed Apr 27, 2022 8:38 am
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 ?

Re: Copy / Paste Behaviour

PostPosted: Wed Apr 27, 2022 1:08 pm
by Uwe.Diemer
All are from resources

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

tx

Re: Copy / Paste Behaviour

PostPosted: Wed Apr 27, 2022 1:27 pm
by Enrico Maria Giordano
So it should be easy with a find and replace operation.

EMG

Re: Copy / Paste Behaviour

PostPosted: Thu Apr 28, 2022 4:02 pm
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.

Re: Copy / Paste Behaviour

PostPosted: Thu Apr 28, 2022 4:56 pm
by nageswaragunupudi
Code: Select all  Expand view
#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

Re: Copy / Paste Behaviour

PostPosted: Mon May 02, 2022 5:54 pm
by wartiaga
nageswaragunupudi wrote:
Code: Select all  Expand view
#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!

Re: Copy / Paste Behaviour

PostPosted: Tue May 03, 2022 3:54 am
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.