TGet bug (unicode)

TGet bug (unicode)

Postby ssbbs » Wed Jun 17, 2020 1:40 am

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
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: TGet bug (unicode)

Postby nageswaragunupudi » Mon Jul 06, 2020 3:30 pm

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  Expand view  RUN
#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
nageswaragunupudi
 
Posts: 10651
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TGet bug (unicode)

Postby ssbbs » Sun Jul 12, 2020 3:18 pm

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
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: TGet bug (unicode)

Postby ShumingWang » Wed Jul 15, 2020 1:14 am

Mr. Liao/SSBBS:
Long time not met, Still OK?
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: TGet bug (unicode)

Postby ssbbs » Fri Jul 17, 2020 4:18 am

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'.
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: TGet bug (unicode)

Postby nageswaragunupudi » Fri Jul 17, 2020 7:59 am

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

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
User avatar
nageswaragunupudi
 
Posts: 10651
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 116 guests