Solved

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

Posted on 2009-07-08
12
953 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 36

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
 
LVL 36

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 36

Expert Comment

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

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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 36

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 36

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 36

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now