Page 1 of 1

TGet bug (unicode)

Posted: Wed Jun 17, 2020 1:40 am
by ssbbs
I found a bug of TGet (unicode).
The TGet '經歷:' length is 40 bytes, and type '1234567890' then copy and paste,
But can't paste all data like '1234567890123456789012345678901234567890' and only '12345678901234567890123456789012345', Why ?
Image

Re: TGet bug (unicode)

Posted: Mon Jul 06, 2020 3:30 pm
by nageswaragunupudi
I tried to reproduce the problem, but it is working fine for me and I do not see that problem here.
This is my test program:

Code: Select all

#include "fivewin.ch"

function Main()

   local oDlg, oFont
   local aGet[ 3 ]
   local aVal[ 3 ]

   FW_SetUnicode( .t. )
   SetGetColorFocus()

   AFill( aVal, Space( 40 ) )

   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-20

   DEFINE DIALOG oDlg SIZE 700,240 PIXEL TRUEPIXEL FONT oFont TITLE FWVERSION + " : Unicode Get Paste"

   @  30,70 GET aGet[ 1 ] VAR aVal[ 1 ] SIZE 560,30 PIXEL OF oDlg
   @  70,70 GET aGet[ 2 ] VAR aVal[ 2 ] SIZE 560,30 PIXEL OF oDlg

   @ 180,20 BUTTON "CLOSE" SIZE 100,40 PIXEL OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

return nil
 
Image

Re: TGet bug (unicode)

Posted: Sun Jul 12, 2020 3:18 pm
by ssbbs
OK, Now I 'm test all right,
but have other problem like 'shift+left' to select data, use right of key and no input data.
now fwh can't do it, like:
Image

Re: TGet bug (unicode)

Posted: Wed Jul 15, 2020 1:14 am
by ShumingWang
Mr. Liao/SSBBS:
Long time not met, Still OK?

Re: TGet bug (unicode)

Posted: Fri Jul 17, 2020 4:18 am
by ssbbs
ShumingWang wrote:Mr. Liao/SSBBS:
Long time not met, Still OK?
Yes, Thank you!!
You can talk with me from WeChat and id is 'ssbbstw'.

Re: TGet bug (unicode)

Posted: Fri Jul 17, 2020 7:59 am
by nageswaragunupudi
In a Unicode application, i.e., when FW_SetUnicode( .t. ) is set, GET of a character variable can be defined in three ways.

Code: Select all

1) @ r,c GET .... CHRGROUP CHR_ANSI
2) @ r,c GET .... CHRGROUP CHR_ANY // This is default if CHRGROUP clause is not used.
3) @ r,c GET .... CHRGROUP CHR_WIDE
 
Case (1): CHR_ANSI
In this case, the user interface is handled by FWH and Harbour. The behaviour is exactly the same we were used to for years. We can use all picture clauses but the Get object accepts ANSI characters only. Unicode input is not allowed.

Case (2) and (3):
The user-interface is totally managed by Windows Edit control. Unicode characters are allowed.
Only picture clause allowed is "@!". Any other picture clause is ignored.

This user interface is different from the Case-1 that we were used to with FWH for years, but this is the standard user interface of Windows Edit control.

Difference between Case(2) and (3):
Case (2): CHR_ANY ( default )
The user input is restricted to the number of bytes in the length of the variable used.
If Len( cVar ) is 12, either 12 ANSI characters are allowed of 4 UTF8 characters are allowed.

Case (3):
The user input is restricted to the number of characters in the variable.
If the initial value of the variable is "ABCD", the byte-length is 4. But the user can enter 4 unicode characters. In that case the result string will be 12 byte long.