TGet bug? Picture of date.

TGet bug? Picture of date.

Postby ssbbs » Mon Feb 24, 2020 8:24 am

I have a test about picture of date, code is:
Code: Select all  Expand view

func    Test()
Local   oDlg, oGet[2], oBtn, oFnt
Local   cPass := Space(10),;
        cDate := Space(8),;
        lTest := .T.
        //
        If lTest
           DEFINE FONT oFnt NAME '細明體' SIZE 0, -12
        EndIf
        //
        DEFINE DIALOG oDlg RESOURCE "TEST"
        If lTest
           oDlg:SetFont( oFnt )
        EndIf
        //
        REDEFINE GET oGet[1] VAR cDate ID 201 OF oDlg;
                 PICTURE '@R 999.99.99'
        REDEFINE GET oGet[2] VAR cPass ID 202 OF oDlg
        //
        REDEFINE BUTTON oBtn ID 101 OF oDlg ACTION oDlg:End()
        REDEFINE BUTTON oBtn ID 102 OF oDlg ACTION oDlg:End()
        //
        ACTIVATE DIALOG oDlg;
                 ON INIT (WndCenter(oDlg:hWnd), msginfo( oDlg:oFont:cFaceName))
        //
        If lTest
           oFnt:End()
        EndIf
        //
return  nil
 

Image

and set lTest := .F.
image:
Image

Why picture about '.' and font is small ?

.res is:
Code: Select all  Expand view

TEST DIALOG 52, 47, 111, 79
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "DATE PICTURE 檢查"
FONT 12, "細明體"
{
 CONTROL "", -1, "STATIC", SS_ETCHEDFRAME | WS_CHILD | WS_VISIBLE | WS_GROUP, 11, 8, 89, 29
 CONTROL "DATE:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 30, 12, 19, 10
 CONTROL "PASSWORD:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 14, 25, 36, 10
 CONTROL "1234567890", 201, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 52, 10, 46, 12
 CONTROL "1234567890", 202, "EDIT", ES_LEFT | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 52, 23, 46, 12
 CONTROL "[&Y]確認", 101, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 52, 40, 20
 CONTROL "[&X]離開", 102, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 56, 52, 40, 20
}
 
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: TGet bug? Picture of date.

Postby ssbbs » Tue Feb 25, 2020 3:56 pm

The problem is font or resource?
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: TGet bug? Picture of date.

Postby karinha » Thu Feb 27, 2020 1:20 pm

// C:\FWH..\SAMPLES\SSBBS.PRG

Code: Select all  Expand view

#include "FiveWin.ch"

STATIC lTest := .T.

FUNCTION Main()

   LOCAL oDlg, oGet[2], oBtn, oFnt, oFont
   LOCAL cPass := Space( 10 ), cDate := Space( 8 )

   SET CENTURY ON
   SET DATE BRITISH
   SET EPOCH TO YEAR( DATE() ) - 30

   IF lTest
      DEFINE FONT oFnt    NAME "Ms Sans Serif" SIZE 0, -10 BOLD
   ELSE
      DEFINE FONT oFont   NAME "Ms Sans Serif" SIZE 0, -12 BOLD
   ENDIF

   //-> Adjust the dialogue with your editor
   DEFINE DIALOG oDlg RESOURCE "TEST" COLOR CLR_BLACK, CLR_WHITE TRANSPARENT

   IF lTest
      oDlg:SetFont( oFnt )
   ELSE
      oDlg:SetFont( oFont )
   ENDIF

   //REDEFINE GET oGet[1] VAR cDate ID 201 OF oDlg PICTURE '@R 999.99.99'
                                                           //-> 2020.02.27
   // REDEFINE GET oGet[1] VAR cDate ID 201 OF oDlg PICTURE "@D 9999.99.99"
   // .OR. In Brazil:                                   //-> 27/02/2020
   REDEFINE GET oGet[1] VAR cDate ID 201 OF oDlg PICTURE "@D 99/99/9999"

   REDEFINE GET oGet[2] VAR cPass ID 202 OF oDlg

   REDEFINE BUTTON oBtn ID 101 OF oDlg ACTION oDlg:End()

   REDEFINE BUTTON oBtn ID 102 OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

      /*;
      ON INIT ( WndCenter( oDlg:hWnd ), msginfo( oDlg:oFont:cFaceName ) )
      */


   IF lTest
      oFnt:End()
   ELSE
      oFont:End()
   ENDIF

RETURN NIL
 
/*  // SSBBS.RC
TEST DIALOG 52, 47, 111, 79
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "DATE PICTURE ??"
FONT 8, "MS Sans Serif"
{
 CONTROL "", -1, "STATIC", SS_ETCHEDFRAME | WS_CHILD | WS_VISIBLE | WS_GROUP, 11, 8, 89, 29
 CONTROL "DATE:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 30, 12, 19, 10
 CONTROL "PASSWORD:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 14, 25, 36, 10
 CONTROL "1234567890", 201, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 52, 10, 46, 12
 CONTROL "1234567890", 202, "EDIT", ES_LEFT | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 52, 23, 46, 12
 CONTROL "[&Y]??", 101, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 52, 40, 20
 CONTROL "[&X]??", 102, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 56, 52, 40, 20
}
*/

 


Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7811
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TGet bug? Picture of date.

Postby ssbbs » Fri Feb 28, 2020 8:39 am

karinha wrote:// C:\FWH..\SAMPLES\SSBBS.PRG
Regards,


My question is, Why not assign '細明體' dialog is normal, not correct if assign '細明體' ?
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: TGet bug? Picture of date.

Postby karinha » Fri Feb 28, 2020 12:00 pm

Sorry, I don't understand the Chinese language, and my keyboard and video card don't recognize the Chinese language.

Try like this:

Code: Select all  Expand view

REQUEST HB_Lang_ZH, HB_CODEPAGE_UTF8

HB_LangSelect( "zh" )
HB_SetCodePage( "UTF8" )
HB_CDPSELECT( "UTF8" )

Fw_SetUnicode( .T. )
 


Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7811
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TGet bug? Picture of date.

Postby ssbbs » Fri Feb 28, 2020 1:20 pm

karinha wrote:Sorry, I don't understand the Chinese language, and my keyboard and video card don't recognize the Chinese language.

Try like this:

Code: Select all  Expand view

REQUEST HB_Lang_ZH, HB_CODEPAGE_UTF8

HB_LangSelect( "zh" )
HB_SetCodePage( "UTF8" )
HB_CDPSELECT( "UTF8" )

Fw_SetUnicode( .T. )
 


Regards.


I already did it! But the problem persists!
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: TGet bug? Picture of date.

Postby cnavarro » Fri Feb 28, 2020 2:20 pm

It seems that it does not find the font that is defined in the resource
FONT 12, "細明體"


Pleae put your .bat for build your application
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TGet bug? Picture of date.

Postby ssbbs » Sat Feb 29, 2020 3:32 am

cnavarro wrote:It seems that it does not find the font that is defined in the resource
FONT 12, "細明體"


Pleae put your .bat for build your application

I already did it! But the problem persists!
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests