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

  1. /******************************************************************************
  2. * .FILE:         alistbox.hpp                                                 *
  3. *                                                                             *
  4. * .DESCRIPTION:  List Box Sample Program:  Class Definition                   *
  5. *                                                                             *
  6. * .CLASSES:      AListBox                                                     *
  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 ALISTBOX_HPP
  25. #define ALISTBOX_HPP
  26.  
  27. #include <iframe.hpp>
  28. #include <icmdhdr.hpp>
  29. #include <iwindow.hpp>
  30.  
  31. class AListBox;
  32.  
  33. class ACommandHandler: public ICommandHandler
  34. {
  35.   public:
  36. /*--------------------------------------------------------------------------|
  37. | Constructs the object with                                                |
  38. | 1) a pointer to the main window and a pointer to the listbox on the left  |
  39. ---------------------------------------------------------------------------*/
  40.     ACommandHandler(AListBox *, IListBox *);
  41.  
  42.     virtual Boolean
  43.       command( ICommandEvent& event);
  44.  
  45.   private:
  46.     AListBox
  47.      *alistbox;
  48.     IListBox
  49.      *listbox1;
  50. };
  51.  
  52.  
  53. /******************************************************************************
  54. * Class AListBox - Main window which contains a listbox.                      *
  55. ******************************************************************************/
  56. class AListBox : public IFrameWindow,
  57.                  public ICommandHandler
  58. {
  59.   public:
  60. /*--------------------------------------------------------------------------|
  61. | Constructs the object with                                                |
  62. | 1) the window id                                                          |
  63. ---------------------------------------------------------------------------*/
  64.     AListBox( unsigned long windowId );
  65.  
  66. /*--------------------------------------------------------------------------|
  67. | output(IString &) -  outputs a string to the trace listbox.               |
  68. | setStatus()       -  sets the initial status text                         |
  69. ---------------------------------------------------------------------------*/
  70.     AListBox
  71.      &output( const IString& astr ),
  72.      &setStatus();
  73.  
  74.   private:
  75.     IListBox
  76.       listbox,
  77.       listbox2;
  78.     IInfoArea
  79.       infoArea;
  80.     IStaticText
  81.       statusLine;
  82.     IMenuBar
  83.       menuBar;
  84.     ACommandHandler
  85.       commandhandler;
  86. };
  87. #endif
  88.