FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour (1909)Problem about MDI Window utf8
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
(1909)Problem about MDI Window utf8
Posted: Tue Nov 26, 2019 04:06 PM
My .prg is encode utf8,
I can not correct display chinese word, Why?
and It's fail when I try change title of window (MDI)

test.prg

Code (fw): Select all Collapse
#include "fivewin.ch"
func    Main()
local   oMenu, oWin
        HB_SetCodePage("UTF8")
        HB_CDPSELECT("UTF8")
        //
        FW_SetUnicode(.T.)
        //
        MENU oMenu
             MENUITEM "[&A]基本資料"
             MENU
                MENUITEM "[&A]基本測試-A"
                MENUITEM "[&B]基本測試-B"
                MENUITEM "[&C]基本測試-C"
             ENDMENU
             MENUITEM "[&B]交易作業"
             MENU
                MENUITEM "[&A]交易作業-A"
                MENUITEM "[&B]交易作業-B"
                MENUITEM "[&C]交易作業-C"
             ENDMENU
             MENUITEM "[&S]系統設定"
             MENU
                MENUITEM "[&A]系統設定-A"
                MENUITEM "[&B]系統設定-B"
                MENUITEM "[&C]系統設定-C"
             ENDMENU
             MENUITEM "[&T]set MDI Window Title" ACTION oWin:cTitle('中文測試')
        ENDMENU
        DEFINE WINDOW oWin TITLE "中文測試(utf8 encode).龍.咙." COLOR "W+/N+" MDI MENU oMenu
        ACTIVATE WINDOW oWin MAXIMIZED
return  nil
line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: (1909)Problem about MDI Window utf8
Posted: Tue Nov 26, 2019 04:53 PM
Please try with my sample



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

Static oFont

function Main()

   local oWin

   // Use a font type suitable for Unicode characters for Window and Menu
   DEFINE FONT oFont NAME "Lucida Console" SIZE 0, -16

        // Not necessary for this, but you can put it
        //HB_SetCodePage("UTF8")
        //HB_CDPSELECT("UTF8")
        //
        // Necessary for windows title initial
        FW_SetUnicode(.T.)
        //
        DEFINE WINDOW oWin TITLE "中文測試(utf8 encode).龍.咙." ;
           FROM 2, 2 TO 500, 700 ;
           COLOR "N+/W+" MDI MENU SetMyMenu() PIXEL
           oWin:SetFont( oFont )

        ACTIVATE WINDOW oWin CENTERED //MAXIMIZED
   RELEASE FONT oFont

return  nil

Function SetMyMenu()

   local oMenu

        MENU oMenu FONT oFont
             MENUITEM "[&A]基本資料"
             MENU
                MENUITEM "[&A]基本測試-A"
                MENUITEM "[&B]基本測試-B"
                MENUITEM "[&C]基本測試-C"
             ENDMENU
             MENUITEM "[&B]交易作業"
             MENU
                MENUITEM "[&A]交易作業-A"
                MENUITEM "[&B]交易作業-B"
                MENUITEM "[&C]交易作業-C"
             ENDMENU
             MENUITEM "[&S]系統設定"
             MENU
                MENUITEM "[&A]系統設定-A"
                MENUITEM "[&B]系統設定-B"
                MENUITEM "[&C]系統設定-C"
             ENDMENU
             MENUITEM "[&T]set MDI Window Title" ACTION oWin:cTitle('中文測試')
        ENDMENU

Return oMenu
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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: (1909)Problem about MDI Window utf8
Posted: Wed Nov 27, 2019 12:02 AM
It's fail when I try change title of window (MDI)


We confirm the problem.
We are trying to find a solution.
Regards



G. N. Rao.

Hyderabad, India
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: (1909)Problem about MDI Window utf8
Posted: Wed Nov 27, 2019 03:40 AM
cnavarro wrote:Please try with my sample



I had modify source\classes\menu.prg:
1:


2:


3:


My old source code have not modify can correct Chinese word!!

Code (fw): Select all Collapse
           MENU oMenu
                MENUITEM "[&A]基本資料"
                MENU


Code (fw): Select all Collapse
        MENU oMenu POPUP
             MENUITEM "[&A]測試一" ACTION test(1)
             MENUITEM "[&B]測試二" ACTION test(2)
             MENUITEM "[&C]測試三" ACTION test(3)
        ENDMENU
line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: (1909)Problem about MDI Window utf8
Posted: Wed Nov 27, 2019 04:53 AM
I see,
My advice is to put at the beginning of your main function
Code (fw): Select all Collapse
    SetResDebug (.T.)

and before finishing the Main function
Code (fw): Select all Collapse
     CheckRes()
   
Return nil

and check the file checkres.txt that is generated, to verify that it has no resources without destroying

The code you propose may be good for you but it does not imply a generic solution that can be applied because that implies that all menus will be drawn by Fivewin (OWNERDRAW) and not by the operating system.

A curiosity: what operating system do you use and what language is the one that is configured by default?
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: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: (1909)Problem about MDI Window utf8
Posted: Wed Dec 04, 2019 01:37 AM

Is there any progress?

line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: (1909)Problem about MDI Window utf8
Posted: Wed Dec 04, 2019 02:37 AM

Changing the title of MDI frame window?
Not yet.
Looks like this is going to take sometime.

Regards



G. N. Rao.

Hyderabad, India
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: (1909)Problem about MDI Window utf8
Posted: Wed Dec 04, 2019 08:43 AM

Please, My application is waiting for release....

line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: (1909)Problem about MDI Window utf8
Posted: Fri Dec 06, 2019 05:17 PM

Fixed in the next release.
The next release may be published very soon.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion