home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / PopupCDEF-10b4 / Source / PopupCDEF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  2.0 KB  |  55 lines  |  [TEXT/KAHL]

  1. /* See the file Distribution for distribution terms.
  2.     (c) Copyright 1994 Ari Halberstadt */
  3.  
  4. /* This file contains definitions for using my popup CDEF.
  5.     94/03/15 aih - split out of PopupLib.h */
  6.  
  7. #pragma once
  8.  
  9. #include <Menus.h>
  10.  
  11. /* Version of this library. Useful for compatability between older versions
  12.     of the CDEF and using a newer version of the popup library to manipulate
  13.     the CDEF popups from within a program. The program must first check the
  14.     popup's version before calling any popup library routines. */
  15. #define kPopupVersion    (2)
  16.  
  17. /* Part codes. */
  18. enum {
  19.     kPopupPartCode = 1,            /* returned when the mouse is in a popup menu */
  20.  
  21.     /*    Part codes used for specifying colors in the control's color table.
  22.         program_note: not implemented yet. */
  23.     kPopupPartTitle = 256,        /* title rectangle */
  24.     kPopupPartTitleBack,            /* background color of title rectangle */
  25.     kPopupPartTitleFore,            /* color of title string */
  26.     kPopupPartItem,                /* current item rectangle */
  27.     kPopupPartItemBack,            /* background color of current item rectangle */
  28.     kPopupPartItemFore,            /* color of current item string */
  29.     kPopupPartIcon,                /* current item icon */
  30.     kPopupPartArrow,                /* down arrow */
  31.     kPopupPartFrame,                /* frame around current item */
  32.     kPopupPartShadow,                /* drop shadow */
  33.     
  34.     kPopupPartLast
  35. };
  36.  
  37. /*    The control variation code popupTypeIn is used by the popup CDEF.
  38.     With this variation code, only the popup's down arrow is drawn,
  39.     the popup's title and current selection are not drawn. Type-in
  40.     popup menus are described in IM-VI, p2-37. */
  41. #define kPopupTypeIn        (2)
  42. #define popupTypeIn        (2)
  43.  
  44. /* The procID for the popup CDEF. You can use this value in calls
  45.     to NewControl. */
  46. #define kPopupProcID        (129 * 16)
  47.  
  48. /* This is the same structure as the popupPrivateData record described
  49.     in IM-VI, p3-19. By making this the first element in the popup
  50.     structure, the CDEF is made more compatible with Apple's CDEF. */
  51. typedef struct {
  52.     MenuHandle    mHandle;            /* handle to the popup's menu */
  53.     short            mID;                /* id of popup's menu */
  54. } PopupPrivateType, *PopupPrivatePtr, **PopupPrivateHandle;
  55.