SetSliderRange - Maximum value?

BlitzMax Forums/BlitzMax GUI Programming/SetSliderRange - Maximum value?

Hi
It seems that the max range for a slider is 32767?

Is there a reason why this can't be an unsigned 32bit value rather than a signed 16bit?

Or, is there something I'm doing wrong which is only allowing this to be a maximum value??

Thanks
JP

It doesn't really matter. The slider can only show you the number of ticks as pixels it is wide. Just use some simple math to scale your numbers accordingly.

Hey TaskMaster,

Agreed, but even so - why limit to an (undocumented) signed 16 bit value? If we're just going to scale it, then a float 0.f - 1.0f would have made more sense from the start.

It's because the minimum and maximum values are packed into an int (MS LONG) when passed to the Win32 API.

You could tweak MaxGUIEx.bmx (TWindowsSlider.SetRange()) to use seperate TBM_SETRANGEMAX and TBM_SETRANGEMIN SendMessage() calls instead of the single TBM_SETRANGE it uses now.

But as TaskMaster said, does it really matter?


[edit]
If you're not using MaxGUIEx, you really should be as it's a vast improvement over the original version.
[/edit]

Thanks for your replies. Again, happy to scale things - Thats a given, but just wanted to really know why the limit was in place. So, thanks for explaining, Yan.

Jason