home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / LISTBOX / ALISTBOX.HPP < prev    next >
Text File  |  1995-04-04  |  4KB  |  87 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. class AListBox;
  25.  
  26. /******************************************************************************/
  27. /* Class   : AExceptionFn                                                     */
  28. /*                                                                            */
  29. /* Purpose : provide a default exception handler class by overriding the      */
  30. /*           handleException function                                         */
  31. /*           It is a subclass of the nested class IWindow::ExceptionFn        */
  32. /*                                                                            */
  33. /******************************************************************************/
  34. class AExceptionFn : public IWindow::ExceptionFn
  35. {
  36. public:
  37.                                         // constructor for class
  38.    AExceptionFn(AListBox* frame) : owner(frame) {;}
  39.  
  40.    virtual Boolean
  41.      handleException(IException& exception, IEvent& event);
  42.  
  43. private:
  44.    AListBox                            // owner of message box
  45.     *owner;
  46. };
  47.  
  48. /******************************************************************************/
  49. /* Class   : AListBox                                                         */
  50. /*                                                                            */
  51. /* Purpose : main window for this example                                     */
  52. /*           the window contains a listbox in the client area                 */
  53. /*           an infoarea at the bottom and a static text frame extension      */
  54. /*           It is a subclass of IFrameWindow and ICommandHandler             */
  55. /*                                                                            */
  56. /******************************************************************************/
  57. class AListBox : public IFrameWindow,
  58.                  public ICommandHandler
  59. {
  60.   public:
  61.     AListBox(unsigned long windowId);   // constructor for this class
  62.  
  63.     AListBox
  64.      &output( const IString& astr );
  65.  
  66.   protected:
  67.     AListBox
  68.      &setStatus();
  69.  
  70.     virtual Boolean
  71.       command(ICommandEvent& cmdEvent); // handler command events
  72.  
  73.   private:
  74.     IListBox                            // client area
  75.       listbox,
  76.       listbox2;
  77.     IInfoArea                           // infoarea (below client)
  78.       infoArea;
  79.     IStaticText                         // status line (frame extension at top)
  80.       statusLine;
  81.     IMenuBar                            // menu bar
  82.       menuBar;
  83.     AExceptionFn                        // exception handler
  84.       excptHandler;
  85. };
  86. #endif
  87.