home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dovetail.zip / slider.h < prev    next >
C/C++ Source or Header  |  1994-04-07  |  1KB  |  37 lines

  1. /*
  2.   Somewhat advanced slider control
  3.   Floating point values can be assigned to each tick mark.  The
  4.   float conversion operator then returns a linearly interpolated value
  5.   based on the values of the tick marks the slider is between.  The
  6.   default tickmark values are 0,1,2...
  7.  
  8.   The SetArmPos and SetDetent methods are also based on the tick mark
  9.   values.
  10. */
  11. #ifndef _SLIDER_INC
  12. #define _SLIDER_INC
  13. #include "control.h"
  14.  
  15. #define DEFSTYLE  SLS_HORIZONTAL|SLS_CENTER|SLS_HOMELEFT|SLS_PRIMARYSCALE1
  16.  
  17. class Slider : public virtual Control
  18.    {
  19.     private:
  20.             ULONG    ulNumTicks;    //  Number of Tick Marks in control
  21.             float *  pfTickVals;
  22.     public:
  23.                      Slider (HWND,ULONG,SHORT, SHORT, SHORT,SHORT,ULONG,
  24.                              ULONG=DEFSTYLE);
  25.                      Slider (HWND,ULONG);
  26.                     ~Slider();
  27.                      operator float ();
  28.                      operator ULONG ();
  29.            VOID      SetArmPos(float);
  30.            VOID      SetTicks();
  31.            VOID      SetTickVals(float *);
  32.            VOID      SetDetent(float);
  33.            VOID      SetTickText(SHORT,char *);
  34.    };
  35. #undef DEFSTYLE
  36. #endif
  37.