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

  1. // msgbox.cpp RHS 11/25/91
  2.  
  3. #include<string.h>
  4. #include"msgbox.h"
  5.  
  6. MsgBox::MsgBox(char *title, char *message, char *prompt)
  7.     {
  8.     int top, left, height, width;
  9.  
  10.     if(Screen::Lines() > 25)
  11.         {
  12.         top = 17;
  13.         height = 10;
  14.         }
  15.     else
  16.         {
  17.         top = 8;
  18.         height = 10;
  19.         }
  20.     left = 10;
  21.     width = 60;
  22.  
  23.     PopWin pop(title, MakePosition(top, left, height, width));
  24.  
  25.     pop.Open();
  26.     if(strlen(message) > pop.Cols())
  27.         pop.AtSay(pop.Lines()/2,0,message,pop.GetColors());
  28.     else
  29.         pop.AtSay(pop.Lines()/2,(pop.Cols()-strlen(message))/2,
  30.             message,pop.GetColors());
  31.     pop.AtSay(pop.Lines()-1,0,prompt,pop.GetColors());
  32.     key = 0;
  33.     KeyBoard Key;
  34.     key = Key.Get();
  35.     pop.Close();
  36.     }
  37.  
  38.  
  39.