home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Code Resources / SliderCDEF 1.0 / SliderCDEF Source ƒ / SliderTestControl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-10  |  548 b   |  24 lines  |  [TEXT/KAHL]

  1. #include "SliderCDEF.h"
  2.  
  3. // SliderTestControl
  4. //
  5. // Finds the part, if any, that the point is in.
  6. long SliderTestControl( short varCode, ControlHandle theControl, long param )
  7. {
  8.     Rect        thumbRect;
  9.     Point        clickLoc;
  10.  
  11.     // The test point is contained in param.
  12.     clickLoc.v = HiWord( param );
  13.     clickLoc.h = LoWord( param );
  14.     
  15.     // Calculate the thumb rectangle
  16.     thumbRect = CalcThumbRect( theControl );
  17.     
  18.     // If in the thumb, return 129 (standard part code )
  19.     if ( PtInRect( clickLoc, &thumbRect ) ) {
  20.         return (long) inThumb;
  21.     } else {
  22.         return 0L;
  23.     }
  24. }