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

  1. #ifndef ASETCV_HPP
  2. #define ASETCV_HPP
  3. /******************************************************************************/
  4. /* Canvas Classes Example 2 - Set 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 <iradiobt.hpp>                 // IRadioButton
  23. #include <isetcv.hpp>                   // ISetCanvas
  24. #include <isplitcv.hpp>                 // ISplitCanvas
  25. #include <iselhdr.hpp>                  // ISelectHandler
  26.  
  27. /******************************************************************************/
  28. /* Class   : AButtonHandler                                                   */
  29. /*                                                                            */
  30. /* Purpose : this is the select handler for the radio buttons.                */
  31. /*           The button handler is called when a radio button is selected.    */
  32. /*           It displays the number of the button in the static text that     */
  33. /*           is given to it using useInfoArea member function.                */
  34. /*           AButtonHandler is derived from ISelectHandler                    */
  35. /******************************************************************************/
  36. class AButtonHandler : public ISelectHandler
  37. {
  38.   public:
  39.     AButtonHandler() : output(0) {;}
  40.     AButtonHandler
  41.      &useStatus(IStaticText * pstatus) { output = pstatus; return *this; };
  42.   protected:
  43.     Boolean
  44.       selected( IControlEvent& evt );
  45.   private:
  46.     IStaticText
  47.      *output;
  48. };
  49.  
  50. /******************************************************************************/
  51. /* Class   : ASetCanvas                                                       */
  52. /*                                                                            */
  53. /* Purpose : main window for set canvas sample                                */
  54. /*           the window has a split canvas as the client area.                */
  55. /*           Three other controls are added to the split canvas. A static     */
  56. /*           text control is added in the top pane, the lower two panes       */
  57. /*           contain set canvases.                                            */
  58. /*           ASetCanvas is derived from IFrameWindow                          */
  59. /******************************************************************************/
  60. class ASetCanvas : public IFrameWindow
  61. {
  62.   public:
  63.     ASetCanvas(unsigned long windowId);                   // constructor
  64.    ~ASetCanvas();                                         // destructor
  65.  
  66.   private:
  67.     ISplitCanvas    clientCanvas;
  68.     IStaticText     status;
  69.     ISetCanvas      vSetCanvas,
  70.                     hSetCanvas;
  71.     IRadioButton  * radiobut[NUMBER_OF_BUTTONS];
  72.     AButtonHandler  buttonHandler;
  73. };
  74.  
  75. #endif
  76.