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

  1. /***************************************************************************
  2. * statistics.c : berechnet die Zeit, die zum Malen des Moleküls im Ka-       *
  3. *         lottenmodus benötigt wurde und zeigt diese in einem       *
  4. *         Requester an                           *
  5. ***************************************************************************/
  6.  
  7. #include <intuition/intuition.h>
  8. #include <proto/intuition.h>
  9. #include "messages.h"
  10.  
  11. extern struct Border OKBorder;
  12. extern struct IntuiText OKText;
  13.  
  14. static struct Gadget OK = {
  15.     NULL,        /* next gadget */
  16.     75,80,          /* origin XY of hit box relative to window TopLeft */
  17.     90,16,    /* hit box width and height */
  18.     GADGHBOX,   /* gadget flags */
  19.     RELVERIFY|ENDGADGET,      /* activation flags */
  20.     BOOLGADGET,    /* gadget type flags */
  21.     (APTR)&OKBorder, /* gadget border or image to be rendered */
  22.     NULL,    /* alternate imagery for selection */
  23.     &OKText,    /* first IntuiText structure */
  24.     NULL,    /* gadget mutual-exclude long word */
  25.     NULL,    /* SpecialInfo structure */
  26.     1,     /* user-definable data */
  27.     NULL    /* pointer to user-definable data */
  28. };
  29.  
  30. static SHORT StatVectors2[]={ 0,0,237,0,237,99,0,99,0,0 };
  31.  
  32. static struct Border StatBorder2={ 1,0,2,0,JAM1,5,StatVectors2,NULL };
  33.  
  34. static SHORT StatVectors[]={ 0,0,235,0,235,97,0,97,0,0 };
  35.  
  36. static struct Border StatBorder={ 2,1,1,0,JAM1,5,StatVectors,&StatBorder2 };
  37.  
  38. static struct Requester StatRequester=
  39. {
  40.   NULL,200,50,240,100,0,0,&OK,&StatBorder,NULL,NULL,0,NULL,NULL,NULL,
  41.   NULL, NULL
  42. };
  43.  
  44. extern int Nachricht();
  45.  
  46. void StatRequest(struct Window *win, long Zeit, int anzahl)
  47. {
  48.   long success;
  49.   char dummy[26];
  50.   struct IntuiMessage *message;
  51.  
  52.   success=Request(&StatRequester,win);
  53.   if(success)
  54.   {
  55.     ReqPrint(&StatRequester,STATISTICS,6,0,-1,10);
  56.     ReqPrint(&StatRequester,STAT_TIME,1,0,10,30);
  57.     sprintf(dummy,"%02d.%02d min",Zeit/60,Zeit % 60);
  58.     ReqPrint(&StatRequester,dummy,3,0,140,30);
  59.     ReqPrint(&StatRequester,STAT_NUM,1,0,10,50);
  60.     sprintf(dummy,"%02d",anzahl);
  61.     ReqPrint(&StatRequester,dummy,3,0,164,50);
  62. /*    if ((message = (struct IntuiMessage *) GetMsg(win->UserPort)) == NULL)
  63.       Wait(1L << win->UserPort->mp_SigBit);
  64.     ReplyMsg(message);
  65.     while (message = (struct IntuiMessage *) GetMsg(win->UserPort))
  66.       ReplyMsg(message);*/
  67.   }
  68. }
  69.