home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ICLUI.ZIP / LISTBOX / ALISTBOX.HPP < prev    next >
Text File  |  1993-03-08  |  4KB  |  72 lines

  1. #ifndef ALISTBOX_HPP
  2. #define ALISTBOX_HPP
  3. /******************************************************************************/
  4. /* List Box Sample Program                                                    */
  5. /*                                                                            */
  6. /* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1993. */
  7. /*                                                                            */
  8. /* DISCLAIMER OF WARRANTIES:                                                  */
  9. /*   The following [enclosed] code is sample code created by IBM              */
  10. /*   Corporation.  This sample code is not part of any standard IBM product   */
  11. /*   and is provided to you solely for the purpose of assisting you in the    */
  12. /*   development of your applications.  The code is provided "AS IS",         */
  13. /*   without warranty of any kind.  IBM shall not be liable for any damages   */
  14. /*   arising out of your use of the sample code, even if they have been       */
  15. /*   advised of the possibility of such damages.                              */
  16. /******************************************************************************/
  17. /* NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          */
  18. /******************************************************************************/
  19.  
  20. #include <iframe.hpp>                               // IFrame
  21. #include <icmdhdr.hpp>                              // ICommandHandler
  22. #include <iwindow.hpp>                              // IWindow
  23.  
  24. /******************************************************************************/
  25. /* Class   : AExceptionFn                                                     */
  26. /*                                                                            */
  27. /* Purpose : provide a default exception handler class by overriding the      */
  28. /*           handleException function                                         */
  29. /*           It is a subclass of the nested class IWindow::ExceptionFn        */
  30. /*                                                                            */
  31. /******************************************************************************/
  32. class AExceptionFn : public IWindow::ExceptionFn
  33. {
  34. public:
  35.                                         // constructor for class
  36.    AExceptionFn(IFrameWindow *frame) : owner(frame) {;}
  37.  
  38. Boolean
  39.    handleException(IException& exception, IEvent& event);
  40.  
  41. private:
  42.    IFrameWindow *owner;                 // owner of message box
  43. };
  44.  
  45. /******************************************************************************/
  46. /* Class   : AListBox                                                         */
  47. /*                                                                            */
  48. /* Purpose : main window for this example                                     */
  49. /*           the window contains a listbox in the client area                 */
  50. /*           an infoarea at the bottom and a static text frame extension      */
  51. /*           It is a subclass of IFrameWindow and ICommandHandler             */
  52. /*                                                                            */
  53. /******************************************************************************/
  54. class AListBox : public IFrameWindow,
  55.                  public ICommandHandler
  56. {
  57.   public:
  58.     AListBox(unsigned long windowId);   // constructor for this class
  59.  
  60.   protected:
  61.     void    setStatus();
  62.     Boolean command(ICommandEvent& cmdEvent);  // handler command events
  63.  
  64.   private:
  65.     IListBox        listbox;            // client area
  66.     IInfoArea       infoArea;           // infoarea (below client)
  67.     IStaticText     statusLine;         // status line (frame extension at top)
  68.     IMenuBar        menuBar;            // menu bar
  69.     AExceptionFn    excptHandler;       // exception handler
  70. };
  71. #endif
  72.