(1909)Problem about MDI Window utf8

(1909)Problem about MDI Window utf8

Postby ssbbs » Tue Nov 26, 2019 4: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)
Image
test.prg

Code: Select all  Expand view  RUN

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

Re: (1909)Problem about MDI Window utf8

Postby cnavarro » Tue Nov 26, 2019 4:53 pm

Please try with my sample

Image

Code: Select all  Expand view  RUN

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

Re: (1909)Problem about MDI Window utf8

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: (1909)Problem about MDI Window utf8

Postby ssbbs » Wed Nov 27, 2019 3:40 am

cnavarro wrote:Please try with my sample



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

2:
Image

3:
Image

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

Code: Select all  Expand view  RUN

           MENU oMenu
                MENUITEM "[&A]基本資料"
                MENU
 


Code: Select all  Expand view  RUN

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

Re: (1909)Problem about MDI Window utf8

Postby cnavarro » Wed Nov 27, 2019 4:53 am

I see,
My advice is to put at the beginning of your main function
Code: Select all  Expand view  RUN

    SetResDebug (.T.)
 

and before finishing the Main function
Code: Select all  Expand view  RUN

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

Re: (1909)Problem about MDI Window utf8

Postby ssbbs » Wed Dec 04, 2019 1:37 am

Is there any progress?
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: (1909)Problem about MDI Window utf8

Postby nageswaragunupudi » Wed Dec 04, 2019 2: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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: (1909)Problem about MDI Window utf8

Postby ssbbs » Wed Dec 04, 2019 8:43 am

Please, My application is waiting for release....
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: (1909)Problem about MDI Window utf8

Postby nageswaragunupudi » Fri Dec 06, 2019 5:17 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests