home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / MCELCV / AMCELCV.HPP < prev    next >
Text File  |  1995-04-04  |  4KB  |  80 lines

  1. #ifndef AMCELCV_HPP
  2. #define AMCELCV_HPP
  3. /******************************************************************************/
  4. /* Canvas Classes Example 3 - Multi Cell Canvas                               */
  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>                   // IFrameWindow
  21. #include <istattxt.hpp>                 // IStaticText
  22. #include <ipushbut.hpp>                 // IPushButton
  23. #include <iradiobt.hpp>                 // IRadioButton
  24. #include <icheckbx.hpp>                 // ICheckBox
  25. #include <imcelcv.hpp>                  // IMultiCellCanvas
  26. #include <icmdhdr.hpp>                  // ICommandHandler
  27.  
  28. class AMultiCellCanvas;                 // forward declaration of class
  29. /******************************************************************************/
  30. /* Class   : APushButtonHandler                                               */
  31. /*                                                                            */
  32. /* Purpose : this is the command handler for the push button                  */
  33. /*           the push button handler uses the displayButtonStatus function    */
  34. /*           from the multi-cell canvas when the button is pressed            */
  35. /*           APushButtonHandler is derived from ICommandHandler               */
  36. /******************************************************************************/
  37. class APushButtonHandler : public ICommandHandler
  38. {
  39.   public:
  40.     APushButtonHandler() : window(0) {;}
  41.     inline APushButtonHandler
  42.      &setOwnerWindow(AMultiCellCanvas *pmcellcv) { window = pmcellcv; return *this; };
  43.   protected:
  44.     virtual Boolean
  45.       command( ICommandEvent& evt );
  46.   private:
  47.     AMultiCellCanvas  * window;
  48. };
  49. /******************************************************************************/
  50. /* Class   : AMultiCellCanvas                                                 */
  51. /*                                                                            */
  52. /* Purpose : main window for multi cell canvas sample application             */
  53. /*           the window contains a multi-cell canvas and the other controls   */
  54. /*           are attached to the canvas.  The pushbutton displays a           */
  55. /*           message box showing the current state of the buttons             */
  56. /*           AMultiCellCanvas is derived from IFrameWindow                    */
  57. /******************************************************************************/
  58. class AMultiCellCanvas : public IFrameWindow
  59. {
  60.   public:
  61.     AMultiCellCanvas(unsigned long windowId);
  62.  
  63. AMultiCellCanvas&
  64.     displayButtonStatus();
  65.  
  66.   private:
  67.     IMultiCellCanvas    clientCanvas;
  68.     IStaticText         status,
  69.                         title1,
  70.                         title2;
  71.     ICheckBox           check1,
  72.                         check2;
  73.     IRadioButton        radio1,
  74.                         radio2;
  75.     IPushButton         pushButton;
  76.     APushButtonHandler  pushButtonHandler;
  77. };
  78.  
  79. #endif
  80.