home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / exceptns / exviewer / exviewer.hpp < prev    next >
Text File  |  1996-10-29  |  2KB  |  65 lines

  1. #ifndef _EXVIEWER_
  2. #define _EXVIEWER_
  3. //************************************************************
  4. // Error Reporting - Exception Viewer Example
  5. //
  6. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  7. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  8. // All Rights Reserved.
  9. //************************************************************
  10. #include <iframe.hpp>
  11. #include <imle.hpp>    
  12. #include <icmdhdr.hpp> 
  13.  
  14. // forward declaration
  15. class ExceptionViewer;
  16.  
  17. class MenuHandler : public ICommandHandler
  18. {
  19. public:
  20.  
  21.  MenuHandler ( ExceptionViewer &excViewer )
  22.                   : viewer(excViewer) {}
  23.  
  24. protected:
  25. virtual Boolean
  26.   command    ( ICommandEvent& event );
  27.  
  28. private:
  29. ExceptionViewer
  30.  &viewer;
  31. MenuHandler ( const MenuHandler&);
  32. MenuHandler& operator= ( const MenuHandler&);
  33. };                    // MenuHandler
  34.  
  35. class ExceptionViewer : public IException::TraceFn,
  36.                         public IWindow::ExceptionFn
  37. {
  38. public:
  39.  
  40.  ExceptionViewer  ( );
  41.  
  42. IFrameWindow
  43.  &frame         ( )  { return frameWindow; }
  44. IMultiLineEdit
  45.  &mle           ( )  { return mleWindow; }
  46.  
  47. // callback functions from IException and IWindow
  48. virtual void                                                                
  49.   write ( const char* buffer );
  50. virtual Boolean                                                              
  51.   handleException (IException& exception, IEvent& event);
  52.  
  53. private:
  54. IFrameWindow
  55.   frameWindow;
  56. IMultiLineEdit
  57.   mleWindow;
  58. MenuHandler
  59.   menuHandler;
  60. ExceptionViewer (const ExceptionViewer&);
  61. ExceptionViewer& operator= (const ExceptionViewer&);
  62. };                    // ExceptionViewer
  63.                                                                              
  64. #endif // _EXVIEWER_
  65.