home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-13 | 2.4 KB | 57 lines | [TEXT/KAHL] |
- //------------------------- © 1994-1995 by James G. Stout ---------------------------
- // File : cdefHSlider.h
- // Date : April 6, 1994
- // Author : Jim Stout
- // Purpose : A slider CDEF like the one in the Brightness Control panel.
- // :
- // : This control has some non-standard behaviors.
- // :
- // : 1. It has a fixed size (does not scale like a scrollbar).
- // : 2. The control rect should be 121 pixels wide and 24 high
- // : or it will be clipped when drawn.
- // : 3. Control Min & Max will be filled in for you.
- // : Min = 0
- // : Max = 100
- // : 4. There is no control title.
- // :
- // : 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 scaleNoFill 0x0001 // empty white (or bg color) scale
- #define ctl3D 0x0002 // 3D effect similar to color windows
- #define scaleGray 0x0004 // scaled filled with gray pattern
-
- //----------------------------------------------------------------------------------
- // CDEF private data structure
- //----------------------------------------------------------------------------------
-
- typedef struct {
- CGrafPtr offPort;
- Rect scaleRect;
- short pDepth;
- short qdVers;
- }CDEFData,**CDEFHandle;
-
- //----------------------------------------------------------------------------------
- // Function prototypes
- //----------------------------------------------------------------------------------
- static void doInit (ControlHandle theControl);
- static void doDisp (ControlHandle theControl);
- static long doTest (ControlHandle theControl, short varCode, long param);
- static void dragThumb (ControlHandle theControl, short varCode, long param);
- static void scaleClick (ControlHandle theControl, short varCode, short partCode);
- static void getThumbRect (ControlHandle theControl, Rect *rThumb, Rect * rScale);
- static Boolean drawParts (ControlHandle theControl, short varCode, Rect * rThumb);
- static void doDraw (ControlHandle theControl, short varCode);
-