Page 1 of 1

Possible to use wide char strings in custom tooltips?

Posted: Sun Sep 23, 2018 7:33 pm
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.



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

Posted: Tue Dec 04, 2018 12:37 pm
by Rob McCarthy
Hi Si,

Currently the gauge system only supports narrow characters.

Rob McCarthy