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.
SimonRobbins
Posts: 39
Joined: Sun Nov 27, 2011 11:13 am

Possible to use wide char strings in custom tooltips?

Postby SimonRobbins » Sun Sep 23, 2018 7:33 pm

Hi,
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_PARENT_BEGIN(0, 0, 42, 98, HELP_NONE)
MOUSE_TOOLTIP_STRING(test_tooltip)
MOUSE_PARENT_END
MOUSE_CHILD_FUNCT( 0, 0, 42, 98, CURSOR_HAND, MOUSE_LEFTSINGLE, test_switch_action_cb)
MOUSE_END

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.

Thanks,

Si

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

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

Postby Rob McCarthy » Tue Dec 04, 2018 12:37 pm

Hi Si,

Currently the gauge system only supports narrow characters.

Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead


Return to “Simulation Object Development Questions”

Who is online

Users browsing this forum: No registered users and 6 guests