home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Code Resources / Jims CDEFs 1.50 / CDEF Source / source / cdefHSlider.h < prev    next >
Encoding:
Text File  |  1995-11-13  |  2.4 KB  |  57 lines  |  [TEXT/KAHL]

  1. //------------------------- © 1994-1995 by James G. Stout ---------------------------
  2. //    File    : cdefHSlider.h
  3. //    Date    : April 6, 1994
  4. //    Author    : Jim Stout
  5. //    Purpose    : A slider CDEF like the one in the Brightness Control panel.
  6. //            :
  7. //            : This control has some non-standard behaviors.
  8. //            :
  9. //            : 1. It has a fixed size (does not scale like a scrollbar).
  10. //            : 2. The control rect should be 121 pixels wide and 24 high
  11. //            :        or it will be clipped when drawn.
  12. //            : 3. Control Min & Max will be filled in for you.
  13. //            :        Min = 0
  14. //            :        Max = 100
  15. //            : 4. There is no control title.
  16. //            :
  17. //            : If you find a use for this, I'd love to know about it.  Bug reports
  18. //            : are always interesting.
  19. //            :
  20. //            : Internet    : JimS@WRQ.COM(work hours, PST)
  21. //            : AppleLink   : WRQ            (daily)
  22. //            : CompuServe  : 73240,2052    (weekly or so)
  23. //            : AOL         : JasG        (weekly or so)
  24. //            : eWorld      : Jim Stout    (weekly or so)
  25. //----------------------------------------------------------------------------------
  26.  
  27. //----------------------------------------------------------------------------------
  28. // variation codes
  29. //----------------------------------------------------------------------------------
  30.  
  31. #define scaleNoFill      0x0001    // empty white (or bg color) scale
  32. #define ctl3D            0x0002    // 3D effect similar to color windows
  33. #define scaleGray        0x0004    // scaled filled with gray pattern
  34.  
  35. //----------------------------------------------------------------------------------
  36. // CDEF private data structure    
  37. //----------------------------------------------------------------------------------
  38.  
  39. typedef struct {
  40. CGrafPtr    offPort;
  41. Rect        scaleRect;
  42. short        pDepth;
  43. short        qdVers;
  44. }CDEFData,**CDEFHandle;
  45.  
  46. //----------------------------------------------------------------------------------
  47. //    Function prototypes
  48. //----------------------------------------------------------------------------------
  49. static void doInit            (ControlHandle theControl);
  50. static void doDisp            (ControlHandle theControl);
  51. static long doTest            (ControlHandle theControl, short varCode, long param);
  52. static void dragThumb        (ControlHandle theControl, short varCode, long param);
  53. static void scaleClick        (ControlHandle theControl, short varCode, short partCode);
  54. static void getThumbRect    (ControlHandle theControl, Rect *rThumb, Rect * rScale);
  55. static Boolean    drawParts    (ControlHandle theControl, short varCode, Rect * rThumb);
  56. static void doDraw            (ControlHandle theControl, short varCode);
  57.