FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index WhatsNew / Novedades New FTDN September/Septiembre 2015 (FWH 15.09)
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Thu Oct 01, 2015 04:35 PM
No Master. Puede compilar con el BRC32.EXE


Code (fw): Select all Collapse
// Testing Unicode Chinese Language

#include "fivewin.ch"
#include "Report.ch"
#include "print.ch"

REQUEST DBFCDX
REQUEST DBFFPT

//----------------------------------------------------------------------------//
Function Main() 

LOCAL oApp

      InitApp()

      oApp := TUnicodeChinese():New()

RETURN NIL

FUNCTION InitApp()

   RddSetDefault("DBFCDX")

   SET DATE FORMAT "YYYY-MM-DD"
   SET DELETE ON

RETURN NIL

//
//
CLASS TUnicodeChinese

   DATA oWnd
   DATA oBar
  
   METHOD New() CONSTRUCTOR
   METHOD MenuBuild()
   METHOD DrawBar()
   METHOD DrawMsgBar() 
   
   METHOD TestChinese_Code() 
   METHOD TestChinese_Resource() 
      METHOD PrnDataResource()    
      
ENDCLASS

METHOD New() CLASS TUnicodeChinese

      DEFINE WINDOW ::oWnd TITLE "測試 Unicode 繁體中文(Traditional Chinese)-例如堃,叙" ;
             MENU ::MenuBuild()  
                         
             ::DrawBar()  
             ::DrawMsgBar()             
                  
      ACTIVATE WINDOW ::oWnd MAXIMIZED
      
RETURN Self

//
METHOD MenuBuild() CLASS TUnicodeChinese
LOCAL oMenu

      MENU oMenu 2007
        MENUITEM "測試-例如堃,叙"
        MENU
            MENUITEM "測試CODE-例如堃,叙"     ACTION ::TestChinese_Code()
            SEPARATOR
            MENUITEM "測試RESOURCE-例如堃,叙" ACTION ::TestChinese_Resource() 
            SEPARATOR
            MENUITEM "離開"                   ACTION ::oWnd:End()             
        ENDMENU
        
        MENUITEM "編輯" WHEN .F.
      
        oMenu:AddHelp()
                  
      ENDMENU

RETURN oMenu

//
METHOD DrawBar() CLASS TUnicodeChinese

   DEFINE BUTTONBAR ::oBar OF ::oWnd SIZE 60, 60 2007

   DEFINE BUTTON OF ::oBar ACTION ::TestChinese_Code();
      RESOURCE "new" TOOLTIP "測試中文輸入-Code/-例如堃,叙" PROMPT "å ƒ-C"

   DEFINE BUTTON OF ::oBar ACTION ::TestChinese_Resource();
      RESOURCE "new" TOOLTIP "測試中文輸入-Resource/-例如堃,叙" PROMPT "叙-R"

   DEFINE BUTTON OF ::oBar ACTION ::oWnd:End() ;
      RESOURCE "quit" TOOLTIP "離開系統" PROMPT "離開" 
   
RETURN NIL

//
METHOD DrawMsgBar() CLASS TUnicodeChinese

SET MESSAGE OF ::oWnd TO "測試 Unicode 繁體中文(Traditional Chinese)-例如堃,叙" CENTERED 2007 CLOCK KEYBOARD

RETURN NIL

//
METHOD TestChinese_Code() CLASS TUnicodeChinese

LOCAL oDlg
LOCAL oSay2 , cSay2 := "地址-例如堃,叙"
LOCAL oSay  , cSay  := "姓名-例如堃,叙"
LOCAL oGet1 , cGet1 := SPACE( 100 )
LOCAL oGet2 , cGet2 := SPACE( 100 )
LOCAL oBut1 , oBut2

USE testchinese alias TEST

GO BOTTOM

cGet1 := TEST->NAME
cGet2 := TEST->ADDR


DEFINE DIALOG oDlg  FROM 10 , 10 TO 40 , 150

@ 1 ,  1 SAY oSay2 PROMPT cSay2 OF oDlg
@ 2 ,  1 SAY oSay  PROMPT cSay OF oDlg

@ 4 ,  1 GET oGet1 VAR cGet1 OF oDlg
@ 5 ,  1 GET oGet2 VAR cGet2 OF oDlg

@ 6 ,  1 BUTTON oBut2 PROMPT "存檔" ACTION write_dbf( cGet1 , cGet2 )
@ 6 , 10 BUTTON oBut1 PROMPT "列印" ACTION printtest()


ACTIVATE DIALOG oDlg
CLOSE DATABASE

