/* ==========================================================================
**
**                             Slider.h
**
** Object<GraphicObject<Interactor<Valuator<Positioner<Sliders
**
** Sliders are proportional gadgets.
**
**
** ©1991 WILLISoft
**
** ==========================================================================
*/

#ifndef SLIDER_H
#define SLIDER_H


#include "Precognition_utils.h"
#include "Precognition3D.h"
#include "pcgWindow.h"
#include "EmbossedGadget.h"
#include "Positioner.h"

typedef struct SliderMap
   {
      SHORT Min;
      SHORT Max;
      SHORT Pot;
      SHORT Body;
   } SliderMap;
   /* This data type is used to 'map' the desired range of a
   ** a PropGadget to its actual range.  (i.e. Intuition uses
   ** a range of 0..65536.  Usually the application has another
   ** range in mind.
   */


typedef struct Slider
{
   EmbossedGadget   eg;
   struct PropInfo  Prop;
   WORD             AutoKnob[4];
} Slider;


void Slider_Init( Slider       *self,
                  PIXELS        LeftEdge,
                  PIXELS        TopEdge,
                  PIXELS        Width,
                  PIXELS        Height,
                  pcg_3DPens    Pens );
/* The following function initializes an autoknob
** propgadget.  The gadget is initialized to be full size.
** The relevant fields which are initialized are:
**    Flags        = GADGHCOMP;
**    GadgetType   = PROPGADGET;
**    GadgetRender = &AutoKnob;
**    SelectRender = NULL;
**    SpecialInfo  = &Prop;
**    Prop.Flags   = AUTOKNOB | BORDERLESS;
**
** You have to do everything else.
*/


void SliderClass_Init( struct PositionerClass *class );



/*
** SlideLower() moves the slider knob toward position 0. NOTE that
** 'Lower' is relative to the position range, NOT THE DIRECTION
** IT MOVES ON THE SCREEN.  For a VSlider, position 0 (and therefore
** 'lower') is toward the TOP of the screen.
**
** SlideHigher() moves the slider knob toward position 0xFFFF.
**
** In both cases, the amount of movement is proportional to the
** size of the knob.
*/

void SlideLower( Slider *self );

void SlideHigher( Slider *self );


#endif
