(1909)Problem about MDI Window utf8

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

(1909)Problem about MDI Window utf8

Post by ssbbs »

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

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

Re: (1909)Problem about MDI Window utf8

Post by cnavarro »

Please try with my sample

Image

Code: Select all

#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
 
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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: (1909)Problem about MDI Window utf8

Post by nageswaragunupudi »

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

Re: (1909)Problem about MDI Window utf8

Post by ssbbs »

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

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

Code: Select all

        MENU oMenu POPUP
             MENUITEM "[&A]測試一" ACTION test(1)
             MENUITEM "[&B]測試二" ACTION test(2)
             MENUITEM "[&C]測試三" ACTION test(3)
        ENDMENU
 
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: (1909)Problem about MDI Window utf8

Post by cnavarro »

I see,
My advice is to put at the beginning of your main function

Code: Select all

    SetResDebug (.T.)
 
and before finishing the Main function

Code: Select all

     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?
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: (1909)Problem about MDI Window utf8

Post by ssbbs »

Is there any progress?
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: (1909)Problem about MDI Window utf8

Post by nageswaragunupudi »

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

Re: (1909)Problem about MDI Window utf8

Post by ssbbs »

Please, My application is waiting for release....
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: (1909)Problem about MDI Window utf8

Post by nageswaragunupudi »

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

G. N. Rao.
Hyderabad, India
Post Reply