Sign in to follow this  

Recommended Posts

Hello,I would appreciate some help to get my dynamic mouse tooltip give me the frequency with the decimals for my radio COM1.Actually, I have a static variable and a callback calculating and returning the right frequency value.Arg_Get_Frequency, returns it. So I have declared the arguments array as followsstatic MOUSE_TOOLTIP_ARGS(com_freq_arg) MOUSE_TOOLTIP_ARG(MODULE_VAR_NONE, 0, NULL, NULL, NULL, Arg_Get_Frequency, NULL, NULL) MOUSE_TOOLTIP_ARGS_ENDand made the mouse tooltip like hereafter :static MOUSE_BEGIN( mouse_rect, HELP_NONE, 0, 0 ) MOUSE_TOOLTIP_TEXT_STRING("Communications Radio COM1 - %1!d.! MHz",com_freq_arg) ...... MOUSE_ENDIn that case I get the integer value of the frequency in the help.How can I get the frequency with the decimals ?I tried :MOUSE_TOOLTIP_TEXT_STRING("Communications Radio COM1 - %!07.3f! MHz",com_freq_arg)but it does not work;Any help would be greatly appreciatedThanksJean-Pierre

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

How have you declared com_freq_arg? Is it an int or float? If it is an integer (int) type, then try casting the variable with (float):MOUSE_TOOLTIP_TEXT_STRING("Communications Radio COM1 - %!07.3f! MHz",(float)com_freq_arg)

Share this post


Link to post
Share on other sites

Change this:MOUSE_TOOLTIP_TEXT_STRING("Communications Radio COM1 - %!07.3f! MHz",com_freq_arg)to this:MOUSE_TOOLTIP_TEXT_STRING("Communications Radio COM1 - %1!07.3f! MHz",com_freq_arg)You lost the '1' after the '%' symbol.Doug

Share this post


Link to post
Share on other sites

Hello,Thanks to all of you, the right answer wasMOUSE_TOOLTIP_TEXT_STRING("Communications Radio COM1 - %1!07.3f! MHz",com_freq_arg)Adding a 1 fefore the format telles which arguments array entry is selected. Without it, the entry would be 0. I had forgotten that.Here is the result on my "new" old type radioThanks once moreJean-Pierre

Share this post


Link to post
Share on other sites

Hmmm... I'm happy that Doug had the right answer, 'cause I was sure way off base... ;)The gauge looks nice, although I had to 'save it' to a temp file and rename it to xxx.jpg in order to see it...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this