Solved

Delphi 7: How do I put a special currency character on a button on a Form?

Posted on 2009-07-08
12
964 Views
Last Modified: 2013-11-23
Dear Experts,

I need to put the character for Philippine Pesos (the capital letter P with two horizontal bars through it) on to a form.  I can make it appear in Microsoft Word 2003 by selecting the Arial Unicode font.  I tried copying and pasting from MS Word to Delphi 7 with no luck.  It appears as a question mark when pasted into Delphi whether or not I edit the form as a form or edit it as text.
Sincerely,
Philip Truscott
0
Comment
Question by:PTRUSCOTT
  • 6
  • 2
  • 2
  • +2
12 Comments
 
LVL 6

Expert Comment

by:twocandles
ID: 24802207
Delphi 7 (VCL) controls only support ASCII character based strings. You will have to use some third party controls unicode-enabled. Here you have some:

http://blog.gurock.com/postings/unicode-aware-delphi-third-party-components/270/


0
 
LVL 6

Expert Comment

by:FactorB
ID: 24803183
Make a small bitmap and use it like a glyph.
This way you will avoid text limitations.

Regards,
B.
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24804729
change the font character set of the button from default to ?? THAI_CHARSET ??
then you copy the text into the caption
i don't know if it works in design time
you may have to do it at runtime ...

button.Font.CharSet := 'THAI_CHARSET';
button.Caption := <Symbol for Pesos>
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24804818
if it's only 1 place you need a special char this works

if you need it all over you will have to change the font charset of all components you need it in

a translation component which does this for you is (not free) http://www.sicomponents.com/tsilang1.html 
0
 

Expert Comment

by:Johnny_D
ID: 24805682
Here is a free component for unicode text support:
http://cult-drang.com/program/tips/unicode/vcl/tlabel.html
I tested it so i can guarantee it works :)
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24807665
you don't need unicode support just to display 1 character in a other character set !
0
 
LVL 1

Author Comment

by:PTRUSCOTT
ID: 24819704
Dear Geert Gruwez,

You wrote "you don't need unicode support just to display 1 character in a other character set !"

So how do I do it then?

Earlier you wrote that I should try this?
button.Font.CharSet := 'THAI_CHARSET';
button.Caption := <Symbol for Pesos>

However I cannot insert the Peso symbol on the form.  
If I edit it as a form I cannot copy and paste the Peso symbol from MS Word.  It comes up as a question mark.  
If I literally type in <Symbol for Pesos> then I get the three words "Symbol for Pesos".

In MS Word I can make the Peso symbol appear by typing:
20A7 followed by ALT-X

Is there an Escape sequence?

I also tried editing the form as text with equally poor results.  

I really only do have one character in the whole application which is not in the standard Latin charset.
Best Wishes,
Phil
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24820863
seems you also need a special font to display it:
from the wikipedia site:
http://en.wikipedia.org/wiki/Talk:Philippine_peso#Peso_sign

This peso sign will only work if you are using the Segoe UI font.
To add the peso sign to an article, add this script before the number.

i followed the links,
first : http://en.wikipedia.org/wiki/Segoe#Segoe_UI

then it leads to microsoft (off course):
http://en.wikipedia.org/wiki/Windows_Media_Center
http://www.microsoft.com/windowsxp/mediacenter/default.mspx
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24820889
Getting this font seems to be a problem on it's own
I googled for segeo font and all the links only work for a short time ...
You'll have to get the Media Center (or get lucky)
0
 
LVL 6

Expert Comment

by:FactorB
ID: 24820939
If I was you I would make a glyph in 5 min. and sleep well.
Actually I made you the glyph. I was not sure which sign to use so I made two of them.
Regards,
B.
Pesos1-small.bmp
Pesos1-large.bmp
Pesos2-small.bmp
Pesos2-large.bmp
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 250 total points
ID: 24823269
or just use the text "piso"
0
 
LVL 1

Author Comment

by:PTRUSCOTT
ID: 24833587
Dear Geert Gruwez,

Your last and least technical advice seems best.

I think these comments have shown me that the implications of placing the real Peso symbol are so serious (for example having to worry that the user has a rare font) that I should not go down this road.

I will just use the three letter abbreviation for Philippine Peso instead (PHP).
Thanks Phil
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question