RETURN NIL

FUNCTION WRITE_DBF( cGet1 , cGet2 )

      Append Blank
      TEST->( DbRLock() )         
      TEST->NAME := cGet1
      TEST->ADDR := cGet2
      TEST->( DbCommit() )    
      TEST->( DbUnLock() )    

RETURN NIL

function PrintTest()

   local oPrn := TPrinter():New( "Test" )  // "Test" is the name for the printout

   local fntArial
   local nRow := 1
   
   DEFINE FONT fntArial NAME "細明體" SIZE 0 , -80

   oPrn:StartPage()
   TEST->( DbGoTop() )
                           // starts a new page
   DO WHILE !EOF()
      oPrn:Say( nRow * 100 ,   10 , TEST->NAME , fntArial )
      oPrn:Say( nRow * 100 , 1000 , TEST->ADDR , fntArial )
      nRow ++
      SKIP
   ENDDO

   oPrn:EndPage()                          // ends this page

   RELEASE FONT fntArial

   oPrn:End()

return nil

//
//
METHOD TestChinese_Resource() CLASS TUnicodeChinese

local oDlg, oBrw, oReport, oGet[2], oSay[2], oBtn[3], oFont[4]
local lOK := .F.
local cNAME := space(100)
local cADDR := space(100)
local cAlias := ""

      USE testchinese alias TEST

      DEFINE DIALOG oDlg RESOURCE "TEST"

      REDEFINE SAY oSay[1] ID 101 OF oDlg
      REDEFINE SAY oSay[2] ID 102 OF oDlg
   
      REDEFINE GET oGet[1] Var cNAME ID 201 OF oDlg
      REDEFINE GET oGet[2] Var cADDR ID 202 OF oDlg
         
      REDEFINE BUTTON oBtn[1] ID 301 OF oDlg ;
               ACTION ( lOK := .T. , oDlg:End() )
            
      REDEFINE BUTTON oBtn[2] ID 302 OF oDlg ;
               ACTION ( lOK := .F. , oDlg:End() )
            
      REDEFINE BUTTON oBtn[3] ID 303 OF oDlg ;
               ACTION ( ::PrnDataResource(), oDlg:End() )         
            
      ACTIVATE DIALOG oDlg CENTERED 
   
      IF lOK
         Append Blank
         TEST->( DbRLock() )         
         TEST->NAME := cNAME
         TEST->ADDR := cADDR
         TEST->( DbCommit() )    
         TEST->( DbUnLock() ) 
      ENDIF
      
RETURN NIL       
  
//
//
METHOD PrnDataResource() CLASS TUnicodeChinese

local oReport, oFont[4] 
   
      TEST->( DbGoTop() )
   
      DEFINE FONT oFont[1] NAME "細明體" SIZE 0,12
      DEFINE FONT oFont[2] NAME "標楷體" SIZE 0,16 BOLD
      DEFINE FONT oFont[3] NAME "細明體" SIZE 0,12 BOLD
      DEFINE FONT oFont[4] NAME "標楷體" SIZE 0,22 BOLD
   
      REPORT oReport                                  ;
          TITLE   Trim("客戶資料報表-例如堃,叙")  ,;
                  ""                                   ,;
                  "列印日期:"+DTOC(DATE())+ REPL(" ",4) + ;
                  "頁次: "+str(oReport:nPage,3)  CENTER     ;
          HEADER ""                                   ,;
                 " " CENTER                            ;
          FONT oFont[1],oFont[2],oFont[3],oFont[4]     ;
          CAPTION "客戶資料報表-例如堃,叙"                        ;
          PREVIEW

          COLUMN TITLE "中文姓名-例如堃,叙" DATA TEST->NAME          
          COLUMN TITLE "中文地址-例如堃,叙" DATA TEST->ADDR
                          
      END REPORT
      
      IF oReport:lCreated
         oReport:oHEADER:aFONT[1]:={|| 4 }
         oReport:oTITLE:aFONT[1]:={|| 2 }
         oReport:oTITLE:aFONT[2]:={|| 1 }
         oReport:oTITLE:aFONT[3]:={|| 1 }
      ENDIF
      
      oReport:nTotalLine := RPT_SINGLELINE

      ACTIVATE REPORT oReport ON STARTGROUP oReport:NewLine()
   
      oFont[1]:End()
      oFont[2]:End()
      oFont[3]:End()
      oFont[4]:End()
     
      CLOSE DATABASE  
   
RETURN NIL
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Thu Oct 01, 2015 04:36 PM
Code (fw): Select all Collapse
// Add this to your resources RC file


