home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 073.lha / FileIO / alerts.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-02  |  1.9 KB  |  87 lines

  1.  
  2. /* *** alerts.c *************************************************************
  3.  *
  4.  * Alert and Abort AutoRequest Routines
  5.  *     from Book 1 of the Amiga Programmers' Suite by RJ Mical
  6.  *
  7.  * Copyright (C) 1986, 1987, Robert J. Mical
  8.  * All Rights Reserved.
  9.  *
  10.  * Created for Amiga developers.
  11.  * Any or all of this code can be used in any program as long as this
  12.  * entire copyright notice is retained, ok?
  13.  *
  14.  * HISTORY      NAME            DESCRIPTION
  15.  * -----------  --------------  --------------------------------------------
  16.  * 4 Feb 87     RJ              Real release
  17.  * 11 Jul 86    RJ >:-{)*       Prepare (clean house) for release
  18.  * 1 Feb 86     =RJ Mical=      Created this file with fond memories
  19.  *
  20.  * *********************************************************************** */
  21.  
  22.  
  23. #include <prosuite\prosuite.h>
  24. #include "alerts.h"
  25.  
  26.  
  27. extern struct TextAttr SafeFont;
  28.  
  29.  
  30. UBYTE *AlertStrings[] =
  31.     {
  32.     /*       "Longest allowed string -----------|" */
  33.     (UBYTE *)"Really broken.  Stop all and reboot",
  34.     (UBYTE *)"Out of memory!  Sheesh.",
  35.     (UBYTE *)"Invalid Disk or Drawer Selection",
  36.     };
  37.  
  38.  
  39. struct IntuiText AlertText =
  40.     {
  41.     AUTOFRONTPEN, AUTOBACKPEN, AUTODRAWMODE,
  42.     AUTOLEFTEDGE + ALERT_TEXT_LEFT, AUTOTOPEDGE + ALERT_TEXT_TOP,
  43.     &SafeFont,
  44.     NULL, NULL,
  45.     };
  46.  
  47.  
  48. struct IntuiText AlertOKText =
  49.     {
  50.     AUTOFRONTPEN, AUTOBACKPEN, AUTODRAWMODE,
  51.     AUTOLEFTEDGE, AUTOTOPEDGE,
  52.     &SafeFont,
  53.     (UBYTE *)"OK", 
  54.     NULL,
  55.     };
  56.  
  57.  
  58.  
  59. VOID AlertGrunt(text, window)
  60. UBYTE *text;
  61. struct Window *window;
  62. {
  63.     AlertText.IText = text;
  64.     AutoRequest(window, &AlertText, NULL, 
  65.             &AlertOKText, 0, 0, 320, 48 + ALERT_TEXT_TOP);
  66. }
  67.  
  68.  
  69.  
  70. VOID Alert(abortNumber, window)
  71. USHORT abortNumber;
  72. struct Window *window;
  73. {
  74.     AlertGrunt(AlertStrings[abortNumber], window);
  75. }
  76.  
  77.  
  78.  
  79. VOID Abort(abortNumber, window)
  80. USHORT abortNumber;
  81. struct Window *window;
  82. {
  83.     Alert(abortNumber, window);
  84.     FOREVER Alert(ALERT_ABORT, window);
  85. }
  86.  
  87.