Problem with paste in Get

Post Reply
User avatar
José Luis Sánchez
Posts: 484
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España
Contact:

Problem with paste in Get

Post by José Luis Sánchez »

Hello,

I've a persistent problem in my applications with the paste of the content of a GET field. When I paste a text in a get field, the text doesn't paste fully, it onnly paste part of the text. For example, in a bank account that in Spain is a char(24), when I paste a value - sometimes from another record of the same application -, FWH doesn't paste the 24 char, it only pastes 18. However, if first I select the field - I go the the beginning of the filed, pulse SHIFT+END selecting the spaces on the GET - and then pressing CTRL+V then the full length of the filed is pasted. If I show th length of the variable associated to the field with Len(cVar) it returns the correct value.

I always make my dialogs from resources, and get fields are EDITTEXT in the .rc file, for example
EDITTEXT 120, 458, 64, 40, 12

I don't know if it is somwthing I'm doing wrong because it's a very big problem and I never read something like this in the forum. ¿ Someone can help me ? Big thanks.

Regards,

José Luis
dtussman
Posts: 78
Joined: Sat Jun 06, 2015 6:57 pm

Re: Problem with paste in Get

Post by dtussman »

I have this problem all the time
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with paste in Get

Post by cnavarro »

C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
José Luis Sánchez
Posts: 484
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España
Contact:

Re: Problem with paste in Get

Post by José Luis Sánchez »

Thanks, but my field is text without format, and it's not the same issue.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with paste in Get

Post by nageswaragunupudi »

18 is the hex value of 24
Regards

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

Re: Problem with paste in Get

Post by nageswaragunupudi »

I made this small test and it appears working correctly for me.

Code: Select all

function TestPaste()

   local oDlg, oFont
   local c1, c2

   c1    := "ABCD" + CHR(24) + "EFGH"
   c2    := "ABCDXEFGH"

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-20

   DEFINE DIALOG oDlg SIZE 300,150 PIXEL TRUEPIXEL FONT oFont

   @ 20,20 GET c1 SIZE 200,30 PIXEL OF oDlg

   @ 50,20 GET c2 SIZE 200,30 PIXEL OF oDlg

   @ 99,20 BUTTON "Show" SIZE 100,40 PIXEL OF oDlg ;
      ACTION MsgInfo( STRTOHEX( c1 ) + CRLF + STRTOHEX( c2 ) + CRLF + ;
         If( c1 == c2, "SAME", "NOT SAME" ) )

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

return nil
 
Before copy and paste:
Image

First, I blocked the five characters "CD" + CHR(24) + "EF" from the first Get and pressed Ctrl-C to copy.
Next, I blocked the five characters "CDXEF" in the second Get and pressed Ctrl-V to paste.
I found the paste working correctly.

After copy and paste:
Image

For me, the copy and paste appears to be working correctly.
Regards

G. N. Rao.
Hyderabad, India
dtussman
Posts: 78
Joined: Sat Jun 06, 2015 6:57 pm

Re: Problem with paste in Get

Post by dtussman »

sometimes it works and sometimes it doesn't
User avatar
José Luis Sánchez
Posts: 484
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España
Contact:

Re: Problem with paste in Get

Post by José Luis Sánchez »

Mr. Rao:
Thanks for your kind answer. I've converted your sample using resources, and it works properly.

Code: Select all

#include "FiveWin.ch"

function Main()

    local oDlg, oFont, aGet[2], oBtn
    local c1, c2

    c1    := "ES9901234567890123456789"
    c2    := space(24)

    DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-16

    DEFINE DIALOG oDlg RESOURCE "TEST" 
    oDlg:SetFont(oFont)

    REDEFINE GET aGet[1] VAR c1 ID 10 OF oDlg

    REDEFINE GET aGet[1] VAR c2 ID 11 OF oDlg
    
    REDEFINE BUTTON oBtn ID 12 OF oDlg ;
        ACTION MsgInfo( STRTOHEX( c1 ) + CRLF + STRTOHEX( c2 ) + CRLF + ;
            If( c1 == c2, "SAME", "NOT SAME" ) )

    ACTIVATE DIALOG oDlg CENTERED

    RELEASE FONT oFont

return nil
and the resource file is:

Code: Select all

// Generated by ResEdit 1.5.11
// Copyright (C) 2006-2012
// http://www.resedit.net

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"




//
// Dialog resources
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
TEST DIALOG 61, 39, 241, 98
STYLE DS_3DLOOK | DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "TESTPASTE"
FONT 8, "Tahoma"
{
    EDITTEXT        10, 8, 19, 225, 16, ES_AUTOHSCROLL
    EDITTEXT        11, 8, 39, 225, 16, ES_AUTOHSCROLL
    DEFPUSHBUTTON   "Show", 12, 164, 67, 69, 23
}
I realized that the resource editor is including the clause ES_AUTOHSCROLL that I was not using in the resources in my programs. Then I've included this clause in .rc of one of my programs and it works fine. I've to change all the EDITTEXT to include the clause, but the problem is solved.

Big thanks, you have helped me to solve one of my BIG issues from FWH.

Regards from Novelda,
José Luis
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Problem with paste in Get

Post by Antonio Linares »

José Luis,

many thanks for your feedback
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply