home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / msgbox / msgbox.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.5 KB  |  93 lines

  1. /******************************************************************************
  2. * .FILE:         msgbox.hpp                                                   *
  3. *                                                                             *
  4. * .DESCRIPTION:  Message Box Sample Program:  Class Header                    *
  5. *                                                                             *
  6. * .CLASSES:      AMsgBoxDemo                                                  *
  7. *                                                                             *
  8. * .COPYRIGHT:                                                                 *
  9. *    Licensed Material - Program-Property of IBM                              *
  10. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  11. *                                                                             *
  12. * .DISCLAIMER:                                                                *
  13. *   The following [enclosed] code is sample code created by IBM               *
  14. *   Corporation.  This sample code is not part of any standard IBM product    *
  15. *   and is provided to you solely for the purpose of assisting you in the     *
  16. *   development of your applications.  The code is provided 'AS IS',          *
  17. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  18. *   arising out of your use of the sample code, even if they have been        *
  19. *   advised of the possibility of such damages.                               *
  20. *                                                                             *
  21. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  22. *                                                                             *
  23. ******************************************************************************/
  24. #ifndef _MSGBOX_HPP
  25. #define _MSGBOX_HPP
  26.  
  27. #include <imsgbox.hpp>
  28. #include <iwindow.hpp>
  29. #include <iframe.hpp>
  30. #include <iexcept.hpp>
  31. #include <ireslib.hpp>
  32. #include <itrace.hpp>
  33. #include <istring.hpp>
  34. #include <ihelp.hpp>
  35. #include <imle.hpp>
  36. #include <icconst.h>
  37.  
  38. #include "msgbox.h"
  39.  
  40. /**************************************************************************
  41. * Class AMsgBoxDemo - Creates a main window to display the responses      *
  42. *   to a series of messages boxes.                                        *
  43. **************************************************************************/
  44. class AMsgBoxDemo : public IFrameWindow
  45. {
  46.   public:
  47. /*---------------------------- Constructor -------------------------------|
  48. | Constructs the object with:                                             |
  49. | 1) the window id                                                        |
  50. -------------------------------------------------------------------------*/
  51.     AMsgBoxDemo(unsigned long windowId);
  52.  
  53. /*----------------------------- Destructor -------------------------------|
  54. | Destructs the object with:                                              |
  55. | 1) no parameters                                                        |
  56. -------------------------------------------------------------------------*/
  57.     virtual
  58.      ~AMsgBoxDemo() { };
  59.  
  60. /*--------------------- Run Message Box Demonstration --------------------|
  61. | The runDemo function loops through a series of IMessageBox::show        |
  62. |   function calls, with the final show prompting the user for another    |
  63. |   time through the loop.  This function traces its progress to the      |
  64. |   ITrace destination and to the IMultiLineEdit window in the frame.     |
  65. |                                                                         |
  66. | The following protected functions are used by runDemo to produce the    |
  67. |   demonstration:                                                        |
  68. |     traceReply - Formats the message box reply to an IString, traces    |
  69. |                  traces the IString to the ITrace destination,          |
  70. |                  returns the IString to the caller.                     |
  71. |     throwException - Generates an IAccessError to demonstrate use of    |
  72. |                  a message box to display an exception.                 |
  73. |------------------------------------------------------------------------*/
  74.     AMsgBoxDemo
  75.      &runDemo();
  76.  
  77.   protected:
  78.     AMsgBoxDemo
  79.      &traceReply(IMessageBox::Response);
  80.     AMsgBoxDemo
  81.      &throwException();
  82.  
  83.   private:
  84.     IMultiLineEdit
  85.       mbResponses;
  86.     IMessageBox
  87.       mb;
  88.     IHelpWindow
  89.       mbHelp;
  90. };
  91.  
  92. #endif
  93.