home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 2.8 KB | 64 lines | [TEXT/KAHL] |
- //------------------------- © 1995 by James G. Stout -------------------------------
- // File : cdefSlider.h
- // Date : April 8, 1995
- // Author : Jim Stout
- // Purpose : A slider CDEF
- // :
- // : If you find a use for this, I'd love to know about it. Bug reports
- // : are always interesting.
- // :
- // : Internet : JimS@WRQ.COM(work hours, PST)
- // : AppleLink : WRQ (daily)
- // : CompuServe : 73240,2052 (weekly or so)
- // : AOL : JasG (weekly or so)
- // : eWorld : Jim Stout (weekly or so)
- //----------------------------------------------------------------------------------
-
- //----------------------------------------------------------------------------------
- // variation codes
- //----------------------------------------------------------------------------------
-
- #define narrowScale 0x0001 // inset 2 pixels along each edge, thumb is 4 larger
- #define narrowScale2 0x0002 // inset 4 pixels along each edge, thumb is 8 larger
- #define filledScale 0x0004 // low end of scale filled with cTingeDark
- #define snapToScale 0x0008 // click on scale moves thumb to that point
-
- //----------------------------------------------------------------------------------
- // partCodes returned to actionProc
- //----------------------------------------------------------------------------------
- #define inThumb 0x0001
- #define inUpScale 0x0002
- #define inDnScale 0x0003
-
- //----------------------------------------------------------------------------------
- // CDEF private data structure
- //----------------------------------------------------------------------------------
-
- typedef struct {
- CGrafPtr offPort;
- short qdVers;
- }CDEFData,**CDEFHandle;
-
- //----------------------------------------------------------------------------------
- // Function prototypes
- //----------------------------------------------------------------------------------
- static void doInit (ControlHandle theCtl);
- static void doDisp (ControlHandle theCtl);
- static long doTest (ControlHandle theCtl, short varCode, long param);
-
- static void doDraw (ControlHandle cHdl, short varCode);
- pascal void drawControl (short depth, short dFlags, GDHandle theDevice, long userData);
-
-
- static void dragThumb (ControlHandle theCtl, short varCode, long param);
- static void scaleClick (ControlHandle theCtl, short varCode, short partCode, Point p);
- static void getThumbRect (ControlHandle theCtl, Rect * rThumb,
- Rect * rScale, Boolean vert);
- static short getThumbOffset (ControlHandle theCtl, Boolean vert, short thumbSize);
- static void checkLimits (Boolean vert, Rect *rThumb, Rect *rScale);
- static short getNewValue (ControlHandle theCtl, Boolean vert, short thumbPos);
- static void adjustControl (ControlHandle theCtl, short varCode,
- short partCode, short newVal);
- static Boolean drawParts (ControlHandle theCtl, short varCode, Boolean inColor,
- Rect * offRect);
-