FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TGet bug (unicode)
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
TGet bug (unicode)
Posted: Wed Jun 17, 2020 01: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 ?
line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TGet bug (unicode)
Posted: Mon Jul 06, 2020 03: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 (fw): Select all Collapse
#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


Regards



G. N. Rao.

Hyderabad, India
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: TGet bug (unicode)
Posted: Sun Jul 12, 2020 03: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:
line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: TGet bug (unicode)
Posted: Wed Jul 15, 2020 01: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
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: TGet bug (unicode)
Posted: Fri Jul 17, 2020 04: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TGet bug (unicode)
Posted: Fri Jul 17, 2020 07: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 (fw): Select all Collapse
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

Continue the discussion