Jump to content
  • Advertisement
Sign in to follow this  
n3Xus

[C++ & Win32 (no MFC) ] How to make a spinner control with float/double type?

This topic is 3211 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I programatically create the spinner and its' edit box (with the CreateWindow(..) function), but I can't find a way to use float/double data type instead of integers. How can I do that?

Share this post


Link to post
Share on other sites
Advertisement
You could store the number internally as an integer, then display it as a multiple of a fixed float value.

For example, the range could be from -50 to 50, but displayed as -1.00 to 1.00 (controlled in multiples of 0.02)

Share this post


Link to post
Share on other sites
Yeah, that would be one way of doing, probably the most simple one. So floats aren't supported?

Share this post


Link to post
Share on other sites
Nope. You'll have to create the buddy window yourself, and handle the appropriate messages so it displays a real value, but interfaces with the spinner control with integer values.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!