Ohm and Mho Symbols

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
spflanze
Earned some good credits
Earned some good credits
Posts: 130
Joined: Tue Feb 15, 2011 10:02 pm

Ohm and Mho Symbols

Post by spflanze »

I desire to use the Greek capital omega glyph for resistance units, and the upside down capital omega glyph for conductance units. I looked up the character codes for these symbols and attempted implement them this way:

Code: Select all

// Ref: http://www.fileformat.info/info/unicode/char/2126/index.htm
const char* ResistUnits[] =  { "u\u2126", "m\u2126", " \u2126", "k\u2126", "M\u2126" };

// Ref: http://www.fileformat.info/info/unicode/char/2127/index.htm
const char* CondUnits[] =  { "u\u2127", "m\u2127", " \u2127", "k\u2127", "M\u2127" };
When I installed these strings as choices in a wxGridCellChoiceEditor type object I did not get the hoped for result. What is the right way to do this?
User avatar
xaviou
Super wx Problem Solver
Super wx Problem Solver
Posts: 437
Joined: Mon Aug 21, 2006 3:18 pm
Location: Annecy - France
Contact:

Re: Ohm and Mho Symbols

Post by xaviou »

Hi

You can try with the following :

Code: Select all

const wxChar* ResistUnits[] =  { _T("u\u2126"), _T("m\u2126"), _T(" \u2126"), _T("k\u2126"), _T("M\u2126") };
const wxChar* CondUnits[] =  { _T("u\u2127"), _T("m\u2127"), _T(" \u2127"), _T("k\u2127"), _T("M\u2127") };
If you just specify simples quotation marks, this means "char" but you gives unicode chars so the conversion (done internally by the framework) can't works.

Regards
Xav'
My wxWidgets stuff web page : X@v's wxStuff
Post Reply