Copy / Paste Behaviour

Copy / Paste Behaviour

Postby wartiaga » Mon Apr 25, 2022 1:29 am

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

Thanks.
wartiaga
 
Posts: 211
Joined: Wed May 25, 2016 1:04 am

Re: Copy / Paste Behaviour

Postby Enrico Maria Giordano » Mon Apr 25, 2022 7:35 am

Add ES_AUTOHSCROLL style to the GET.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Copy / Paste Behaviour

Postby wartiaga » Tue Apr 26, 2022 3:10 am

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

EMG


Perfect! Thanks Enrico!
wartiaga
 
Posts: 211
Joined: Wed May 25, 2016 1:04 am

Re: Copy / Paste Behaviour

Postby Uwe.Diemer » Tue Apr 26, 2022 6:13 am

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

Postby Uwe.Diemer » Wed Apr 27, 2022 7:40 am

Hmmmm

i have a lot of gets
User avatar
Uwe.Diemer
 
Posts: 98
Joined: Mon Aug 09, 2010 11:00 am

Re: Copy / Paste Behaviour

Postby Otto » Wed Apr 27, 2022 8:31 am

Hello Uwe,
you could change the get function and link it in.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: Copy / Paste Behaviour

Postby Antonio Linares » Wed Apr 27, 2022 8:38 am

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
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Copy / Paste Behaviour

Postby Uwe.Diemer » Wed Apr 27, 2022 1:08 pm

All are from resources

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

tx
User avatar
Uwe.Diemer
 
Posts: 98
Joined: Mon Aug 09, 2010 11:00 am

Re: Copy / Paste Behaviour

Postby Enrico Maria Giordano » Wed Apr 27, 2022 1:27 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Copy / Paste Behaviour

Postby nageswaragunupudi » Thu Apr 28, 2022 4:02 pm

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: 10627
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Copy / Paste Behaviour

Postby nageswaragunupudi » Thu Apr 28, 2022 4:56 pm

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10627
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Copy / Paste Behaviour

Postby wartiaga » Mon May 02, 2022 5:54 pm

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!
wartiaga
 
Posts: 211
Joined: Wed May 25, 2016 1:04 am

Re: Copy / Paste Behaviour

Postby nageswaragunupudi » Tue May 03, 2022 3:54 am

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
User avatar
nageswaragunupudi
 
Posts: 10627
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests