home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / fish / science / chemesthetics / source / messagereq.c < prev    next >
C/C++ Source or Header  |  1990-12-06  |  1KB  |  40 lines

  1. #include <intuition/intuitionbase.h>
  2. /* messagereq.c: ruft Messagerequester auf */
  3.  
  4. struct Gadget MOK =
  5. {
  6.   NULL, 0, 40, 90, 14, GADGHCOMP, RELVERIFY | ENDGADGET, BOOLGADGET | REQGADGET, NULL,
  7.   NULL, NULL, 0, NULL, 41, NULL
  8. };
  9.  
  10. struct Requester MsgReq =
  11. {
  12.   NULL, 0, 0, 120, 60, 0, 0, &MOK, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL
  13. };
  14.  
  15. void      MessageReq(Window, text, background, shadow, textcol)
  16. struct Window *Window;
  17. char     *text;
  18. int      background, shadow, textcol;
  19. {
  20.   register int ende = 0;
  21.  
  22.   if ((strlen(text) * 8 + 15) > 120)
  23.     MsgReq.Width = strlen(text) * 8 + 20;
  24.   MsgReq.LeftEdge = (640 - MsgReq.Width) / 2;
  25.   MsgReq.TopEdge = (256 - MsgReq.Height) / 2;
  26.   MOK.LeftEdge = MsgReq.Width - 115;
  27.   Request(&MsgReq, Window);
  28.   ReqBlock(&MsgReq, shadow, 4, 2, MsgReq.Width - 4, 58);
  29.   ReqBlock(&MsgReq, background, 0, 0, MsgReq.Width - 4, 58);
  30.   ReqBox(&MsgReq, textcol, background, 2, 1, MsgReq.Width - 8, 56);
  31.   ReqPrint(&MsgReq, text, textcol, background, 10, 20);
  32.   ReqBox(&MsgReq, textcol, background, MOK.LeftEdge - 1, 39, 92, 16);
  33.   ReqPrint(&MsgReq, "OK", textcol, background, MOK.LeftEdge + 37, 49);
  34.   while (!ende)
  35.   {
  36.     if (Nachricht(Window) == GADGETUP)
  37.       ende++;
  38.   }
  39. }
  40.