Scrollbars
BlitzMax Forums/MaxGUI Module/Scrollbars
| ||
Okay, so I obviously left my brain in the snow somewhere today : For the default SLIDER_SCROLLBAR style the range0,range1 parameters are treated as a visible / total ratio which dictates both the size of the knob and it's maximum value. The default value is 1,10 which displays a Slider with a knob that occupies 1/10th the area and with a #SliderValue range of 0..9. So, if I passed in 118, 321, what am I expecting? A range from 0 to 321, and what about the 118? TIA :-) |
| ||
Isn't the first value the position of the scroll bar? So you'll have 0 to 320 (not 321!) and the scrollbar on position 118. (At least is what I understood from the text above, didn't try it hehehe) |
| ||
The slider is drawn so on screen its size is range1/range2 of the entire range. The minimum value is 0 and the maximum is range2-range1. So in your example the size of the "knob" would be 118/321 of the visual range and the possible values would be 0 to 203. |
| ||
f.e. A window in your app has a width of 118 and you want to show a picture of 321 pixels in it. So you need a slider: The 321 represent the size of a canvas in a window, where the picture is draw with an offset. The 118 is the inner size of the window. The slider can send values from 0 to 203 to set the X-offset form 0 (left edge of picture is visible) to -203 (right edge of picture is visible) Last edited 2013 |
| ||
Ah! Now it's all making sense. Thanks for the help folks! :o) |