home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 634.lha / ppdata_v1.0 / src.LZH / src / messages.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-11  |  1.1 KB  |  59 lines

  1. /*
  2. *    messages.c
  3. *
  4. *    Routines to display requesters (by EasyRequest).
  5. *
  6. *    MWS, 3/92.
  7. */
  8.  
  9. #include <exec/types.h>
  10. #include <intuition/intuition.h>
  11. #include <proto/intuition.h>
  12. #include <stdarg.h>
  13.  
  14. #include "messages.h"
  15.  
  16. extern struct Window *window;
  17. static struct EasyStruct es;
  18.  
  19.  
  20. void InitMessages()        /* MUST be called before routines are used */
  21. {
  22.     es.es_StructSize = sizeof(struct EasyStruct);
  23.     es.es_Flags = 0;
  24.     es.es_Title = "PPData Message";
  25. }
  26.  
  27.  
  28. void __stdargs Message(char *s, ...)    /* simple message - OK response */
  29. {
  30.     va_list ap;
  31.     va_start(ap,s);
  32.  
  33.     es.es_TextFormat = s;
  34.     es.es_GadgetFormat = "OK";
  35.     EasyRequestArgs(window, &es, NULL, (APTR)ap);
  36. }
  37.  
  38.  
  39. LONG __stdargs Confirm(char *s, ...)    /* message requiring YES or NO response */
  40. {                /* returns TRUE==YES, FALSE==NO */
  41.     va_list ap;
  42.     va_start(ap,s);
  43.  
  44.     es.es_TextFormat = s;
  45.     es.es_GadgetFormat = "YES|NO";
  46.     return EasyRequestArgs(window, &es, NULL, (APTR)ap);
  47. }
  48.  
  49.  
  50. LONG __stdargs MultiRequest(char *responses, char *s, ...)
  51. {
  52.     va_list ap;
  53.     va_start(ap,s);
  54.  
  55.     es.es_TextFormat = s;
  56.     es.es_GadgetFormat = responses;
  57.     return EasyRequestArgs(window, &es, NULL, (APTR)ap);
  58. }
  59.