home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 10 / Fresh_Fish_10_2352.bin / new / dev / obero / oberon-a / examples / libraries / intuition / displayalert.mod < prev    next >
Text File  |  1995-07-02  |  2KB  |  56 lines

  1. (*************************************************************************
  2.  
  3.      $RCSfile: DisplayAlert.mod $
  4.   Description: A port of displayalert.c from the RKM:Libraries
  5.  
  6.                This program implements a recoverable alert.
  7.  
  8.    Created by: fjc (Frank Copeland)
  9.     $Revision: 1.4 $
  10.       $Author: fjc $
  11.         $Date: 1995/01/25 23:52:19 $
  12.  
  13.   Copyright © 1994, Frank Copeland.
  14.   This example program is part of Oberon-A.
  15.   See Oberon-A.doc for conditions of use and distribution.
  16.  
  17. *************************************************************************)
  18.  
  19. <* STANDARD- *>
  20.  
  21. MODULE DisplayAlert;
  22.  
  23. IMPORT d := Dos, i := Intuition;
  24.  
  25. CONST
  26.   VersionTag = "$VER: DisplayAlert 1.2 (19.9.94)\r\n";
  27.  
  28. (* Each string requires its own positioning information, as explained
  29. ** in the manual.  Hex notation has been used to specify the positions of
  30. ** the text.  Hex numbers start with a backslash, an "x" and the characters
  31. ** that make up the number.
  32. **
  33. ** Each line needs 2 bytes of X position, and 1 byte of Y position.
  34. **  In our 1st line: x - \x00\xF0 (2 bytes) and y = \x14 (1 byte)
  35. **  In our 2nd line: x - \x00\xA0 (2 bytes) and y = \x24 (1 byte)
  36. ** Each line is null terminated plus a continuation character (0=done).
  37. ** This example assumes that the compiler will concatenate adjacent
  38. ** strings into a single string with no extra NULLs.  The compiler does
  39. ** add the terminating NULL at the end of the entire string...The entire
  40. ** alert must end in TWO NULLS, one for the end of the string, and one
  41. ** for the NULL continuation character.
  42. *)
  43.  
  44. CONST
  45.   alertMsg =
  46.     "\x00\xF0\x14" "OH NO, NOT AGAIN!" "\x00\x01"
  47.     "\x00\x80\x24" "PRESS MOUSEBUTTON:   LEFT=TRUE   RIGHT=FALSE" "\x00";
  48.  
  49. BEGIN (* DisplayAlert *)
  50.   IF i.DisplayAlert (i.recoveryAlert, alertMsg, 52) THEN
  51.     d.PrintF ("Alert returned TRUE\n", NIL)
  52.   ELSE
  53.     d.PrintF ("Alert returned FALSE\n", NIL)
  54.   END
  55. END DisplayAlert.
  56.