home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / df3os2.zip / NOTICE.H < prev    next >
C/C++ Source or Header  |  1993-09-23  |  1KB  |  52 lines

  1. // --------- notice.h
  2.  
  3. #ifndef NOTICE_H
  4. #define NOTICE_H
  5.  
  6. #include "dflatpp.h"
  7.  
  8. // ----------- Notice message window
  9. class NoticeBox : public Dialog    {
  10.     Label notice;
  11.     // ----- command button
  12.     OKButton ok;
  13. public:
  14.     NoticeBox(const char *text, const char *ttl);
  15. };
  16.  
  17. inline void Notice(const char *txt, const char *ttl = "Notice")
  18. {
  19.     NoticeBox(txt, ttl).Execute();
  20. }
  21.  
  22. // --------- Error message window
  23. class ErrorMessageBox : public NoticeBox    {
  24. public:
  25.     ErrorMessageBox(const char *text, const char *ttl);
  26. };
  27.  
  28. inline void ErrorMessage(const char *txt, const char *ttl = "Error")
  29. {
  30.     ErrorMessageBox(txt, ttl).Execute();
  31. }
  32.  
  33. // ------- Yes/No query window
  34. class YesNoBox : public Dialog    {
  35.     Label notice;
  36.     // ----- command button
  37.     YesButton yes;
  38.     NoButton  no;
  39. public:
  40.     YesNoBox(const char *txt, const char *ttl);
  41.     virtual void Keyboard(int key);
  42. };
  43.  
  44. inline Bool YesNo(const char *txt, const char *ttl = "")
  45. {
  46.     YesNoBox yn(txt, ttl);
  47.     yn.Execute();
  48.     return yn.OKExit();
  49. }
  50.  
  51. #endif
  52.