TGet bug? Picture of date.

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

TGet bug? Picture of date.

Post by ssbbs »

I have a test about picture of date, code is:

Code: Select all

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

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
}
 
User avatar
ssbbs
Posts: 54
Joined: Mon Oct 17, 2005 3:03 am

Re: TGet bug? Picture of date.

Post by ssbbs »

The problem is font or resource?
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TGet bug? Picture of date.

Post by karinha »

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

Code: Select all

#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
User avatar
ssbbs
Posts: 54
Joined: Mon Oct 17, 2005 3:03 am

Re: TGet bug? Picture of date.

Post by ssbbs »

karinha wrote:// C:\FWH..\SAMPLES\SSBBS.PRG
Regards,
My question is, Why not assign '細明體' dialog is normal, not correct if assign '細明體' ?
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TGet bug? Picture of date.

Post by karinha »

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

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
User avatar
ssbbs
Posts: 54
Joined: Mon Oct 17, 2005 3:03 am

Re: TGet bug? Picture of date.

Post by ssbbs »

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

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!
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TGet bug? Picture of date.

Post by cnavarro »

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
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
ssbbs
Posts: 54
Joined: Mon Oct 17, 2005 3:03 am

Re: TGet bug? Picture of date.

Post by ssbbs »

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!
Post Reply