OWLNext 7.0
Borland's Object Windows Library for the modern age
|
An abstract base class derived from TScrollBar, TSlider defines the basic behavior of sliders (controls that are used for providing nonscrolling, position information).
Like scroll bars, sliders have minimum and maximum positions as well as line and page magnitude. Sliders can be moved using either the mouse or the keyboard. If you use a mouse to move the slider, you can drag the thumb position, click on the slot on either side of the thumb position to move the thumb by a specified amount (PageMagnitude), or click on the ruler to position the thumb at a specific spot on the slider. The keyboard's Home and End keys move the thumb position to the minimum (Min) and maximum (Max) positions on the slider.
You can use TSlider 's member functions to cause the thumb positions to automatically align with the nearest tick positions. (This is referred to as snapping.) You can also specify the tick gaps (the space between the lines that separate the major divisions of the X- or Y-axis).
THSlider" (horizontal slider) and TVSlider (vertical slider) are derived from Tslider. The native control for Windows95 is the Trackbar common control. @image html bm70.bmp @section usingsliders Using Sliders -# \#include <owl/slider.h> in the .cpp files for declarations of THSlider and TVSlider. -# \#include <owl/slider.rc> as a resource in the .rc file. This file contains the bitmaps used to draw the slider. -# Construct the control. Use THSlider for a horizontal slider. Use TVSlider for a vertical slider. @code Thermostat = new THSlider(this, IDC_THERMOSTAT, 70, 130, 240, 40); OutsideTemp = new TVSlider(this, IDC_OUTSIDETEMP, 330, 30, 32, 160); \endcode -# Set the properties after THSlider::SetupWindow or TVSlider::SetupWindow has been called. @code Thermostat->SetRange(40, 120); Thermostat->SetRuler(5, false); Thermostat->SetPosition(75); \endcode @section seealso See Also - \ref usingscrollbars "Using Scroll Bars"