home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594b.lha / Precognition_rel1 / Slider.h < prev    next >
C/C++ Source or Header  |  1991-12-12  |  2KB  |  89 lines

  1. /* ==========================================================================
  2. **
  3. **                             Slider.h
  4. **
  5. ** Object<GraphicObject<Interactor<Valuator<Positioner<Sliders
  6. **
  7. ** Sliders are proportional gadgets.
  8. **
  9. **
  10. ** ©1991 WILLISoft
  11. **
  12. ** ==========================================================================
  13. */
  14.  
  15. #ifndef SLIDER_H
  16. #define SLIDER_H
  17.  
  18.  
  19. #include "Precognition_utils.h"
  20. #include "Precognition3D.h"
  21. #include "pcgWindow.h"
  22. #include "EmbossedGadget.h"
  23. #include "Positioner.h"
  24.  
  25. typedef struct SliderMap
  26.    {
  27.       SHORT Min;
  28.       SHORT Max;
  29.       SHORT Pot;
  30.       SHORT Body;
  31.    } SliderMap;
  32.    /* This data type is used to 'map' the desired range of a
  33.    ** a PropGadget to its actual range.  (i.e. Intuition uses
  34.    ** a range of 0..65536.  Usually the application has another
  35.    ** range in mind.
  36.    */
  37.  
  38.  
  39. typedef struct Slider
  40. {
  41.    EmbossedGadget   eg;
  42.    struct PropInfo  Prop;
  43.    WORD             AutoKnob[4];
  44. } Slider;
  45.  
  46.  
  47. void Slider_Init( Slider       *self,
  48.                   PIXELS        LeftEdge,
  49.                   PIXELS        TopEdge,
  50.                   PIXELS        Width,
  51.                   PIXELS        Height,
  52.                   pcg_3DPens    Pens );
  53. /* The following function initializes an autoknob
  54. ** propgadget.  The gadget is initialized to be full size.
  55. ** The relevant fields which are initialized are:
  56. **    Flags        = GADGHCOMP;
  57. **    GadgetType   = PROPGADGET;
  58. **    GadgetRender = &AutoKnob;
  59. **    SelectRender = NULL;
  60. **    SpecialInfo  = &Prop;
  61. **    Prop.Flags   = AUTOKNOB | BORDERLESS;
  62. **
  63. ** You have to do everything else.
  64. */
  65.  
  66.  
  67. void SliderClass_Init( struct PositionerClass *class );
  68.  
  69.  
  70.  
  71. /*
  72. ** SlideLower() moves the slider knob toward position 0. NOTE that
  73. ** 'Lower' is relative to the position range, NOT THE DIRECTION
  74. ** IT MOVES ON THE SCREEN.  For a VSlider, position 0 (and therefore
  75. ** 'lower') is toward the TOP of the screen.
  76. **
  77. ** SlideHigher() moves the slider knob toward position 0xFFFF.
  78. **
  79. ** In both cases, the amount of movement is proportional to the
  80. ** size of the knob.
  81. */
  82.  
  83. void SlideLower( Slider *self );
  84.  
  85. void SlideHigher( Slider *self );
  86.  
  87.  
  88. #endif
  89.