home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp11demo.zip / rtlsrc.rar / tv / MSGBOX.PAS < prev    next >
Pascal/Delphi Source File  |  1996-10-08  |  3KB  |  74 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Turbo Pascal Version 7.0                        }
  5. {       Turbo Vision Unit                               }
  6. {                                                       }
  7. {       Copyright (c) 1992 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10. {$PureInt+}
  11. unit MsgBox;
  12.  
  13. {$X+,I-,S-}
  14.  
  15. interface
  16.  
  17. uses Objects, Use32;
  18.  
  19. const
  20.  
  21. { Message box classes }
  22.  
  23.   mfWarning      = $0000;       { Display a Warning box }
  24.   mfError        = $0001;       { Dispaly a Error box }
  25.   mfInformation  = $0002;       { Display an Information Box }
  26.   mfConfirmation = $0003;       { Display a Confirmation Box }
  27.  
  28.   mfInsertInApp  = $0080;       { Insert message box into application }
  29.                                 { instead of the Desktop }
  30.  
  31. { Message box button flags }
  32.  
  33.   mfYesButton    = $0100;       { Put a Yes button into the dialog }
  34.   mfNoButton     = $0200;       { Put a No button into the dialog }
  35.   mfOKButton     = $0400;       { Put an OK button into the dialog }
  36.   mfCancelButton = $0800;       { Put a Cancel button into the dialog }
  37.  
  38.   mfYesNoCancel  = mfYesButton + mfNoButton + mfCancelButton;
  39.                                 { Standard Yes, No, Cancel dialog }
  40.   mfOKCancel     = mfOKButton + mfCancelButton;
  41.                                 { Standard OK, Cancel dialog }
  42.  
  43. { MessageBox displays the given string in a standard sized      }
  44. { dialog box. Before the dialog is displayed the Msg and Params }
  45. { are passed to FormatStr.  The resulting string is displayed   }
  46. { as a TStaticText view in the dialog.                          }
  47.  
  48. function MessageBox(const Msg: String; Params: Pointer;
  49.   AOptions: Word): Word;
  50.  
  51. { MessageBoxRec allows the specification of a TRect for the     }
  52. { message box to occupy.                                        }
  53.  
  54. function MessageBoxRect(var R: TRect; const Msg: String; Params: Pointer;
  55.   AOptions: Word): Word;
  56.  
  57. { InputBox displays a simple dialog that allows the user to     }
  58. { type in a string.                                             }
  59.  
  60. function InputBox(const Title, ALabel: String; var S: String;
  61.   Limit: Byte): Word;
  62.  
  63. { InputBoxRect is like InputBox but allows the specification of }
  64. { a rectangle.                                                  }
  65.  
  66. function InputBoxRect(var Bounds: TRect; const Title, ALabel: String;
  67.   var S: String;  Limit: Byte): Word;
  68.  
  69. implementation
  70.  
  71. uses Drivers, Views, Dialogs, App;
  72.  
  73. end.
  74.