Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-07-08
12
Medium Priority
?
991 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 38

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 38

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 38

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 38

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 38

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 38

Accepted Solution

by:
Geert Gruwez earned 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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 and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

636 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