home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d536 / chemesthetics.lha / Chemesthetics / Source / Source.LZH / requests.c < prev    next >
C/C++ Source or Header  |  1991-04-20  |  3KB  |  89 lines

  1. /***************************************************************************
  2. * requests.c : aus irgendeinem unerfindlichen Grund ist der Startup-Code   *
  3. *           für SimpleRequest() und TwoGadgetRequest() aus der          *
  4. *           req.library nicht in den #pragmas in req.h enthalten,       *
  5. *           sondern nur im glue-File (lreqglue.o). Weil ich dieses      *
  6. *           benuztzen will (wozu gibt es schließlich pragmas) habe ich  *
  7. *           die unten stehenden Routinen aus req.doc kopiert. Dabei       *
  8. *           habe ich gleich noch den Gadget-Text beim SimpleRequest()   *
  9. *           ins deutsche übersetzt (wird je nach LANG-DEFINE benutzt    *
  10. *           oder nicht).                           *
  11. *                                       *
  12. * created: 21-Apr-91 Mtwx                           *
  13. * updated: 21-Apr-91 Mtwx                           *
  14. ***************************************************************************/
  15.  
  16. #include <stdarg.h>
  17. #include <exec/libraries.h>
  18. #include <intuition/intuition.h>
  19. #include <libraries/reqbase.h>
  20. #include <clib/req_protos.h>
  21. #include <req.h>
  22.  
  23. extern struct ReqLib *ReqBase;
  24.  
  25. void __stdargs SimpleRequest(char *str,...)
  26.     {
  27.     va_list ap;
  28.     struct TRStructure trs;
  29.  
  30.     va_start(ap,str);
  31.  
  32.     trs.Text = str;
  33.     trs.Controls = ap;
  34.     trs.Window = 0;
  35.     trs.MiddleText = 0;
  36.     trs.PositiveText = 0;
  37. #ifdef ENGLISH
  38.     trs.NegativeText = "Resume";
  39. #endif
  40. #ifdef GERMAN
  41.     trs.NegativeText = "Weiter";
  42. #endif
  43.     trs.Title = "Ahem...";
  44.     trs.KeyMask = 0xFFFF;
  45.     trs.textcolor = 2;
  46.     trs.detailcolor = 3;
  47.     trs.blockcolor = 2;
  48.     trs.versionnumber = REQVERSION;
  49.     trs.Timeout = 0;    /* you could put a timeout here if you wanted */
  50.     trs.AbortMask = 0;    /* If you wanted to abort this requester from another */
  51.                         /* process, pass the mask for Signal() in this element. */
  52.                         /* Then just Signal() the process that brought up the requester */
  53.     trs.rfu1 = 0;
  54.     TextRequest(&trs);
  55.     va_end(ap);
  56.     }
  57.  
  58. short __stdargs TwoGadRequest(char *str,...)
  59.     {
  60.     va_list ap;
  61.     struct TRStructure trs;
  62.     short res;
  63.  
  64.     va_start(ap,str);
  65.  
  66.     trs.Text = str;
  67.     trs.Controls = ap;
  68.     trs.Window = 0;
  69.     trs.MiddleText = 0;
  70.     trs.PositiveText = "  OK  ";
  71.     trs.NegativeText = "CANCEL";
  72.     trs.Title = "Ahem...";
  73.     trs.KeyMask = 0xFFFF;
  74.     trs.textcolor = 2;
  75.     trs.detailcolor = 3;
  76.     trs.blockcolor = 2;
  77.     trs.versionnumber = REQVERSION;
  78.     trs.Timeout = 0;    /* you could put a timeout here if you wanted */
  79.     trs.AbortMask = 0;    /* If you wanted to abort this requester from another */
  80.                         /* process, pass the mask for Signal() in this element. */
  81.                         /* Then just Signal() the process that brought up the requester */
  82.     trs.rfu1 = 0;
  83.  
  84.     res = TextRequest(&trs);
  85.     va_end(ap);
  86.     return(res);
  87.     }
  88.  
  89.