Page 1 of 1

TGet bug? Picture of date.

Posted: Mon Feb 24, 2020 8:24 am
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
}
 

Re: TGet bug? Picture of date.

Posted: Tue Feb 25, 2020 3:56 pm
by ssbbs
The problem is font or resource?

Re: TGet bug? Picture of date.

Posted: Thu Feb 27, 2020 1:20 pm
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,

Re: TGet bug? Picture of date.

Posted: Fri Feb 28, 2020 8:39 am
by ssbbs
karinha wrote:// C:\FWH..\SAMPLES\SSBBS.PRG
Regards,
My question is, Why not assign '細明體' dialog is normal, not correct if assign '細明體' ?

Re: TGet bug? Picture of date.

Posted: Fri Feb 28, 2020 12:00 pm
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.

Re: TGet bug? Picture of date.

Posted: Fri Feb 28, 2020 1:20 pm
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!

Re: TGet bug? Picture of date.

Posted: Fri Feb 28, 2020 2:20 pm
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

Re: TGet bug? Picture of date.

Posted: Sat Feb 29, 2020 3:32 am
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!