Jump to content
Sign in to follow this  

Recommended Posts

Guest jp_langer

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

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)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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
Guest jp_langer

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...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...