SetSliderRange - Maximum value?

BlitzMax Forums/MaxGUI Module/SetSliderRange - Maximum value?

jp22(Posted 2008) [#1]
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


TaskMaster(Posted 2008) [#2]
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.


jp22(Posted 2008) [#3]
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.


Yan(Posted 2008) [#4]
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]


jp22(Posted 2008) [#5]
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