CreateSlider ( x,y,width,height,group[,style] )
Parameters
|
x,y - position of the slider's top-left corner within the group's client area width,height - size of the slider group - window or gadget group that owns the slider style (optional) - orientation 1: horizontal (default) other values: vertical |
Description
|
Creates a scrollbar-style slider gadget and returns its handle. Requires Extended language mode. A slider is a native scrollbar with visible/total page semantics: SetSliderRange visible,total sizes the thumb as the fraction of the content that is on screen, and the value runs from 0 up to total minus visible. That makes it the right control for scrolling a view over something big - a tile map, a timeline, a long list of frames. A new slider starts with a visible size of 1 and a total of 10. Read the position with SliderValue and set it with SetSliderValue. While the user drags, the slider posts gadget-action events ($401) with the new value in EventData; these tracking events are replaceable snapshots, so under load the queue keeps only the newest rather than flooding your loop. If what you actually want is a "pick a number between min and max" control - volume, scale, brush size - use CreateTrackBar instead; the two are deliberately different gadgets. See it working in the layout and controls sample; the world editor shell sample shows the surrounding editor layout. See also: SetSliderRange, SetSliderValue, SliderValue, CreateTrackBar, CreateProgBar. |
Index