Unicode Support to Dialogs from Resources

Unicode Support to Dialogs from Resources

Postby RAMESHBABU » Tue Sep 29, 2015 8:39 am

Dear Mr.Antonio,

I was testing Unicode support from our FiveWin. All seems to be working ok
to the extent of Unicode implemented sofar upto FWH_1509.

But one thing i noticed is that the text from Dialogs in R.C are not being
converted.

viewtopic.php?f=3&t=31392

Image
free image host

My I request you to look into this when you find time.

Regards,

-Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 616
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: Unicode Support to Dialogs from Resources

Postby Antonio Linares » Tue Sep 29, 2015 2:16 pm

Dear Ramesh,

Could you please test it again doing oDlg:lTransparent := .T. before the ACTIVATE DIALOG ?

Please post the resulting screenshot here.

Many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode Support to Dialogs from Resources

Postby Antonio Linares » Tue Sep 29, 2015 4:44 pm

Ramesh,

Are those dialogs from a RC file ?

If so, could you please post here the RC file or send it to my email ?

thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode Support to Dialogs from Resources

Postby richard-service » Wed Sep 30, 2015 5:21 am

Antonio Linares wrote:Ramesh,

Are those dialogs from a RC file ?

If so, could you please post here the RC file or send it to my email ?

thanks


Antonio,

I make this sample, PRG and RC that I convert to UTF-8 style.

http://www.fivetech.com.tw/downloads/TestChinese-u8-V3.rar

Code: Select all  Expand view

// Add this to your resources RC file

#ifdef __FLAT__
   1 24 "./WinXP/WindowsXP.Manifest"
#endif

new      BITMAP "./bitmaps/32x32/new.bmp"
quit     BITMAP "./bitmaps/32x32/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
}
 
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v5.7 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 780
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unicode Support to Dialogs from Resources

Postby Antonio Linares » Wed Sep 30, 2015 8:34 am

It seems as we have to use cgrc.exe for resources with unicode:

http://blog.spreendigital.de/2008/10/14/unicode-in-resource-files/
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode Support to Dialogs from Resources

Postby cnavarro » Wed Sep 30, 2015 11:00 am

Look

Image
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: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Unicode Support to Dialogs from Resources

Postby Antonio Linares » Wed Sep 30, 2015 11:11 am

Dear Cristobal,

Please explain the changes in buildh.bat, many thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode Support to Dialogs from Resources

Postby cnavarro » Wed Sep 30, 2015 11:13 am

Antonio

I've sent an email
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: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Unicode Support to Dialogs from Resources

Postby Antonio Linares » Wed Sep 30, 2015 11:23 am

Ok, as explained by Cristobal to me, Windows does not support UTF8. Only Unicode.

So you have to open the RC file with notepad.exe and save it with Unicode format.

Cristobal, thanks for the finding :-)

And don't forget to add this at the beginning of your PRG:

FW_SetUnicode( .T. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode Support to Dialogs from Resources

Postby Antonio Linares » Wed Sep 30, 2015 11:27 am

And it seems as brc32.exe can not be used, instead we have to use cgrc.exe from Embarcadero.

In buildh.bat this change is needed:

Instead of:

IF EXIST %1.rc %bcdir%\bin\brc32.exe -r -I%bcdir%\include -I%bcdir%\include\windows\sdk %1

We must use:

IF EXIST %1.rc %bcdir%\bin\cgrc.exe -r -m -I%bcdir%\include -I%bcdir%\include\windows\sdk %1
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode Support to Dialogs from Resources

Postby Antonio Linares » Wed Sep 30, 2015 12:12 pm

As Embarcadero does not allow the redistribution of these (free) tools, if you are interested

about using cgrc.exe please send me a gmail account if you want to receive the instructions about how to download the software

from Embarcadero and where this tool is located
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode Support to Dialogs from Resources

Postby RAMESHBABU » Wed Sep 30, 2015 12:31 pm

Dear Mr.Antinio,

I am extremely happy for that I could
get the Unicode resource dialogs shown
properly with unicode characters, with
your great help.

cgrc.exe and saving the .rc file with in
unicode format has done the magic.

Image
windows 7 print screen

Thank you very much to you and Mr.Cristobal

Regards,

-Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 616
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: Unicode Support to Dialogs from Resources

Postby dutch » Thu Oct 01, 2015 2:33 am

Dear Antonio,

I do interest too, thank you in advance.
dutchez4 @ gmail.com
Antonio Linares wrote:As Embarcadero does not allow the redistribution of these (free) tools, if you are interested

about using cgrc.exe please send me a gmail account if you want to receive the instructions about how to download the software

from Embarcadero and where this tool is located
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Unicode Support to Dialogs from Resources

Postby richard-service » Thu Oct 01, 2015 5:23 am

Dear Antonio,

1.Resource Dialog not work. I can't input Chinese word and number into TGet.
2.ToolTip display Garbled.
Image
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v5.7 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 780
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unicode Support to Dialogs from Resources

Postby RAMESHBABU » Thu Oct 01, 2015 6:32 am

Hello Mr.Richard

The dialog what I have shown above is generated using your source only.

Plz. follow the instructions give by Mr.Antonio. I reiterate them once again
for you.

A) In the begenning of you main program, you have to write FW_SetUnicode(.T.)
B) You plase copy your .RC file contents into notepad and save it as "unicode" not "UTF-8"
C) Copy cgrc.exe into BCC7\BIN or BCC582\BIN
D) In Buildx.bat say :

Code: Select all  Expand view

    rem IF EXIST %1.rc %bcdir%\bin\brc32 -r -I%bcdir%\include %1
    IF EXIST %1.rc %bcdir%\bin\cgrc -r -m -ipath%bcdir%\include %1
 

E) Just compile and link it. You will get the .EXE properly built and working with UNICODE support.

In case you need the .EXE generated from your own code you gave me, plz. write to my private mail.
I will send it to you.

Thats all

Regards,

-Ramesh Babu
User avatar
RAMESHBABU
 
Posts: 616
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 117 guests