- This topic has 21 replies, 3 voices, and was last updated 14 years, 6 months ago by Support.
-
AuthorPosts
-
November 3, 2009 at 9:40 am #33385mbagheriParticipant
Hi
I'm using delphi 7 under windows vista, there is no problem there, but when I run my program under windows XP, Titles with Unicode characters are incorrect. I tried to compile the program under windows xp, but the problem exists.
When I run the program with sSkinManager.Active := false, Titles are correct under both Xp and Vista.
I tried both 6.44 and 6.47 but the problem still exists.
I had no such problem with previous versions.Thanks
November 9, 2009 at 9:46 am #40995SupportKeymasterHello
I'll try to solve this problem in the nearest release. You are using TntControls?
You can help me if send a small example of the problem.November 10, 2009 at 2:15 pm #41035mbagheriParticipantHi
No I'm not using any third party control. Just drop a “SkinManager.Active := true” on a form, and set the form caption to some unicode text. then compile the program. When running under windows Vista, there is no problem, but under previous windows versions the unicode characters are incorrect.Thanks for your consideration.
November 14, 2009 at 5:48 pm #41061mbagheriParticipantHi
I tested v6.48 and v6.50 but the problem still exists!.
Here is a sample application. (it's compressed with upx)
you have to set the skin directory. and then you can change the skin from form menu.November 16, 2009 at 10:18 am #41072SupportKeymasterHi
I can explain where is a problem. Delphi 7 haven't a support of unicode, you have correct language in the title because your system have this language by default.
Look a screenshot, I have this window after running of your example (thanks for Exe). So, your application haven't support of unicode.You have good result because your Windows understand a caption and draws it correctly. But Delphi can't do it and all graphical procedures haven't support of unicode.
Solution : you must use free TntControls for support of unicode in Delphi 7 (sources of AlphaControls are required also) or you can use latest versions of Delphi (you will not have a problems in these cases).
November 16, 2009 at 12:19 pm #41077mbagheriParticipantHi
Thanks for your reply, but I didn't have this problem with alpha controls v5.xx , It appeared after v6.xx .
This is right that Delphi 7 doesn't support Unicode, but by setting some options in Windows (Control panel->Regional and Language Options–>in the “Advanced Tab”–>setting “Select a language to match the language version of the non-Unicode programs you want to use” to “Farsi” or “Arabic” – of course you should first install Right-To-Left Languages in the “Languages” tab), non-Unicode programs would also support Unicode characters. and I was using this option. But After upgrading from version 5.xx to 6.xx this problem appeared.November 16, 2009 at 12:46 pm #41078SupportKeymasterOk, I will research this question with version 5 too. Could you write here something using your language? Thanks.
November 16, 2009 at 9:27 pm #41092mbagheriParticipantHi
thanks for your reply.
The attachment is the source of the above test application. you can change the installed version of Alpha Control and rebuild the application and run it under windows XP. (some Persian text is also hard coded in the source).November 17, 2009 at 10:22 am #41110SupportKeymasterThank you for demo, but I can't check it still because my system have other language. I have support of all unicode characters in the system, but you saw a screenshot of your application in non-skinned mode… I have '???' always because Form.Caption is not WideString in the Delphi 7.
I'll try to add some changes in the package code, but I can't check it…November 17, 2009 at 12:22 pm #41114mbagheriParticipantHi
You see '?' instead of Unicode characters, because you haven't installed Right-To-Left languages in your windows. You have to Install it form Control Panel –>Regional and Language Options–>Languages –> Check the “install Right-To-Left Languages” check box and press apply. then in the “Advanced Tab”–>set the “Select a language to match the language version of the non-Unicode programs you want to use” combo box to “Farsi”.
You need the windows XP installation CD for this. and you have to restart your system after making those changes. After that you should have no problem storing Unicode characters in strings.Thanks
November 17, 2009 at 1:52 pm #41115SupportKeymasterSo, main charset must be changed to Farsi on all machines where program must be runned?
I think it's not good solution… May be used in our situation for testing only.November 20, 2009 at 8:02 am #41138mbagheriParticipantHi
Yes, you have to change the main language to “Farsi”, in order for non Unicode programs to be able to show Farsi texts.Thanks
November 26, 2009 at 8:09 am #41151SupportKeymasterQUOTE (mbagheri @ Nov 20 2009, 10:02 AM) <{POST_SNAPBACK}>Hi
Yes, you have to change the main language to “Farsi”, in order for non Unicode programs to be able to show Farsi texts.
Thanks
Strange.. no results, after several tries I have '???' still..
In any case will be released the new version at the nearest days. Please try this version, some changes were added there.November 27, 2009 at 5:13 pm #41163mbagheriParticipantHi
I tested the new 6.51 version, the problem still exists.QUOTE (Support @ Nov 26 2009, 09:09 AM) <{POST_SNAPBACK}>Strange.. no results, after several tries I have '???' still..
In any case will be released the new version at the nearest days. Please try this version, some changes were added there.Maybe it's because you opened and saved the file containing Farsi Characters when the main language was not Farsi, in this case the Unicode characters will be converted and saved to '?'. I think you should download the source code of the test application after you changed your main language to Farsi. and try it again then.
Maybe this problem occurs because you changed the textout function from a Unicode version to a non-Unicode version or you handle Form.Caption differently. whatever it is, it was OK before and also other components are OK. just Form Caption is invalid.
Thanks again.
December 8, 2009 at 2:52 pm #41203SupportKeymasterHello
Could you compile a demo with locale defined manually for program?
In the Dpr insert “SetThreadLocale($0C01);” after “begin”. Try to compile it and send me this Exe please.December 11, 2009 at 9:59 am #41270mbagheriParticipantHi
I tested the new 6.52 version, but the problem still exists.
The followings are compiled with SetThreadLocale. (one with 6.51 and another with 6.52)
ThanksDecember 22, 2009 at 8:26 am #41351SupportKeymasterHi
It's not easy problem because my system must be reconfigured for the each test. I'll made more test soon on the virtual machine and I hope, that required result will be received.
Why you not uses the free TntControls package? You will not have a problem with True unicode in this case.December 29, 2009 at 6:52 pm #41371mbagheriParticipantHi
Is it possible for you to let me know which file and function is responsible for drawing on form caption area, so I can have a look at it.
and who knows maybe I could find a solution.Thanks
January 14, 2010 at 8:39 am #41432SupportKeymasterYou can search this line
CODEFCommonData.FCacheBmp.Canvas.Font.Handle := acGetTitleFont;in the sSkinProvider.pas file.
After the font initialization you can see a part of code with the caption drawing.
I have tried your program on other machine and have caption drawn correctly, seems (see screenshot).
It's strange… (why you don't want have a full unicode support?)May 1, 2010 at 9:17 pm #42405mbagheriParticipantHi
finally I think I found the problem.
I think when you initialize the Font (right before drawing form Title), The charset is “WESTERN”, but the component should read this value from the forms' Font property.The AddedTitle does not have this problem, because you can set it's Font directly and change the CharSet property. But If you set the charset to “WESTERN” then the AddedTitle would also be messed up like FormCaption.
In an older version (which didn't have this problem) the Font initialization was like this: “FCommonData.FCacheBmp.Canvas.Font.Assign(Form.Font);”
but right after changing this line to “FCommonData.FCacheBmp.Canvas.Font.Handle := acGetTitleFont;” this problem appeared.so I think this all happens because the charset property of the Title.
I added this line:
“FCommonData.FCacheBmp.Canvas.Font.Charset := Form.Font.Charset;”
after Font initialization in sskinprovider.pas, and it worked ok.Thanks
-
AuthorPosts
- You must be logged in to reply to this topic.