Page 1 of 1

(1909)Problem about MDI Window utf8

Posted: Tue Nov 26, 2019 4:06 pm
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
 

Re: (1909)Problem about MDI Window utf8

Posted: Tue Nov 26, 2019 4:53 pm
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
 

Re: (1909)Problem about MDI Window utf8

Posted: Wed Nov 27, 2019 12:02 am
by nageswaragunupudi
It's fail when I try change title of window (MDI)
We confirm the problem.
We are trying to find a solution.

Re: (1909)Problem about MDI Window utf8

Posted: Wed Nov 27, 2019 3:40 am
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
 

Re: (1909)Problem about MDI Window utf8

Posted: Wed Nov 27, 2019 4:53 am
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?

Re: (1909)Problem about MDI Window utf8

Posted: Wed Dec 04, 2019 1:37 am
by ssbbs
Is there any progress?

Re: (1909)Problem about MDI Window utf8

Posted: Wed Dec 04, 2019 2:37 am
by nageswaragunupudi
Changing the title of MDI frame window?
Not yet.
Looks like this is going to take sometime.

Re: (1909)Problem about MDI Window utf8

Posted: Wed Dec 04, 2019 8:43 am
by ssbbs
Please, My application is waiting for release....

Re: (1909)Problem about MDI Window utf8

Posted: Fri Dec 06, 2019 5:17 pm
by nageswaragunupudi
Fixed in the next release.
The next release may be published very soon.