home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 1.8 KB | 48 lines | [TEXT/KAHL] |
- //------------------------- © 1991-1995 by James G. Stout --------------------------
- // File : cdefTog.h
- // Date : November 2,1991
- // Author : Jim Stout
- // Purpose : A CDEF to implement Tog's buttons
- // : use procID : 104 * 16 + varCode
- // : when calling NewControl() or in your resource template.
- // : This CDEF supports the System 7 style gray drawing of an
- // : inactive control and the useWindFont varCode.
- //----------------------------------------------------------------------------------
-
- #define EMBOSS 1
- #define NORMAL 0
- #define PUSHED 1
- #define OFF 0
-
- #define WINBITMAP(w) ((((WindowPeek)(w))->port).portBits)
- #define WINPORTRECT(w) ((((WindowPeek)(w))->port).portRect)
- //----------------------------------------------------------------------------------
- // CDEF private data
- //----------------------------------------------------------------------------------
- typedef struct {
- short txFont;
- short txSize;
- short txFace;
- }CDEFData,**CDEFHandle;
-
- //----------------------------------------------------------------------------------
- // Function prototypes
- //----------------------------------------------------------------------------------
- static long doInit (ControlHandle theCtl);
-
- static long doDisp (ControlHandle theCtl);
-
- static void doDraw (ControlHandle cHdl, short varCode);
-
- pascal void drawControl (short depth, short dFlags, GDHandle theDevice, long userData);
-
- static void drawTog (ControlHandle cHdl, Rect *r, Boolean inColor);
-
- static void drawTitle (ControlHandle cHdl, Rect *r, short lnHt, short lnAdj,
- Boolean emboss, Boolean pushed);
- static void getNextLine (Str255 t, Str255 s, short num);
-
- static PixMapHandle getLockedPixels (CGrafPtr * offPort, short qdVers);
- static void unlockPixels (PixMapHandle pmHdl, short qdVers);
- static short getQDVers (void);
-