home *** CD-ROM | disk | FTP | other *** search
/ YPA: Your Privacy Assured / YPA.ISO / other_goodies / utilities / memomaster.lha / MM2.1 / source / display.c < prev    next >
C/C++ Source or Header  |  1994-09-12  |  2KB  |  81 lines

  1. /* Display.c
  2.  *   Contains functions for displaying text, eg help, messages, errors
  3.  *   and choices (returning 1 for Yes or 2 for No)
  4.  */
  5. #include <intuition/intuition.h>
  6. #include <exec/memory.h>
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include "mm2.h"
  10.  
  11. #define MINWINWIDTH 170
  12.  
  13. /* Prototypes */
  14. Prototype void DisplayE(char **);
  15. Prototype void DisplayT(char **);
  16. Prototype void DisplayH(char **);
  17. Prototype int DisplayC(char **);
  18. Prototype int Display(char **,int,int,int);
  19.  
  20. extern struct IntuitionBase *IntuitionBase;
  21.  
  22. /*====================================================================*/
  23. void DisplayE(char **txt)
  24.   {
  25.   Display(txt, 2, 0, 3);
  26.   }
  27. /*====================================================================*/
  28. void DisplayT(char **txt)
  29.   {
  30.   Display(txt, 1, 1, 0);
  31.   }
  32. /*====================================================================*/
  33. void DisplayH(char **txt)
  34.   {
  35.   Display(txt, 1, 2, 3);
  36.   }
  37. /*====================================================================*/
  38. DisplayC(char **txt)
  39.   {
  40.   return Display(txt, 0, 2, 3);
  41.   }
  42. /*====================================================================*/
  43.  
  44. Display(char **txt, int Mode, int FColour, int BColour)
  45. {
  46.   struct EasyStruct reqnochoice = {
  47.     sizeof( struct EasyStruct ),
  48.     0,
  49.     "MemoMaster V2.1",
  50.     "%s",
  51.     "Okay"
  52.   };
  53.   struct EasyStruct reqchoice = {
  54.     sizeof( struct EasyStruct ),
  55.     0,
  56.     "MemoMaster V2.1",
  57.     "%s",
  58.     "Yes|No"
  59.   };
  60.   char *text;
  61.   char msg[1024];
  62.  
  63.   strcpy(msg,"");
  64.   text = *txt;
  65.   while (*txt != NULL)
  66.   {
  67.     sprintf(msg,"%s%s\n",msg,*txt++);
  68.   }
  69.  
  70.   if (Mode == 0)
  71.   {
  72.     if (EasyRequest(mm_w,&reqchoice,NULL,msg))
  73.       return(1);
  74.     else
  75.       return(2);
  76.   }
  77.   else
  78.     EasyRequest(mm_w,&reqnochoice,NULL,msg);
  79. }
  80.  
  81.