home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / listpm3.zip / source / Exwmbox.hpp < prev    next >
C/C++ Source or Header  |  1996-07-08  |  2KB  |  54 lines

  1. /*
  2.     listPM list files under Presentation Manager. Uses Open Class Libarary.
  3.     Copyright (C) 1996  Paul Elliott
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19.     Paul Elliott
  20.     3987 South Gessner #224
  21.     Houston Tx 77063
  22.     Paul.Elliott@Hrnowl.LoneStar.Org
  23. */
  24. #ifndef EXWMBOX
  25. #define EXWMBOX
  26.  
  27. #include <iwindow.hpp>                   // define window
  28. #include <iexcbase.hpp>                  // exceptions
  29. #include <ievent.hpp>                    // events
  30. #include <imsgbox.hpp>                   // message boxes.
  31.  
  32.  
  33. // ExceptionFn class that displays exceptions thrown...
  34. // objects derived from IWindow::ExceptionFn can be set to b
  35. // called when a window throw an exception.
  36. class ExcWinMsgBox : public IWindow::ExceptionFn
  37. {
  38.      private:
  39.      public:
  40.  
  41.  
  42.         // display thrown exception on a message box.
  43.         virtual Boolean handleException(IException& dispatch,IEvent& evt)
  44.         {
  45.              // message box.
  46.              IMessageBox msg( evt.dispatchingWindow() );
  47.              msg.show(dispatch);              // display exception
  48.              return false;                    // hook not handle.
  49.         };
  50.  
  51.  
  52. };
  53. #endif
  54.