TGet bug (unicode)

Post Reply
User avatar
ssbbs
Posts: 54
Joined: Mon Oct 17, 2005 3:03 am

TGet bug (unicode)

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

Re: TGet bug (unicode)

Post 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
Regards

G. N. Rao.
Hyderabad, India
User avatar
ssbbs
Posts: 54
Joined: Mon Oct 17, 2005 3:03 am

Re: TGet bug (unicode)

Post 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
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: TGet bug (unicode)

Post by ShumingWang »

Mr. Liao/SSBBS:
Long time not met, Still OK?
User avatar
ssbbs
Posts: 54
Joined: Mon Oct 17, 2005 3:03 am

Re: TGet bug (unicode)

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

Re: TGet bug (unicode)

Post 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.
Regards

G. N. Rao.
Hyderabad, India
Post Reply