this little sample test does not work
I copy and paste some chinese characters like these 机器加工时间测量表
or I type some character using chinese keyboard
When get object looses focus all chinese characters disappear and appear a list of ??????
Any hints?
King regards
Marco
#include "fivewin.ch"
ANNOUNCE RDDSYS
FUNCTION MAIN()
LOCAL oDlg
LOCAL oCodice , cCodice := SPACE( 50 )
LOCAL oDes_Eng , cDes_Eng := SPACE( 100 )
LOCAL oDes_Chi , cDes_Chi := SPACE( 100 )
LOCAL oFont
LOCAL cFont := "Courier New "
LOCAL nSize := 24
FW_SetUnicode( .t. )
MsgGet( "Insert" , "Font type" , @cFont )
MsgGet( "Insert" , "Font size" , @nSize )
SET DELETED ON
SET EXCLUSIVE OFF
USE items
INDEX ON field->codice TAG CODICE TO ITEMS
INDEX ON field->des_eng TAG DES_ENG TO ITEMS
SET ORDER TO TAG CODICE
GO TOP
DEFINE FONT oFont NAME cFont SIZE 0 , - nSize
DEFINE DIALOG oDlg FROM 100 , 100 TO 400 , 800 PIXEL
@ 1 , 1 SAY "Codice" OF oDlg
@ 1 , 10 GET oCodice VAR cCodice OF oDlg SIZE 200 , 20
@ 3 , 1 SAY "Descri English" OF oDlg
@ 3 , 10 GET oDes_Eng VAR cDes_Eng OF oDlg SIZE 200 , 20
@ 5 , 1 SAY "Descri Chinese" OF oDlg
@ 5 , 10 GET oDes_Chi VAR cDes_Chi OF oDlg SIZE 200 , 20 FONT oFont
@ 7 , 1 BUTTON "Cerca" OF oDlg ACTION CERCA( oCodice , oDes_Eng , oDes_Chi )
@ 7 , 10 BUTTON "Salva" OF oDlg ACTION SALVA( oCodice , oDes_Eng , oDes_Chi )
@ 7 , 20 BUTTON "Print" OF oDlg ACTION PRINT_TEST( cFont )
ACTIVATE DIALOG oDlg Center
RELEASE FONT oFont
RETURN NIL
FUNCTION CERCA( oCodice , oDes_Eng , oDes_Chi )
LOCAL cCodice := oCodice:varget()
IF DBSEEK( cCodice )
oDes_Eng:varput( items->des_eng )
oDes_Chi:varput( items->des_chi )
oDes_Eng:refresh()
oDes_Chi:refresh()
ENDIF
RETURN NIL
FUNCTION SALVA( oCodice , oDes_Eng , oDes_Chi )
LOCAL cCodice := oCodice:varget()
IF DBSEEK( cCodice )
IF DBRLOCK()
REPLACE items->des_eng WITH oDes_Eng:varget()
REPLACE items->des_chi WITH oDes_Chi:varget()
DBRUNLOCK()
ENDIF
ENDIF
RETURN NIL
FUNCTION PRINT_TEST( cFont )
local oPrn := TPrinter():New( "Test" ) // "Test" is the name for the printout
local fntArial
local nRow := 1
LOCAL nSize := 80
LOCAL oFont
MsgGet( "Insert" , "Font size" , @nSize )
DEFINE FONT fntArial NAME "Arial" SIZE 0 , -80
DEFINE FONT oFont NAME cFont SIZE 0 , - nSize
oPrn:StartPage()
GO TOP
// starts a new page
DO WHILE !EOF()
oPrn:Say( nRow * 100 , 10 , field->codice , fntArial )
oPrn:Say( nRow * 100 , 1000 , field->des_eng , fntArial )
oPrn:Say( nRow * 100 , 3000 , field->des_chi , oFont )
nRow ++
SKIP
ENDDO
oPrn:EndPage() // ends this page
RELEASE FONT fntArial
RELEASE FONT oFont
oPrn:End()
RETURN NIL
INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )info@marcoboschi.it