1 24 "WindowsXP.Manifest"

new      BITMAP "new.bmp"
quit     BITMAP "quit.bmp"

TEST DIALOG 20, 41, 356, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "測試  Unicode 繁體中文(Traditional Chinese)-例如堃,叙"
FONT 12, "細明體"
{
 EDITTEXT 201, 68, 7, 170, 12
 EDITTEXT 202, 68, 22, 99, 12
 CONTROL "存檔", 301, "BUTTON", BS_USERBUTTON | WS_TABSTOP, 302, 8, 46, 18
 CONTROL "取消", 302, "BUTTON", BS_USERBUTTON | WS_TABSTOP, 302, 29, 46, 18
 CONTROL "列印", 303, "BUTTON", BS_USERBUTTON | WS_TABSTOP, 302, 50, 46, 18
 LTEXT "中文地址", 101, 5, 7, 60, 12
 LTEXT "中文姓名", 102, 5, 22, 60, 12
}
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Sat Oct 03, 2015 07:35 AM

September 2015 (revised build)

  • Fix: Fixed bug in function ExtTextOut().

  • Unicode support extended to messagebar, TOutlook (all versions), TTreeView, TExplorerbar, TVistamenu, Tooltips, c5tooltips, etc

  • Enhancement: Tooltip of oBtn TGet

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Sat Oct 03, 2015 09:42 AM

Antonio,

any news regarding font menu bug?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Sat Oct 03, 2015 09:45 AM

Enrico,

I am afraid that I missed your email.

Could you send your example to Cristobal ? He is supervising the menus.

thanks!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Sat Oct 03, 2015 09:58 AM
Antonio,

he already has my sample. Anyway, here it is:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oFnt, oWnd

    DEFINE FONT oFnt NAME "Arial" SIZE 0, -7

    DEFINE WINDOW oWnd

    oWnd:SetFont( oFnt )

    DEFINE BUTTONBAR OF oWnd 2007

    DEFINE BUTTON;
           OF oWnd:oBar;
           PROMPT "Test";
           MENU TESTMENU();
//           FONT oFnt

    ACTIVATE WINDOW oWnd

    RELEASE FONT oFnt

    RETURN NIL


STATIC FUNCTION TESTMENU()

    LOCAL oMen

    MENU oMen POPUP
        MENUITEM "This is a long menu item"
    ENDMENU

    RETURN oMen


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Sat Oct 03, 2015 10:17 AM

Enrico,

Have you tested it with the new 15.09 build ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Sat Oct 03, 2015 09:20 PM

Antonio,

yes, just tested. Unfortunately there are the following problems:

  1. The ExtTextOut() bug is still there, or there is something similar for DrawText() (the background of the browse cell is not fully painted).

  2. Menu width is not correctly calculated (sometimes the menuitem text is truncated).

  3. Submenus still use the window or dialog font (menus are ok).

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Mon Oct 05, 2015 08:37 AM
Solved (menus and submenus )

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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Mon Oct 05, 2015 08:45 AM

Cristobal,

thank you! :-)

EMG

Posts: 226
Joined: Sun May 13, 2012 07:52 AM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Mon Oct 05, 2015 06:17 PM
fwh1509 build2

FWH2008 | xHarbour | BCC74 | SQLRDD
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Mon Oct 05, 2015 06:45 PM
Hello
You can put as you have defined the menu?

Code (fw): Select all Collapse
   MENU oMenu .. . . . . . . .


No SKIN


SKIN 2007


SKIN 2010


SKIN 2015


SKIN 2013
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
Posts: 226
Joined: Sun May 13, 2012 07:52 AM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Mon Oct 05, 2015 07:50 PM

Hola
MENU oMenu 2007

FWH2008 | xHarbour | BCC74 | SQLRDD
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Mon Oct 05, 2015 07:58 PM
Sistem wrote:Hola
MENU oMenu 2007


Ok
Enviame un mail a navarro . cristobal [at] gmail . com sin espacios

Send me a mail : navarro . cristobal [at] gmail . com

Compilador BCC582, BCC7, VS .... ? and version
Harbour o XHarbour

Saludos
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
Posts: 226
Joined: Sun May 13, 2012 07:52 AM
Re: New FTDN September/Septiembre 2015 (FWH 15.09)
Posted: Thu Oct 08, 2015 07:13 PM
Agora trabalha bem, com a grande ajuda do amigo Navarro
antes


depois


[]s a todos
FWH2008 | xHarbour | BCC74 | SQLRDD