Solved

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

Posted on 2009-07-08
12
960 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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 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…

772 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