Possible to use wide char strings in custom tooltips?

For topics related to the creation of simulation objects (SimObjects). This includes development of aircraft, ground, and maritime vehicles.
Post Reply
Posts: 45
Joined: Sun Nov 27, 2011 11:13 am

Possible to use wide char strings in custom tooltips?

Post by SimonRobbins »

I'm looking to extract all the additional text my aircraft uses in custom tooltips and C dialogs to a set of token strings in a data file that my aircraft will parse at load time, enabling customers to create their own localised versions by simply translating the tokens in the data file. This will necessitate the used of wide char (WCHAR) strings in the custom tooltips to cope with foriegn language character sets.

To test whether this idea is even possible, I created a tiny project and tried to assign a wide char string to a tooltip like this:

WCHAR test_tooltip[1024] = L"Test wchar tooltip";

MOUSE_BEGIN( test_switch_mouse_rect, 0, 0, 0 )
MOUSE_CHILD_FUNCT( 0, 0, 42, 98, CURSOR_HAND, MOUSE_LEFTSINGLE, test_switch_action_cb)

In my project general settings the character set is set to Unicode and so WCHAR resolves to wchar_t as expected.

When I hover the mouse over the gauge the tooltip just shows the first character "T".

Any idea if what I'm trying to do is even possible and if so, what I'm doing wrong? I've traced through the mouse macros in gauges.h and they do look should resolve to coping with either normal or wide char strings depending on the project settings.


User avatar
Rob McCarthy
Lockheed Martin
Posts: 3091
Joined: Wed Aug 24, 2011 1:37 pm

Re: Possible to use wide char strings in custom tooltips?

Post by Rob McCarthy »

Hi Si,

Currently the gauge system only supports narrow characters.

Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
Post Reply