home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1992 / 04 / msgbox.h < prev    next >
C/C++ Source or Header  |  1992-02-05  |  762b  |  37 lines

  1. // msgbox.h RHS 11/25/91
  2.  
  3. #if !defined(MSGBOX_H)
  4. #define MSGBOX_H
  5.  
  6. #include"window.h"
  7. #include"keyboard.h"
  8.  
  9. class MsgBox : public Screen
  10.     {
  11. protected:
  12.     int key;
  13.     virtual char *msgprompt(void)
  14.         {
  15.         return "Press any key to continue...";
  16.         }
  17.  
  18. public:
  19.     MsgBox(char *title, char *message, char *prompt = "Press any key to continue...");
  20.     };
  21.  
  22. class MsgBoxPrompt : public MsgBox
  23.     {
  24. protected:
  25.     virtual char *msgprompt(void)   {   return "";  }
  26. public:
  27.     MsgBoxPrompt(char *title, char *message)
  28.         : MsgBox(title, message, "")
  29.         {
  30.         }
  31.     int RetVal(void)    {   return key; }
  32.     BOOL Yes(void)      {   return (key == 'y' || key == 'Y') ? TRUE : FALSE; }
  33.     };
  34.  
  35. #endif
  36.  
  37.