home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Sample Code / Music Architecture / Embedding Instruments / BigEasy / BigEasyDialogs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-07  |  2.7 KB  |  114 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        BigEasyDialogs.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    xxx put writers here xxx
  7.  
  8.     Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <2+>      5/5/93    dvb        Fields & controls.
  13.          <2>      4/3/92    dvb        New calls for getting text & numbers.
  14.          <1>     1/20/92    dvb        first checked in
  15.  
  16. */
  17.  
  18. /* file: BigEasyDialogs.h
  19.  *
  20.  * Started 2 January 1992, more or less.
  21.  *
  22.  */
  23.  
  24.  
  25.  
  26. /*--------------------------
  27.     Inclusions
  28. --------------------------*/
  29.  
  30. #include <Types.h>
  31.  
  32. /*--------------------------
  33.     Types
  34. --------------------------*/
  35.  
  36. typedef void (*beDialogUpdate)(long refcon,const Rect *updateRect);
  37. typedef void (*beDialogKey)(long refcon,short key,short mods);
  38. typedef void (*beDialogClick)(long refcon,Point p,short mods);
  39. typedef void (*beDialogIdle)(long refcon);
  40.  
  41.  
  42. typedef struct
  43.     {
  44.     short count;
  45.     short defaultButton;        /* highlighted, and <return> hits it */
  46.     short cancelButton;            /* cmd-. or 'escape' hits it */
  47.     struct
  48.         {
  49.         Str31 name;
  50.         char key;                /* cmd-key for the button, or 0 for none */
  51.         } button[5];
  52.     } EasyDialogButtonList;
  53.  
  54. #define kEasyDialogOkay ((EasyDialogButtonList *)-1)
  55. #define kEasyDialogOkayCancel ((EasyDialogButtonList *)-2)
  56. #define kEasyDialogCancelOkay ((EasyDialogButtonList *)-3)
  57. #define kEasyDialogSaveDiscardCancel ((EasyDialogButtonList *)-4)
  58.  
  59. typedef enum
  60.     {
  61.     easyButton,                /* long */
  62.     easyCheckbox,            /* long */
  63.     easyRadioGroup,            /* long */
  64.     easyTextNumber,            /* 256 bytes */
  65.     easyTextString            /* long */
  66.     };
  67.  
  68. typedef void (*EasyFieldDialogProc)(short itemNumber,struct EasyField *field);        
  69.  
  70.  
  71. typedef struct
  72.     {
  73.     char itemNumber;
  74.     char itemCount;            /* How many of that type. */
  75.     char itemType;            /* Regular buttons terminate dialog */
  76.     char general;            /* fractional bits for number */
  77.     } EasyField;
  78.  
  79. typedef struct
  80.     {
  81.     short defaultButton;        /* one for enter key, and roundrected */
  82.     short cancelButton;            /* one for esc and cmd-., and makes no change in output */
  83.     EasyField field[100];
  84.     } EasyFieldList;
  85.  
  86.  
  87. /*--------------------------
  88.     Routines
  89. --------------------------*/
  90.  
  91. long EasyDialog(Rect *windowRect,
  92.         beDialogUpdate updateProc,
  93.         beDialogKey keyProc,
  94.         beDialogClick clickProc,
  95.         beDialogIdle idleProc,
  96.         EasyDialogButtonList *buttonList,
  97.         long refcon);
  98.  
  99. short EasyDialogMessage(short iconID,
  100.         StringPtr header,StringPtr body,
  101.         EasyDialogButtonList *buttonList);
  102.  
  103. Boolean EasyDialogGetString(const StringPtr dialogTitle,
  104.         const StringPtr dialogPrompt,
  105.         StringPtr inOutString,short maxInOutStringLength);
  106.  
  107. Boolean EasyDialogGetNumber(const StringPtr dialogTitle,
  108.         const StringPtr dialogPrompt,
  109.         long *inOutNumber);
  110.  
  111. Boolean EasyFieldDialog(short dialogID,EasyFieldList *fieldList,void *data,
  112.         StringPtr dialogTitle);
  113.  
  114.