Btw, beware of the usability issue with sliders. Sliders usually operate on a range of integers e.g. 0 to 100.
Don't make it so that the slider maximum value is one-to-one with the number of pages of a thread. E.g. 100 page thread = 100 max value on a slider. That just makes it too hard to land on an exact integer for an exact page.
Make the slider value 1:10 instead or even 1:100, e.g. 100 page thread = 1000 max value on slider, or 10000 max value respectively. That way, you can have ranges of integers for each page, such as the following for a 1:100 ratio:
0-99= page 1
100-199 = page 2
200-299 = page 3
...
9900-10000 page 100
You can easily find the page number the value of the slider is on by integer division, because integer always truncates any decimal values off. So simply divide by 100.
so like a value of 550 on a slider would be
550/100 = 5.5 = 5
then
5+1 = 6 -> page 6 (since page 6 is in the range 500-599)
and as a special case for 10000th integer,
if (slider.getValue() == 10000)
then pagenumber = 100
Edit: I suggest the mouse wheel to perhaps decrement/increment by 50 integers on default.
All mouse wheels have different speeds however, in my case, it scrolls really fast so the magic number for me would be like 20 integers. You could put the decrement/increment as a custom number option in the Options menu.
Edit: Hotkey idea: Hold shift key while scrolling on mouse to scroll the bar without having to click on the bar to focus on it. Hit enter to go to the page.
21-Mar-2015 19:50:11
- Last edited on
21-Mar-2015 20:17:37
by
Lifer