Problem with paste in Get

Problem with paste in Get

Postby José Luis Sánchez » Mon Apr 30, 2018 2:46 pm

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
User avatar
José Luis Sánchez
 
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España

Re: Problem with paste in Get

Postby dtussman » Mon Apr 30, 2018 3:16 pm

I have this problem all the time
dtussman
 
Posts: 97
Joined: Sat Jun 06, 2015 6:57 pm

Re: Problem with paste in Get

Postby cnavarro » Mon Apr 30, 2018 3:50 pm

Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with paste in Get

Postby José Luis Sánchez » Mon Apr 30, 2018 4:08 pm

Thanks, but my field is text without format, and it's not the same issue.
User avatar
José Luis Sánchez
 
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España

Re: Problem with paste in Get

Postby nageswaragunupudi » Mon Apr 30, 2018 5:05 pm

18 is the hex value of 24
Regards

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

Re: Problem with paste in Get

Postby nageswaragunupudi » Mon Apr 30, 2018 5:15 pm

I made this small test and it appears working correctly for me.
Code: Select all  Expand view  RUN
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
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with paste in Get

Postby dtussman » Mon Apr 30, 2018 10:28 pm

sometimes it works and sometimes it doesn't
dtussman
 
Posts: 97
Joined: Sat Jun 06, 2015 6:57 pm

Re: Problem with paste in Get

Postby José Luis Sánchez » Tue May 01, 2018 11:46 am

Mr. Rao:
Thanks for your kind answer. I've converted your sample using resources, and it works properly.
Code: Select all  Expand view  RUN

#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  Expand view  RUN

// 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
José Luis Sánchez
 
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España

Re: Problem with paste in Get

Postby Antonio Linares » Wed May 02, 2018 10:02 am

José Luis,

many thanks for your feedback
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests