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
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 » Sat Oct 28, 2017 1:12 am

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 429
Joined: Mon Aug 21, 2006 3:18 pm
Location: Annecy - France

Re: Ohm and Mho Symbols

Post by xaviou » Sat Oct 28, 2017 8:09 am


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.

My wxWidgets stuff web page : [email protected]'s wxStuff

Post Reply